1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef _LINUX_IF_XDP_H 7 #define _LINUX_IF_XDP_H 8 #include <linux/types.h> 9 #define XDP_SHARED_UMEM (1 << 0) 10 #define XDP_COPY (1 << 1) 11 #define XDP_ZEROCOPY (1 << 2) 12 struct sockaddr_xdp { 13 __u16 sxdp_family; 14 __u16 sxdp_flags; 15 __u32 sxdp_ifindex; 16 __u32 sxdp_queue_id; 17 __u32 sxdp_shared_umem_fd; 18 }; 19 struct xdp_ring_offset { 20 __u64 producer; 21 __u64 consumer; 22 __u64 desc; 23 }; 24 struct xdp_mmap_offsets { 25 struct xdp_ring_offset rx; 26 struct xdp_ring_offset tx; 27 struct xdp_ring_offset fr; 28 struct xdp_ring_offset cr; 29 }; 30 #define XDP_MMAP_OFFSETS 1 31 #define XDP_RX_RING 2 32 #define XDP_TX_RING 3 33 #define XDP_UMEM_REG 4 34 #define XDP_UMEM_FILL_RING 5 35 #define XDP_UMEM_COMPLETION_RING 6 36 #define XDP_STATISTICS 7 37 struct xdp_umem_reg { 38 __u64 addr; 39 __u64 len; 40 __u32 chunk_size; 41 __u32 headroom; 42 }; 43 struct xdp_statistics { 44 __u64 rx_dropped; 45 __u64 rx_invalid_descs; 46 __u64 tx_invalid_descs; 47 }; 48 #define XDP_PGOFF_RX_RING 0 49 #define XDP_PGOFF_TX_RING 0x80000000 50 #define XDP_UMEM_PGOFF_FILL_RING 0x100000000ULL 51 #define XDP_UMEM_PGOFF_COMPLETION_RING 0x180000000ULL 52 struct xdp_desc { 53 __u64 addr; 54 __u32 len; 55 __u32 options; 56 }; 57 #endif 58