blob: 2c2596c993c5bb555666266ed90adf1bcbced475 [file] [log] [blame]
Christopher Ferris9ce28842018-10-25 12:11:39 -07001/****************************************************************************
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)
25struct 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};
32struct xdp_ring_offset {
33 __u64 producer;
34 __u64 consumer;
35 __u64 desc;
36};
37struct 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
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070050#define XDP_OPTIONS 8
Christopher Ferris9ce28842018-10-25 12:11:39 -070051struct xdp_umem_reg {
52 __u64 addr;
53 __u64 len;
54 __u32 chunk_size;
55 __u32 headroom;
56};
57struct xdp_statistics {
58 __u64 rx_dropped;
59 __u64 rx_invalid_descs;
60 __u64 tx_invalid_descs;
61};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070062struct xdp_options {
63 __u32 flags;
64};
65#define XDP_OPTIONS_ZEROCOPY (1 << 0)
Christopher Ferris9ce28842018-10-25 12:11:39 -070066#define XDP_PGOFF_RX_RING 0
67#define XDP_PGOFF_TX_RING 0x80000000
68#define XDP_UMEM_PGOFF_FILL_RING 0x100000000ULL
69#define XDP_UMEM_PGOFF_COMPLETION_RING 0x180000000ULL
70struct xdp_desc {
71 __u64 addr;
72 __u32 len;
73 __u32 options;
74};
75#endif