summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCiara Loftus <ciara.loftus@intel.com>2020-07-08 07:28:33 +0000
committerAlexei Starovoitov <ast@kernel.org>2020-07-13 15:32:56 -0700
commit8aa5a33578e9685d06020bd10d1637557423e945 (patch)
tree848b7defe21085b2fbd44cc2acc42a2a769c01d4 /include
parent24a38b7c0c2c17f7b86c29f82beb7f2779704ca3 (diff)
downloadlinux-8aa5a33578e9685d06020bd10d1637557423e945.tar.gz
linux-8aa5a33578e9685d06020bd10d1637557423e945.tar.bz2
linux-8aa5a33578e9685d06020bd10d1637557423e945.zip
xsk: Add new statistics
It can be useful for the user to know the reason behind a dropped packet. Introduce new counters which track drops on the receive path caused by: 1. rx ring being full 2. fill ring being empty Also, on the tx path introduce a counter which tracks the number of times we attempt pull from the tx ring when it is empty. Signed-off-by: Ciara Loftus <ciara.loftus@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200708072835.4427-2-ciara.loftus@intel.com
Diffstat (limited to 'include')
-rw-r--r--include/net/xdp_sock.h4
-rw-r--r--include/uapi/linux/if_xdp.h5
2 files changed, 8 insertions, 1 deletions
diff --git a/include/net/xdp_sock.h b/include/net/xdp_sock.h
index 96bfc5f5f24e..c9d87cc40c11 100644
--- a/include/net/xdp_sock.h
+++ b/include/net/xdp_sock.h
@@ -69,7 +69,11 @@ struct xdp_sock {
spinlock_t tx_completion_lock;
/* Protects generic receive. */
spinlock_t rx_lock;
+
+ /* Statistics */
u64 rx_dropped;
+ u64 rx_queue_full;
+
struct list_head map_list;
/* Protects map_list */
spinlock_t map_list_lock;
diff --git a/include/uapi/linux/if_xdp.h b/include/uapi/linux/if_xdp.h
index be328c59389d..a78a8096f4ce 100644
--- a/include/uapi/linux/if_xdp.h
+++ b/include/uapi/linux/if_xdp.h
@@ -73,9 +73,12 @@ struct xdp_umem_reg {
};
struct xdp_statistics {
- __u64 rx_dropped; /* Dropped for reasons other than invalid desc */
+ __u64 rx_dropped; /* Dropped for other reasons */
__u64 rx_invalid_descs; /* Dropped due to invalid descriptor */
__u64 tx_invalid_descs; /* Dropped due to invalid descriptor */
+ __u64 rx_ring_full; /* Dropped due to rx ring being full */
+ __u64 rx_fill_ring_empty_descs; /* Failed to retrieve item from fill ring */
+ __u64 tx_ring_empty_descs; /* Failed to retrieve item from tx ring */
};
struct xdp_options {