[PATCH 2/3] net/af_xdp: Fix mbuf alloc failed statistic
Stephen Hemminger
stephen at networkplumber.org
Fri May 10 17:06:12 CEST 2024
On Fri, 10 May 2024 10:03:57 +0000
Ciara Loftus <ciara.loftus at intel.com> wrote:
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index fee0d5d5f3..968bbf6d45 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -124,6 +124,7 @@ struct rx_stats {
> uint64_t rx_pkts;
> uint64_t rx_bytes;
> uint64_t rx_dropped;
> + uint64_t alloc_failed;
> };
You don't have to use local statistic for this, there already is one in the dev struct
i.e dev->data->rx_mbuf_alloc_failed. The problem is you need the DPDK port number to find
what dev is.
And the code in ethdev for stats get will put it in the right place.
PS: what is the point of rxq->stats.rx_dropped? It is never incremented.
PPS: Looks like AF_XDP considers kernel full as an error (ie tx_dropped gets counted as error).
This is not what real hardware does.
More information about the dev
mailing list