| Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 2 | **************************************************************************** | 
|  | 3 | *** | 
|  | 4 | ***   This header was automatically generated from a Linux kernel header | 
|  | 5 | ***   of the same name, to make information necessary for userspace to | 
|  | 6 | ***   call into the kernel available to libc.  It contains only constants, | 
|  | 7 | ***   structures, and macros generated from the original header, and thus, | 
|  | 8 | ***   contains no copyrightable information. | 
|  | 9 | *** | 
|  | 10 | ***   To edit the content of this header, modify the corresponding | 
|  | 11 | ***   source file (e.g. under external/kernel-headers/original/) then | 
|  | 12 | ***   run bionic/libc/kernel/tools/update_all.py | 
|  | 13 | *** | 
|  | 14 | ***   Any manual change here will be lost the next time this script will | 
|  | 15 | ***   be run. You've been warned! | 
|  | 16 | *** | 
|  | 17 | **************************************************************************** | 
|  | 18 | ****************************************************************************/ | 
|  | 19 | #ifndef _LINUX_IF_XDP_H | 
|  | 20 | #define _LINUX_IF_XDP_H | 
|  | 21 | #include <linux/types.h> | 
|  | 22 | #define XDP_SHARED_UMEM (1 << 0) | 
|  | 23 | #define XDP_COPY (1 << 1) | 
|  | 24 | #define XDP_ZEROCOPY (1 << 2) | 
|  | 25 | struct sockaddr_xdp { | 
|  | 26 | __u16 sxdp_family; | 
|  | 27 | __u16 sxdp_flags; | 
|  | 28 | __u32 sxdp_ifindex; | 
|  | 29 | __u32 sxdp_queue_id; | 
|  | 30 | __u32 sxdp_shared_umem_fd; | 
|  | 31 | }; | 
|  | 32 | struct xdp_ring_offset { | 
|  | 33 | __u64 producer; | 
|  | 34 | __u64 consumer; | 
|  | 35 | __u64 desc; | 
|  | 36 | }; | 
|  | 37 | struct xdp_mmap_offsets { | 
|  | 38 | struct xdp_ring_offset rx; | 
|  | 39 | struct xdp_ring_offset tx; | 
|  | 40 | struct xdp_ring_offset fr; | 
|  | 41 | struct xdp_ring_offset cr; | 
|  | 42 | }; | 
|  | 43 | #define XDP_MMAP_OFFSETS 1 | 
|  | 44 | #define XDP_RX_RING 2 | 
|  | 45 | #define XDP_TX_RING 3 | 
|  | 46 | #define XDP_UMEM_REG 4 | 
|  | 47 | #define XDP_UMEM_FILL_RING 5 | 
|  | 48 | #define XDP_UMEM_COMPLETION_RING 6 | 
|  | 49 | #define XDP_STATISTICS 7 | 
|  | 50 | struct xdp_umem_reg { | 
|  | 51 | __u64 addr; | 
|  | 52 | __u64 len; | 
|  | 53 | __u32 chunk_size; | 
|  | 54 | __u32 headroom; | 
|  | 55 | }; | 
|  | 56 | struct xdp_statistics { | 
|  | 57 | __u64 rx_dropped; | 
|  | 58 | __u64 rx_invalid_descs; | 
|  | 59 | __u64 tx_invalid_descs; | 
|  | 60 | }; | 
|  | 61 | #define XDP_PGOFF_RX_RING 0 | 
|  | 62 | #define XDP_PGOFF_TX_RING 0x80000000 | 
|  | 63 | #define XDP_UMEM_PGOFF_FILL_RING 0x100000000ULL | 
|  | 64 | #define XDP_UMEM_PGOFF_COMPLETION_RING 0x180000000ULL | 
|  | 65 | struct xdp_desc { | 
|  | 66 | __u64 addr; | 
|  | 67 | __u32 len; | 
|  | 68 | __u32 options; | 
|  | 69 | }; | 
|  | 70 | #endif |