~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/net/udpgso.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #!/bin/sh
  2 # SPDX-License-Identifier: GPL-2.0
  3 #
  4 # Run a series of udpgso regression tests
  5 
  6 set -o errexit
  7 set -o nounset
  8 
  9 setup_loopback() {
 10         ip addr add dev lo 10.0.0.1/32
 11         ip addr add dev lo fd00::1/128 nodad noprefixroute
 12 }
 13 
 14 test_dev_mtu() {
 15         setup_loopback
 16         # Reduce loopback MTU
 17         ip link set dev lo mtu 1500
 18 }
 19 
 20 test_route_mtu() {
 21         setup_loopback
 22         # Remove default local routes
 23         ip route del local 10.0.0.1/32 table local dev lo
 24         ip route del local fd00::1/128 table local dev lo
 25         # Install local routes with reduced MTU
 26         ip route add local 10.0.0.1/32 table local dev lo mtu 1500
 27         ip route add local fd00::1/128 table local dev lo mtu 1500
 28 }
 29 
 30 setup_dummy_sink() {
 31         ip link add name sink mtu 1500 type dummy
 32         ip addr add dev sink 10.0.0.0/24
 33         ip addr add dev sink fd00::2/64 nodad
 34         ip link set dev sink up
 35 }
 36 
 37 test_hw_gso_hw_csum() {
 38         setup_dummy_sink
 39         ethtool -K sink tx-checksum-ip-generic on >/dev/null
 40         ethtool -K sink tx-udp-segmentation on >/dev/null
 41 }
 42 
 43 test_sw_gso_hw_csum() {
 44         setup_dummy_sink
 45         ethtool -K sink tx-checksum-ip-generic on >/dev/null
 46         ethtool -K sink tx-udp-segmentation off >/dev/null
 47 }
 48 
 49 test_sw_gso_sw_csum() {
 50         setup_dummy_sink
 51         ethtool -K sink tx-checksum-ip-generic off >/dev/null
 52         ethtool -K sink tx-udp-segmentation off >/dev/null
 53 }
 54 
 55 if [ "$#" -gt 0 ]; then
 56         "$1"
 57         shift 2 # pop "test_*" arg and "--" delimiter
 58         exec "$@"
 59 fi
 60 
 61 echo "ipv4 cmsg"
 62 ./in_netns.sh "$0" test_dev_mtu -- ./udpgso -4 -C
 63 
 64 echo "ipv4 setsockopt"
 65 ./in_netns.sh "$0" test_dev_mtu -- ./udpgso -4 -C -s
 66 
 67 echo "ipv6 cmsg"
 68 ./in_netns.sh "$0" test_dev_mtu -- ./udpgso -6 -C
 69 
 70 echo "ipv6 setsockopt"
 71 ./in_netns.sh "$0" test_dev_mtu -- ./udpgso -6 -C -s
 72 
 73 echo "ipv4 connected"
 74 ./in_netns.sh "$0" test_route_mtu -- ./udpgso -4 -c
 75 
 76 echo "ipv6 connected"
 77 ./in_netns.sh "$0" test_route_mtu -- ./udpgso -6 -c
 78 
 79 echo "ipv4 msg_more"
 80 ./in_netns.sh "$0" test_dev_mtu -- ./udpgso -4 -C -m
 81 
 82 echo "ipv6 msg_more"
 83 ./in_netns.sh "$0" test_dev_mtu -- ./udpgso -6 -C -m
 84 
 85 echo "ipv4 hw-gso hw-csum"
 86 ./in_netns.sh "$0" test_hw_gso_hw_csum -- ./udpgso -4 -C -R
 87 
 88 echo "ipv6 hw-gso hw-csum"
 89 ./in_netns.sh "$0" test_hw_gso_hw_csum -- ./udpgso -6 -C -R
 90 
 91 echo "ipv4 sw-gso hw-csum"
 92 ./in_netns.sh "$0" test_sw_gso_hw_csum -- ./udpgso -4 -C -R
 93 
 94 echo "ipv6 sw-gso hw-csum"
 95 ./in_netns.sh "$0" test_sw_gso_hw_csum -- ./udpgso -6 -C -R
 96 
 97 echo "ipv4 sw-gso sw-csum"
 98 ./in_netns.sh "$0" test_sw_gso_sw_csum -- ./udpgso -4 -C -R
 99 
100 echo "ipv6 sw-gso sw-csum"
101 ./in_netns.sh "$0" test_sw_gso_sw_csum -- ./udpgso -6 -C -R

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php