Re: AF_XDP and dma

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 9, 2021 at 12:50 PM ratheesh kannoth <ratheesh.ksz@xxxxxxxxx> wrote:
>
> On Fri, Apr 9, 2021 at 3:50 PM Magnus Karlsson
> <magnus.karlsson@xxxxxxxxx> wrote:
> > Then looking at user-space code will not help you :-). Take a look at
> > the code in driver/net/ethernet/intel/i40e/i40e_xsk.c in the Linux
> > kernel for an example on how to DMA map the umem.
>
> Thanks, i could see that it is pinning the pages and mapping.
>
> Using Kernel DMA api, we can map the virtual memory. But how the NIC
> can write/read to the memory if it is not physically contiguous. NIC
> card only understand physical addresses. Correct me.

In XDP/AF_XDP mode, the NIC only uses a single 4K page (on x86-64) per
packet so it will be physically contiguous by definition. Every single
page will be dma mapped separately and can reside anywhere. There is
no scatter-gather in XDP/AF_XDP mode.

> > > > > > /Magnus



[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux