0001
0002
0003
0004
0005
0006
0007 #ifndef _LINUX_XDP_DIAG_H
0008 #define _LINUX_XDP_DIAG_H
0009
0010 #include <linux/types.h>
0011
0012 struct xdp_diag_req {
0013 __u8 sdiag_family;
0014 __u8 sdiag_protocol;
0015 __u16 pad;
0016 __u32 xdiag_ino;
0017 __u32 xdiag_show;
0018 __u32 xdiag_cookie[2];
0019 };
0020
0021 struct xdp_diag_msg {
0022 __u8 xdiag_family;
0023 __u8 xdiag_type;
0024 __u16 pad;
0025 __u32 xdiag_ino;
0026 __u32 xdiag_cookie[2];
0027 };
0028
0029 #define XDP_SHOW_INFO (1 << 0)
0030 #define XDP_SHOW_RING_CFG (1 << 1)
0031 #define XDP_SHOW_UMEM (1 << 2)
0032 #define XDP_SHOW_MEMINFO (1 << 3)
0033 #define XDP_SHOW_STATS (1 << 4)
0034
0035 enum {
0036 XDP_DIAG_NONE,
0037 XDP_DIAG_INFO,
0038 XDP_DIAG_UID,
0039 XDP_DIAG_RX_RING,
0040 XDP_DIAG_TX_RING,
0041 XDP_DIAG_UMEM,
0042 XDP_DIAG_UMEM_FILL_RING,
0043 XDP_DIAG_UMEM_COMPLETION_RING,
0044 XDP_DIAG_MEMINFO,
0045 XDP_DIAG_STATS,
0046 __XDP_DIAG_MAX,
0047 };
0048
0049 #define XDP_DIAG_MAX (__XDP_DIAG_MAX - 1)
0050
0051 struct xdp_diag_info {
0052 __u32 ifindex;
0053 __u32 queue_id;
0054 };
0055
0056 struct xdp_diag_ring {
0057 __u32 entries;
0058 };
0059
0060 #define XDP_DU_F_ZEROCOPY (1 << 0)
0061
0062 struct xdp_diag_umem {
0063 __u64 size;
0064 __u32 id;
0065 __u32 num_pages;
0066 __u32 chunk_size;
0067 __u32 headroom;
0068 __u32 ifindex;
0069 __u32 queue_id;
0070 __u32 flags;
0071 __u32 refs;
0072 };
0073
0074 struct xdp_diag_stats {
0075 __u64 n_rx_dropped;
0076 __u64 n_rx_invalid;
0077 __u64 n_rx_full;
0078 __u64 n_fill_ring_empty;
0079 __u64 n_tx_invalid;
0080 __u64 n_tx_ring_empty;
0081 };
0082
0083 #endif