netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 0/9] eth: fbnic: fix XDP_TX and XDP vs qstats
@ 2025-10-07 23:26 Jakub Kicinski
  2025-10-07 23:26 ` [PATCH net v2 1/9] eth: fbnic: fix missing programming of the default descriptor Jakub Kicinski
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Jakub Kicinski @ 2025-10-07 23:26 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, andrew+netdev, horms, bpf,
	Jakub Kicinski

Fix XDP_TX hangs and adjust the XDP statistics to match the definition
of qstats. The three problems are somewhat distinct.

XDP_TX hangs is a simple coding bug (patch 1).

The accounting of XDP packets is all over the place. Fix it to obey
qstat rules (packets seen by XDP always counted as Rx packets).
Patch 2 fixes the basic accounting, patch 3 touches up saving
the stats when rings are freed.

Patch 6 corrects reporting of alloc_fail stats which prevented
the pp_alloc_fail test from passing.

Patches 4, 5, 7, 8, 9 add or fix related test cases.

v2:
 - [patch 2] remove now unnecessary byte adjustment
 - [patch 8] use seen_fails more
v1: https://lore.kernel.org/20251003233025.1157158-1-kuba@kernel.org

Testing on fbnic below:

 $ ./tools/testing/selftests/drivers/net/hw/pp_alloc_fail.py
 TAP version 13
 1..1
 fbnic-err: bad MMIO read address 0x80074
 fbnic-err: bad MMIO read address 0x80074
 # Seen: pkts:20605 fails:40 (pass thrs:12)
 # ethtool -G change retval: success
 ok 1 pp_alloc_fail.test_pp_alloc
 # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0

 $ ./tools/testing/selftests/drivers/net/xdp.py
 TAP version 13
 1..13
 ok 1 xdp.test_xdp_native_pass_sb
 ok 2 xdp.test_xdp_native_pass_mb
 ok 3 xdp.test_xdp_native_drop_sb
 ok 4 xdp.test_xdp_native_drop_mb
 ok 5 xdp.test_xdp_native_tx_sb
 ok 6 xdp.test_xdp_native_tx_mb
 # Failed run: pkt_sz 2048, offset 1. Last successful run: pkt_sz 1024, offset 256. Reason: Adjustment failed
 ok 7 xdp.test_xdp_native_adjst_tail_grow_data
 ok 8 xdp.test_xdp_native_adjst_tail_shrnk_data
 # Failed run: pkt_sz 512, offset -256. Last successful run: pkt_sz 512, offset -128. Reason: Adjustment failed
 ok 9 xdp.test_xdp_native_adjst_head_grow_data
 # Failed run: pkt_sz (2048) > HDS threshold (1536) and offset 64 > 48
 ok 10 xdp.test_xdp_native_adjst_head_shrnk_data
 ok 11 xdp.test_xdp_native_qstats_pass
 ok 12 xdp.test_xdp_native_qstats_drop
 ok 13 xdp.test_xdp_native_qstats_tx
 # Totals: pass:13 fail:0 xfail:0 xpass:0 skip:0 error:0

Jakub Kicinski (9):
  eth: fbnic: fix missing programming of the default descriptor
  eth: fbnic: fix accounting of XDP packets
  eth: fbnic: fix saving stats from XDP_TX rings on close
  selftests: drv-net: xdp: rename netnl to ethnl
  selftests: drv-net: xdp: add test for interface level qstats
  eth: fbnic: fix reporting of alloc_failed qstats
  selftests: drv-net: fix linter warnings in pp_alloc_fail
  selftests: drv-net: pp_alloc_fail: lower traffic expectations
  selftests: drv-net: pp_alloc_fail: add necessary optoins to config

 .../net/ethernet/meta/fbnic/fbnic_netdev.h    |  1 +
 drivers/net/ethernet/meta/fbnic/fbnic_txrx.h  |  7 ++
 .../net/ethernet/meta/fbnic/fbnic_ethtool.c   |  6 +-
 drivers/net/ethernet/meta/fbnic/fbnic_mac.c   |  8 ++
 .../net/ethernet/meta/fbnic/fbnic_netdev.c    | 23 ++++-
 drivers/net/ethernet/meta/fbnic/fbnic_txrx.c  | 74 +++++++++-----
 tools/testing/selftests/drivers/net/hw/config |  4 +
 .../selftests/drivers/net/hw/pp_alloc_fail.py | 36 ++++---
 tools/testing/selftests/drivers/net/xdp.py    | 99 +++++++++++++++++--
 9 files changed, 209 insertions(+), 49 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-10-09  9:20 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-07 23:26 [PATCH net v2 0/9] eth: fbnic: fix XDP_TX and XDP vs qstats Jakub Kicinski
2025-10-07 23:26 ` [PATCH net v2 1/9] eth: fbnic: fix missing programming of the default descriptor Jakub Kicinski
2025-10-08 23:28   ` Jacob Keller
2025-10-07 23:26 ` [PATCH net v2 2/9] eth: fbnic: fix accounting of XDP packets Jakub Kicinski
2025-10-08 23:29   ` Jacob Keller
2025-10-07 23:26 ` [PATCH net v2 3/9] eth: fbnic: fix saving stats from XDP_TX rings on close Jakub Kicinski
2025-10-08 23:30   ` Jacob Keller
2025-10-07 23:26 ` [PATCH net v2 4/9] selftests: drv-net: xdp: rename netnl to ethnl Jakub Kicinski
2025-10-08 23:31   ` Jacob Keller
2025-10-07 23:26 ` [PATCH net v2 5/9] selftests: drv-net: xdp: add test for interface level qstats Jakub Kicinski
2025-10-08 23:32   ` Jacob Keller
2025-10-07 23:26 ` [PATCH net v2 6/9] eth: fbnic: fix reporting of alloc_failed qstats Jakub Kicinski
2025-10-08 23:33   ` Jacob Keller
2025-10-07 23:26 ` [PATCH net v2 7/9] selftests: drv-net: fix linter warnings in pp_alloc_fail Jakub Kicinski
2025-10-08 23:34   ` Jacob Keller
2025-10-07 23:26 ` [PATCH net v2 8/9] selftests: drv-net: pp_alloc_fail: lower traffic expectations Jakub Kicinski
2025-10-08 23:35   ` Jacob Keller
2025-10-07 23:26 ` [PATCH net v2 9/9] selftests: drv-net: pp_alloc_fail: add necessary optoins to config Jakub Kicinski
2025-10-08 23:35   ` Jacob Keller
2025-10-09  9:20 ` [PATCH net v2 0/9] eth: fbnic: fix XDP_TX and XDP vs qstats patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).