Here, we add another setsockopt for registered user memory (umem) called XDP_UMEM_COMPLETION_QUEUE. Using this socket option, the process can ask the kernel to allocate a queue (ring buffer) and also mmap it (XDP_UMEM_PGOFF_COMPLETION_QUEUE) into the process. The queue is used to explicitly pass ownership of umem frames from the kernel to user process. This will be used by the TX path to tell user space that a certain frame has been transmitted and user space can use it for something else, if it wishes.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -36,6 +36,7 @@ struct sockaddr_xdp { · 35 unmodified lines | |||
| 36 | #define XDP_RX_RING 1 | 36 | #define XDP_RX_RING 1 |
| 37 | #define XDP_UMEM_REG 3 | 37 | #define XDP_UMEM_REG 3 |
| 38 | #define XDP_UMEM_FILL_RING 4 | 38 | #define XDP_UMEM_FILL_RING 4 |
| 39 | #define XDP_UMEM_COMPLETION_RING 5 | ||
| 39 | 40 | ||
| 40 | struct xdp_umem_reg { | 41 | struct xdp_umem_reg { |
| 41 | __u64 addr; /* Start of packet data area */ | 42 | __u64 addr; /* Start of packet data area */ |
| @@ -47,6 +48,7 @@ struct xdp_umem_reg { · 5 unmodified lines | |||
| 47 | /* Pgoff for mmaping the rings */ | 48 | /* Pgoff for mmaping the rings */ |
| 48 | #define XDP_PGOFF_RX_RING 0 | 49 | #define XDP_PGOFF_RX_RING 0 |
| 49 | #define XDP_UMEM_PGOFF_FILL_RING 0x100000000 | 50 | #define XDP_UMEM_PGOFF_FILL_RING 0x100000000 |
| 51 | #define XDP_UMEM_PGOFF_COMPLETION_RING 0x180000000 | ||
| 50 | 52 | ||
| 51 | struct xdp_desc { | 53 | struct xdp_desc { |
| 52 | __u32 idx; | 54 | __u32 idx; |