Skip to content

xsk: fix multi-buffer TX software checksum

Rongzheng Wang bpf lkml netdev stable 5 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 0 repliesApplied 2/2
  2. v42 patches 11 repliesSuperseded
  3. v32 patches 6 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches7 repliesSuperseded
v11 patch2 repliesSuperseded

Changes in v5 from the cover letter

- remove the unnecessary else branch after the multi-buffer check
- carry all review tags received on v3 and v4

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2xsk: defer software checksum until the skb is completenet/xdp/xsk.c+15 -80 repliesApplied
2/2selftests/bpf: cover AF_XDP multi-buffer TX software checksumtools/testing/selftests/bpf/prog_tests/xdp_metadata.c+92 -550 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMaciej FijalkowskiStanislav FomichevJason Xing
1/2R-b A-b R-b
2/2R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH net v5 0/2] xsk: fix multi-buffer TX software checksum

This is v5 of the AF_XDP multi-buffer TX software checksum fix.

I found this while testing multi-buffer TX with XDP_UMEM_TX_SW_CSUM: a two-descriptor packet had a bad wire checksum, while a single descriptor was correct. There was no production or syzbot report.

Patch 1 moves the software checksum calculation from xsk_skb_metadata() to the point where the last descriptor has been added to the skb. The old code calculated the checksum after the first descriptor, so multi-buffer packets only included the first fragment in the checksum.

Patch 2 sends the packet using every descriptor count from 1 through MAX_SKB_FRAGS + 1, and runs the existing metadata and checksum verification for each case. The last case is the copy-mode frame limit documented in af_xdp.rst.

The updated selftest passes in a local QEMU run.

v5:
- remove the unnecessary else branch after the multi-buffer check
- carry all review tags received on v3 and v4

v4: https://lore.kernel.org/all/[email protected]/
v3: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

Rongzheng Wang (2):
xsk: defer software checksum until the skb is complete selftests/bpf: cover AF_XDP multi-buffer TX software checksum

 net/xdp/xsk.c                                 |  23 ++-
 .../selftests/bpf/prog_tests/xdp_metadata.c   | 147 +++++++++++-------
 2 files changed, 107 insertions(+), 63 deletions(-)
Signature · 1 line
2.39.5 (Apple Git-154)