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

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 (8):
  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: 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

 drivers/net/ethernet/intel/idpf/xsk.c         | 10 -------
 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                       | 18 ++++++++++--
 .../selftests/bpf/prog_tests/test_xsk.c       | 29 +++++++++++++++----
 .../selftests/bpf/progs/xsk_xdp_progs.c       |  4 ++-
 7 files changed, 62 insertions(+), 21 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-03-27  3:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23 19:24 [PATCH v3 net 0/8] xsk: tailroom reservation and MTU validation Maciej Fijalkowski
2026-03-23 19:24 ` [PATCH v3 net 1/8] xsk: tighten UMEM headroom validation to account for tailroom and min frame Maciej Fijalkowski
2026-03-23 19:24 ` [PATCH v3 net 2/8] xsk: respect tailroom for ZC setups Maciej Fijalkowski
2026-03-23 19:24 ` [PATCH v3 net 3/8] xsk: fix XDP_UMEM_SG_FLAG issues Maciej Fijalkowski
2026-03-23 19:24 ` [PATCH v3 net 4/8] xsk: validate MTU against usable frame size on bind Maciej Fijalkowski
2026-03-23 19:24 ` [PATCH v3 net 5/8] selftests: bpf: fix pkt grow tests Maciej Fijalkowski
2026-03-23 19:24 ` [PATCH v3 net 6/8] selftests: bpf: have a separate variable for drop test Maciej Fijalkowski
2026-03-23 19:24 ` [PATCH v3 net 7/8] selftests: bpf: adjust rx_dropped xskxceiver's test to respect tailroom Maciej Fijalkowski
2026-03-23 19:24 ` [PATCH v3 net 8/8] idpf: remove xsk frame size check against alignment Maciej Fijalkowski
2026-03-27  3:27 ` [PATCH v3 net 0/8] xsk: tailroom reservation and MTU validation Jakub Kicinski

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