Skip to content

Commit

Permalink
selftests/net: add csum offload test
Browse files Browse the repository at this point in the history
Test NIC hardware checksum offload:

- Rx + Tx
- IPv4 + IPv6
- TCP + UDP

Optional features:

- zero checksum 0xFFFF
- checksum disable 0x0000
- transport encap headers
- randomization

See file header for detailed comments.

Expected results differ depending on NIC features:

- CHECKSUM_UNNECESSARY vs CHECKSUM_COMPLETE
- NETIF_F_HW_CSUM (csum_start/csum_off) vs NETIF_F_IP(V6)_CSUM

Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20221128140210.553391-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Willem de Bruijn authored and Jakub Kicinski committed Nov 30, 2022
1 parent 5cb0c51 commit 91a7de8
Show file tree
Hide file tree
Showing 3 changed files with 988 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/net/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
bind_bhash
csum
cmsg_sender
fin_ack_lat
gro
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ TEST_PROGS += test_ingress_egress_chaining.sh
TEST_GEN_PROGS += so_incoming_cpu
TEST_PROGS += sctp_vrf.sh
TEST_GEN_FILES += sctp_hello
TEST_GEN_FILES += csum

TEST_FILES := settings

Expand Down
Loading

0 comments on commit 91a7de8

Please sign in to comment.