[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251004164508.GG3060232@horms.kernel.org>
Date: Sat, 4 Oct 2025 17:45:08 +0100
From: Simon Horman <horms@...nel.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, andrew+netdev@...n.ch, bpf@...r.kernel.org,
alexanderduyck@...com, sdf@...ichev.me, mohsin.bashr@...il.com
Subject: Re: [PATCH net 2/9] eth: fbnic: fix accounting of XDP packets
On Fri, Oct 03, 2025 at 04:30:18PM -0700, Jakub Kicinski wrote:
> Make XDP-handled packets appear in the Rx stats. The driver has been
> counting XDP_TX packets on the Tx ring, but there wasn't much accounting
> on the Rx side (the Rx bytes appear to be incremented on XDP_TX but
> XDP_DROP / XDP_ABORT are only counted as Rx drops).
>
> Counting XDP_TX packets (not just bytes) in Rx stats looks like
> a simple bug of omission.
>
> The XDP_DROP handling appears to be intentional. Whether XDP_DROP
> packets should be counted in interface-level Rx stats is a bit
> unclear historically. When we were defining qstats, however,
> we clarified based on operational experience that in this context:
>
> name: rx-packets
> doc: |
> Number of wire packets successfully received and passed to the stack.
> For drivers supporting XDP, XDP is considered the first layer
> of the stack, so packets consumed by XDP are still counted here.
>
> fbnic does not obey this requirement. Since XDP support has been added
> in current release cycle, instead of splitting interface and qstat
> handling - make them both follow the qstat definition.
>
> Another small tweak here is that we count bytes as received on the wire
> rather than post-XDP bytes (xdp_get_buff_len() vs skb->len).
>
> Fixes: 5213ff086344 ("eth: fbnic: Collect packet statistics for XDP")
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists