History

xsk: add umem completion queue support and mmap

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.

Magnus Karlsson committed 8 years ago

Commit fe230831 parent 02671e24 files · +15 −2Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/if_xdp.h+2−0
@@ -36,6 +36,7 @@ struct sockaddr_xdp { · 35 unmodified lines
36#define XDP_RX_RING 136#define XDP_RX_RING 1
37#define XDP_UMEM_REG 337#define XDP_UMEM_REG 3
38#define XDP_UMEM_FILL_RING 438#define XDP_UMEM_FILL_RING 4
39#define XDP_UMEM_COMPLETION_RING 5
39 40
40struct xdp_umem_reg {41struct 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 049#define XDP_PGOFF_RX_RING 0
49#define XDP_UMEM_PGOFF_FILL_RING 0x10000000050#define XDP_UMEM_PGOFF_FILL_RING 0x100000000
51#define XDP_UMEM_PGOFF_COMPLETION_RING 0x180000000
50 52
51struct xdp_desc {53struct xdp_desc {
52 __u32 idx;54 __u32 idx;