Re: AF_XDP and dma

Magnus Karlsson <[email protected]>
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <CAJ8uoz2Kv7aQP1BoxKET+v5k9jgSgQCK38RpNp-xCzwfEKvFRA@mail.gmail.com>
On Fri, Apr 9, 2021 at 11:36 AM ratheesh kannoth <[email protected]> wrote:
>
> Hi List,
>
> Could you help with the below query ?
>
> if userspace allocates UMEM memory in non contiguous physical memory
>  (contiguous in virual address space),  how can i configure DMA ?
>
> https://github.com/xdp-project/xdp-tutorial  AF_XDP example uses
> posix_memalign(). will it ensure each buffer chunk is in contiguous
> physical address space ?

The short answer is that you do not have to worry about that at all in
user space. DMA is taken care of by the kernel. The only requirement
is that the umem is located in a virtually contiguous address space
since you can only register one area per umem. Physically, it can be
located scattered around the whole memory, but you do not have to
worry about that. posix_memalign() only aligns the allocated area in
virtual memory. It does not guarantee anything else.

/Magnus

> -Ratheesh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.