diff options
author | Magnus Karlsson <magnus.karlsson@intel.com> | 2018-05-02 14:01:35 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-05-04 01:55:25 +0300 |
commit | af75d9e02d08dc55ce6a1e42e485465c630d7349 (patch) | |
tree | 7185c5ca061b68c48b239ae8d2df958ac19223a8 /include | |
parent | 35fcde7f8deb51b707b161bf19cbd22363aef2df (diff) | |
download | linux-af75d9e02d08dc55ce6a1e42e485465c630d7349.tar.xz |
xsk: statistics support
In this commit, a new getsockopt is added: XDP_STATISTICS. This is
used to obtain stats from the sockets.
v2: getsockopt now returns size of stats structure.
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/if_xdp.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/uapi/linux/if_xdp.h b/include/uapi/linux/if_xdp.h index e2ea878d025c..77b88c4efe98 100644 --- a/include/uapi/linux/if_xdp.h +++ b/include/uapi/linux/if_xdp.h @@ -38,6 +38,7 @@ struct sockaddr_xdp { #define XDP_UMEM_REG 3 #define XDP_UMEM_FILL_RING 4 #define XDP_UMEM_COMPLETION_RING 5 +#define XDP_STATISTICS 6 struct xdp_umem_reg { __u64 addr; /* Start of packet data area */ @@ -46,6 +47,12 @@ struct xdp_umem_reg { __u32 frame_headroom; /* Frame head room */ }; +struct xdp_statistics { + __u64 rx_dropped; /* Dropped for reasons other than invalid desc */ + __u64 rx_invalid_descs; /* Dropped due to invalid descriptor */ + __u64 tx_invalid_descs; /* Dropped due to invalid descriptor */ +}; + /* Pgoff for mmaping the rings */ #define XDP_PGOFF_RX_RING 0 #define XDP_PGOFF_TX_RING 0x80000000 |