Dear Stephen,

In r8169 pmd, mdelay and udelay are macros.
#define mdelay rte_delay_ms
#define udelay rte_delay_us

Best Regards,
Howard Wang

-----邮件原件-----
发件人: Stephen Hemminger <step...@networkplumber.org> 
发送时间: 2024年10月18日 0:34
收件人: 王颢 <howard_w...@realsil.com.cn>
抄送: dev@dpdk.org; pro_nic_d...@realtek.com
主题: Re: [PATCH v2 03/18] net/r8169: add hardware registers access routines


External mail.



On Thu, 17 Oct 2024 14:31:45 +0800
Howard Wang <howard_w...@realsil.com.cn> wrote:

> +u32
> +rtl_csi_read(struct rtl_hw *hw, u32 addr) {
> +     u32 cmd;
> +     int i;
> +     u32 value = 0;
> +
> +     cmd = CSIAR_Read | CSIAR_ByteEn << CSIAR_ByteEn_shift |
> +           (addr & CSIAR_Addr_Mask);
> +
> +     RTL_W32(hw, CSIAR, cmd);
> +
> +     for (i = 0; i < 10; i++) {
> +             udelay(100);

With DPDK drivers, it is preferred to use rte_delay instead of usleep.
Usleep ends up being a system call (nanosleep) and that can take much longer 
than you want. rte_delay_us() is a spin loop.

Reply via email to