public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 net 00/11] xsk: tailroom reservation and MTU validation
@ 2026-03-26 11:49 Maciej Fijalkowski
  2026-03-26 11:49 ` [PATCH v4 net 01/11] xsk: tighten UMEM headroom validation to account for tailroom and min frame Maciej Fijalkowski
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Maciej Fijalkowski @ 2026-03-26 11:49 UTC (permalink / raw)
  To: netdev
  Cc: bpf, magnus.karlsson, stfomichev, kuba, pabeni, horms,
	larysa.zaremba, aleksander.lobakin, bjorn, Maciej Fijalkowski

v3->v4:
- allow exact 128 bytes of space when user defined headroom is deducted
  from total frame size
- provide a routine for reading procfs entries within xskxceiver
  * use it to fetch cache line size and calculate skb_shared_info size
    on our own
- clean up gve and igc xsk pool enablement routines
- include mtu vs frame size * max zc segments validation in
  xp_assign_dev()

v2->v3:
- add tags from Bjorn/Stan
- provide at least 128 bytes instead ETH_ZLEN when validating frame
  headroom
  * this way we can get rid of i40e/ice changes
  * make sure xsk_pool_get_rx_frame_size() returns value 128b-aligned
  * and remove pre-check from idpf
- separate XDP_UMEM_SG_FLAG fixes from MTU validation in xsk_bind()
- make drop_idx a local variable in xsk's xdp drop prog
- adjust rx_dropped to new 128b related values
- move ugly placed define (Bjorn)
- remove READ_ONCE when fetching netdev->mtu (Bjorn)

v1->v2:
- remove xsk_pool_get_tailroom() definition for !CONFIG_XDP_SOCKETS
  (Stan)
- do not rely on pool->umem->zc when configuring tailroom (Stan, Bjorn)
- simplify dbuff setting in ZC drivers (Bjorn)
- use defines for {head,tail}room in tests (Bjorn)
- return EINVAL instead of EOPNOTSUPP when mtu setting is wrong (Bjorn)
- include vlan headers and fcs length when validating mtu (Olek)
- tighten umem headroom validation when registering umem (Sashiko AI)
- set XDP_USE_SG in xp_assign_dev_shared() (Sashiko AI)
- adjust rx dropped xskxceiver test

Hi,

here we fix a long-standing issue regarding multi-buffer scenario in ZC
mode - we have not been providing space at the end of the buffer where
multi-buffer XDP works on skb_shared_info. This has been brought to our
attention via [0].

Unaligned mode does not get any specific treatment, it is user's
responsibility to properly handle XSK addresses in queues.

With adjustments included here in this set against xskxceiver I have
been able to pass the full test suite on ice.

Thanks,
Maciej

[0]: https://community.intel.com/t5/Ethernet-Products/X710-XDP-Packet-Corruption-Issue-DRV-MODE-Zero-Copy-Multi-Buffer/m-p/1724208


Maciej Fijalkowski (11):
  xsk: tighten UMEM headroom validation to account for tailroom and min
    frame
  xsk: respect tailroom for ZC setups
  xsk: fix XDP_UMEM_SG_FLAG issues
  xsk: validate MTU against usable frame size on bind
  selftests: bpf: introduce a common routine for reading procfs
  selftests: bpf: fix pkt grow tests
  selftests: bpf: have a separate variable for drop test
  selftests: bpf: adjust rx_dropped xskxceiver's test to respect
    tailroom
  idpf: remove xsk frame size check against alignment
  igc: remove home-grown xsk's frame size validation
  gve: remove home-grown xsk's frame size validation

 drivers/net/ethernet/google/gve/gve_main.c    |  5 --
 drivers/net/ethernet/intel/idpf/xsk.c         | 10 ----
 drivers/net/ethernet/intel/igc/igc_xdp.c      | 11 ----
 include/net/xdp_sock.h                        |  2 +-
 include/net/xdp_sock_drv.h                    | 17 +++++-
 net/xdp/xdp_umem.c                            |  3 +-
 net/xdp/xsk_buff_pool.c                       | 11 +++-
 .../selftests/bpf/prog_tests/test_xsk.c       | 55 +++++++++----------
 .../selftests/bpf/prog_tests/test_xsk.h       |  2 +
 .../selftests/bpf/progs/xsk_xdp_progs.c       |  4 +-
 tools/testing/selftests/bpf/xskxceiver.c      | 44 +++++++++++++++
 11 files changed, 104 insertions(+), 60 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-03-26 11:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 11:49 [PATCH v4 net 00/11] xsk: tailroom reservation and MTU validation Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 01/11] xsk: tighten UMEM headroom validation to account for tailroom and min frame Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 02/11] xsk: respect tailroom for ZC setups Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 03/11] xsk: fix XDP_UMEM_SG_FLAG issues Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 04/11] xsk: validate MTU against usable frame size on bind Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 05/11] selftests: bpf: introduce a common routine for reading procfs Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 06/11] selftests: bpf: fix pkt grow tests Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 07/11] selftests: bpf: have a separate variable for drop test Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 08/11] selftests: bpf: adjust rx_dropped xskxceiver's test to respect tailroom Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 09/11] idpf: remove xsk frame size check against alignment Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 10/11] igc: remove home-grown xsk's frame size validation Maciej Fijalkowski
2026-03-26 11:49 ` [PATCH v4 net 11/11] gve: " Maciej Fijalkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox