2 # SPDX-License-Identifier: GPL-2.0
4 # Run a series of packet socket send regression tests
15 readonly mss
="$((${mtu} - ${iphlen} - ${udphlen}))"
16 readonly mss_exceeds
="$((${mss} + 1))"
18 readonly max_mtu
=65535
19 readonly max_mss
="$((${max_mtu} - ${iphlen} - ${udphlen}))"
20 readonly max_mss_exceeds
="$((${max_mss} + 1))"
22 # functional checks (not a full cross-product)
25 .
/in_netns.sh .
/psock_snd
-d
28 .
/in_netns.sh .
/psock_snd
-d -b
31 .
/in_netns.sh .
/psock_snd
34 .
/in_netns.sh .
/psock_snd
-b
36 echo "raw qdisc bypass"
37 .
/in_netns.sh .
/psock_snd
-q
40 .
/in_netns.sh .
/psock_snd
-V
43 .
/in_netns.sh .
/psock_snd
-v
46 .
/in_netns.sh .
/psock_snd
-v -c
48 echo "raw csum_off with bad offset (fails)"
49 (! .
/in_netns.sh .
/psock_snd
-v -c -C)
52 # bounds check: send {max, max + 1, min, min - 1} lengths
55 .
/in_netns.sh .
/psock_snd
-l 0
58 .
/in_netns.sh .
/psock_snd
-l "${mss}"
60 echo "raw mtu size + 1 (fails)"
61 (! .
/in_netns.sh .
/psock_snd
-l "${mss_exceeds}")
63 # fails due to ARPHRD_ETHER check in packet_extra_vlan_len_allowed
65 # echo "raw vlan mtu size"
66 # ./in_netns.sh ./psock_snd -V -l "${mss}"
68 echo "raw vlan mtu size + 1 (fails)"
69 (! .
/in_netns.sh .
/psock_snd
-V -l "${mss_exceeds}")
72 .
/in_netns.sh .
/psock_snd
-d -l "${mss}"
74 echo "dgram mtu size + 1 (fails)"
75 (! .
/in_netns.sh .
/psock_snd
-d -l "${mss_exceeds}")
77 echo "raw truncate hlen (fails: does not arrive)"
78 (! .
/in_netns.sh .
/psock_snd
-t "$((${vnet_hlen} + ${eth_hlen}))")
80 echo "raw truncate hlen - 1 (fails: EINVAL)"
81 (! .
/in_netns.sh .
/psock_snd
-t "$((${vnet_hlen} + ${eth_hlen} - 1))")
84 # gso checks: implies -l, because with gso len must exceed gso_size
86 echo "raw gso min size"
87 .
/in_netns.sh .
/psock_snd
-v -c -g -l "${mss_exceeds}"
89 echo "raw gso min size - 1 (fails)"
90 (! .
/in_netns.sh .
/psock_snd
-v -c -g -l "${mss}")
92 echo "raw gso max size"
93 .
/in_netns.sh .
/psock_snd
-v -c -g -l "${max_mss}"
95 echo "raw gso max size + 1 (fails)"
96 (! .
/in_netns.sh .
/psock_snd
-v -c -g -l "${max_mss_exceeds}")
98 echo "OK. All tests passed"