diff options
author | Ciara Loftus <ciara.loftus@intel.com> | 2020-07-08 09:28:33 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-14 00:32:56 +0200 |
commit | 8aa5a33578e9685d06020bd10d1637557423e945 (patch) | |
tree | 848b7defe21085b2fbd44cc2acc42a2a769c01d4 /net/xdp/xsk_queue.h | |
parent | Merge branch 'resolve_btfids' (diff) | |
download | linux-8aa5a33578e9685d06020bd10d1637557423e945.tar.xz 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 'net/xdp/xsk_queue.h')
-rw-r--r-- | net/xdp/xsk_queue.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h index 5b5d24d2dd37..bf42cfd74b89 100644 --- a/net/xdp/xsk_queue.h +++ b/net/xdp/xsk_queue.h @@ -38,6 +38,7 @@ struct xsk_queue { u32 cached_cons; struct xdp_ring *ring; u64 invalid_descs; + u64 queue_empty_descs; }; /* The structure of the shared state of the rings are the same as the @@ -354,6 +355,11 @@ static inline u64 xskq_nb_invalid_descs(struct xsk_queue *q) return q ? q->invalid_descs : 0; } +static inline u64 xskq_nb_queue_empty_descs(struct xsk_queue *q) +{ + return q ? q->queue_empty_descs : 0; +} + struct xsk_queue *xskq_create(u32 nentries, bool umem_queue); void xskq_destroy(struct xsk_queue *q_ops); |