Shared UMEM with interfaces in different network namespaces

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

 



Hi,

I am using AF_XDP to forward packets between two Veth interfaces that are in two different network namespaces. The way I am currently doing this is by having one UMEM and one AF_XDP socket handled by a thread in each network namespace. When a packet arrives on the XSK RX ring in network namespace A, a pointer to the data frame (with the data length) is shared with thread B, which then copies it into a new descriptor in the XSK TX ring and submits it.

My goal is to reduce the memory consumption and improve performance by having a single UMEM shared between both Veth interfaces in order to forward packets without copying them from one interface to the other.

The first idea that I had was to create the UMEM in the root namespace and then to create the XSK in the threads with the same UMEM pointer. No errors arise from wiring it this way, but peeking on the RXQ always returns 0.

Here is a code snippet to illustrate the previous paragraph: https://gist.github.com/Dhiver/b821006c0166834a871fb00d50274770. Descriptors are only received when the UMEM is also created in "test-ns" network namespace.

What am I doing wrong? Is it even possible?

Best regards,
Bastien




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

  Powered by Linux