linux/net/xdp
Stanislav Fomichev a6e4b9a6de xsk: honor XDP_TX_METADATA in zero-copy path
The zero-copy path reads TX metadata whenever the UMEM has metadata space,
even if the descriptor does not set XDP_TX_METADATA. Pass descriptor
options through the metadata helpers and ignore metadata unless the option
is set.

This does not fix the existing per-WQE metadata handling for mlx5 MPWQEs.
Only the descriptor that starts a session passes through
xsk_tx_metadata_request() and configures offload state shared by the batch.
Metadata on descriptors joining an open session is therefore not validated
and does not configure its requested offloads. In addition, a non-NULL
metadata pointer from such a descriptor is treated as a timestamp
completion request even when XDP_TXMD_FLAGS_TIMESTAMP is not set, so its
metadata union can be overwritten with an unrequested timestamp. Fixing
mixed metadata states within one MPWQE requires a separate change.

Fixes: 48eb03dd26 ("xsk: Add TX timestamp and TX checksum offload support")
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Link: https://patch.msgid.link/20260819160535.1472459-3-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-24 11:12:00 -07:00
..
Kconfig
Makefile xsk: Introduce AF_XDP buffer allocation API 2020-05-21 17:31:26 -07:00
xdp_umem.c xsk: require at least 16 bytes of TX metadata 2026-08-03 16:43:53 -07:00
xdp_umem.h xsk: Fix umem cleanup bug at socket destruct 2020-11-20 15:52:39 +01:00
xsk_buff_pool.c xsk: honor XDP_TX_METADATA in zero-copy path 2026-08-24 11:12:00 -07:00
xsk_diag.c net: change sock.sk_ino and sock_i_ino() to u64 2026-03-06 14:31:26 +01:00
xsk_queue.c xsk: account ring allocations to memcg 2026-08-05 19:32:39 -07:00
xsk_queue.h xsk: reclaim invalid Tx descriptors in ZC batch path 2026-07-24 15:12:14 -07:00
xsk.c xsk: fix NULL pointer dereference in __xsk_rcv() 2026-08-20 11:31:35 -07:00
xsk.h xsk: remove repeated defines 2026-03-16 19:28:21 -07:00
xskmap.c xskmap: reject TX-only AF_XDP sockets 2026-05-09 16:17:01 -07:00