[PATCH v3 net 0/8] xsk: tailroom reservation and MTU validation
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Date: 2026-03-23 19:25:09
Also in:
bpf
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