]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: net: Fix checksums in xdp_native
authorNimrod Oren <noren@nvidia.com>
Wed, 20 May 2026 15:39:28 +0000 (18:39 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 May 2026 14:47:00 +0000 (07:47 -0700)
commitdfc077043351a81887d1e4c9ac244e9243f3cbf2
tree3060d8d01abe0766c0ed81c988a01bab7124191b
parent1341db322417266fb5845df81d28305b83a37324
selftests: net: Fix checksums in xdp_native

Data adjustment cases failed with "Data exchange failed" when using IPv4
because the program did not update the IP and UDP checksums in the IPv4
branch. The issue was masked when both IPv4 and IPv6 were configured,
since the test harness prefers IPv6.

While here, generalize csum_fold_helper() to fold twice so it works for
any 32-bit input.

Fixes: 0b65cfcef9c5 ("selftests: drv-net: Test tail-adjustment support")
Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Nimrod Oren <noren@nvidia.com>
Link: https://patch.msgid.link/20260520153928.3371765-1-noren@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/lib/xdp_native.bpf.c