Skip to content

RFC xsk: TX metadata

Stanislav Fomichev bpf netdev oe-kbuild oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 RFC Latest8 patches 22 repliesIn review

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8xsk: Support XDP_TX_METADATA_LENinclude/net/xdp_sock.h include/net/xsk_buff_pool.h include/uapi/linux/if_xdp.h +3 more+34 -70 replies
2/8xsk: add TX timestamp and TX checksum offload supportDocumentation/netlink/specs/netdev.yaml include/linux/netdevice.h include/linux/skbuff.h +8 more+268 -819 replies
3/8net/mlx5e: Implement AF_XDP TX timestamp and checksum offloaddrivers/net/ethernet/mellanox/mlx5/core/en.h drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h +2 more+79 -160 replies
4/8tools: ynl: update netdev sample to dump xsk-featuresDocumentation/netlink/specs/netdev.yaml tools/include/uapi/linux/netdev.h tools/net/ynl/generated/netdev-user.c +2 more+57 -20 replies
5/8selftests/xsk: Support XDP_TX_METADATA_LENtools/testing/selftests/bpf/xsk.c tools/testing/selftests/bpf/xsk.h+18 -00 replies
6/8selftests/bpf: Add csum helperstools/testing/selftests/bpf/network_helpers.h+43 -00 replies
7/8selftests/bpf: Add TX side to xdp_metadatatools/testing/selftests/bpf/prog_tests/xdp_metadata.c+28 -30 replies
8/8selftests/bpf: Add TX side to xdp_hw_metadatatools/testing/selftests/bpf/xdp_hw_metadata.c+191 -103 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [RFC net-next v4 0/8] xsk: TX metadata

This series implements initial TX metadata (offloads) for AF_XDP. See patch #2 for the main implementation and mlx5-one for the example on how to consume the metadata on the device side.

With v4, I'm switching from BPF hooks and kfuncs to a fixed TX metadata/offload format: the metadata is passed with every tx umem chunk and it's up to the device driver to interpret it.

Starting with two types of offloads:
- request TX timestamp (and write it back into the metadata area)
- request TX checksum offload

TODO for the non-RFC series:
- have some real device support to verify xdp_hw_metadata works
- Documentation/networking/xdp-rx-metadata.rst - like documentation

v3: https://lore.kernel.org/bpf/[email protected]/

Stanislav Fomichev (8):
xsk: Support XDP_TX_METADATA_LEN
xsk: add TX timestamp and TX checksum offload support net/mlx5e: Implement AF_XDP TX timestamp and checksum offload
tools: ynl: update netdev sample to dump xsk-features selftests/xsk: Support XDP_TX_METADATA_LEN selftests/bpf: Add csum helpers
selftests/bpf: Add TX side to xdp_metadata selftests/bpf: Add TX side to xdp_hw_metadata

 Documentation/netlink/specs/netdev.yaml       |  25 ++-
 drivers/net/ethernet/mellanox/mlx5/core/en.h  |   4 +-
 .../net/ethernet/mellanox/mlx5/core/en/xdp.c  |  71 ++++++-
 .../net/ethernet/mellanox/mlx5/core/en/xdp.h  |  10 +-
 .../ethernet/mellanox/mlx5/core/en/xsk/tx.c   |   9 +-
 .../net/ethernet/mellanox/mlx5/core/en_main.c |   1 +
 include/linux/netdevice.h                     |  27 +++
 include/linux/skbuff.h                        |   5 +-
 include/net/xdp_sock.h                        |  61 ++++++
 include/net/xdp_sock_drv.h                    |  13 ++
 include/net/xsk_buff_pool.h                   |   1 +
 include/uapi/linux/if_xdp.h                   |  36 ++++
 include/uapi/linux/netdev.h                   |  15 ++
 net/core/netdev-genl.c                        |  12 +-
 net/xdp/xsk.c                                 |  58 +++++
 net/xdp/xsk_buff_pool.c                       |   1 +
 net/xdp/xsk_queue.h                           |  19 +-
 tools/include/uapi/linux/if_xdp.h             |  50 ++++-
 tools/include/uapi/linux/netdev.h             |  15 ++
 tools/net/ynl/generated/netdev-user.c         |  25 +++
 tools/net/ynl/generated/netdev-user.h         |   5 +
 tools/net/ynl/samples/netdev.c                |   8 +
 tools/testing/selftests/bpf/network_helpers.h |  43 ++++
 .../selftests/bpf/prog_tests/xdp_metadata.c   |  31 ++-
 tools/testing/selftests/bpf/xdp_hw_metadata.c | 201 +++++++++++++++++-
 tools/testing/selftests/bpf/xsk.c             |  17 ++
 tools/testing/selftests/bpf/xsk.h             |   1 +
 27 files changed, 718 insertions(+), 46 deletions(-)
Signature · 1 line
2.41.0.487.g6d72f3e995-goog