]> Gentwo Git Trees - linux/.git/commit
eth: fbnic: fix accounting of XDP packets
authorJakub Kicinski <kuba@kernel.org>
Tue, 7 Oct 2025 23:26:46 +0000 (16:26 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 9 Oct 2025 09:10:02 +0000 (11:10 +0200)
commit613e9e8dcb7e2523943d3cf965f3183c54b32adb
tree73beaf6f9165bb66a339f69506e49926b9efaf5c
parent7e617d57f2a2f0cc3c5d91b5594df7fd1f2e4459
eth: fbnic: fix accounting of XDP packets

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).

Reviewed-by: Simon Horman <horms@kernel.org>
Fixes: 5213ff086344 ("eth: fbnic: Collect packet statistics for XDP")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20251007232653.2099376-3-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c