Lines Matching +full:rx +full:- +full:eq

2 # SPDX-License-Identifier: GPL-2.0
28 if [ $tc_loss -eq 100 ];then
30 elif [ $tc_loss -ge 10 ]; then
32 elif [ $tc_loss -ge 1 ]; then
39 echo "Usage: $0 [ -a ]"
40 echo -e "\t-d: tc/netem delay in milliseconds, e.g. \"-d 10\" (default random)"
41 echo -e "\t-l: tc/netem loss percentage, e.g. \"-l 0.02\" (default random)"
42 …echo -e "\t-r: tc/netem reorder mode, e.g. \"-r 25% 50% gap 5\", use "-r 0" to disable reordering …
43 …echo -e "\t-e: ethtool features to disable, e.g.: \"-e tso -e gso\" (default: randomly disable any…
44 echo -e "\t-4: IPv4 only: disable IPv6 tests (default: test both IPv4 and IPv6)"
45 echo -e "\t-c: capture packets for each test using tcpdump (default: no capture)"
46 echo -e "\t-f: size of file to transfer in bytes (default random)"
47 echo -e "\t-S: set sndbuf value (default: use kernel default)"
48 echo -e "\t-R: set rcvbuf value (default: use kernel default)"
49 echo -e "\t-m: test mode (poll, sendfile; default: poll)"
50 echo -e "\t-t: also run tests with TCP (use twice to non-fallback tcp)"
51 echo -e "\t-C: enable the MPTCP data checksum"
61 if [ $OPTARG -ge 0 ];then
64 echo "-d requires numeric argument, got \"$OPTARG\"" 1>&2
85 if [ $OPTARG -ge 0 ];then
88 echo "-S requires numeric argument, got \"$OPTARG\"" 1>&2
93 if [ $OPTARG -ge 0 ];then
96 echo "-R requires numeric argument, got \"$OPTARG\"" 1>&2
120 rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)
121 ns1="ns1-$rndh"
122 ns2="ns2-$rndh"
123 ns3="ns3-$rndh"
124 ns4="ns4-$rndh"
130 rm -f "$cin" "$cout"
131 rm -f "$sin" "$sout"
132 rm -f "$capout"
137 rm -f /tmp/$netns.{nstat,out}
141 ip -Version > /dev/null 2>&1
142 if [ $? -ne 0 ];then
156 ip -net $i link set lo up
161 # - drop 1% -> reorder 25%
162 # <- TSO off -
168 ip -net "$ns1" addr add 10.0.1.1/24 dev ns1eth2
169 ip -net "$ns1" addr add dead:beef:1::1/64 dev ns1eth2 nodad
171 ip -net "$ns1" link set ns1eth2 up
172 ip -net "$ns1" route add default via 10.0.1.2
173 ip -net "$ns1" route add default via dead:beef:1::2
175 ip -net "$ns2" addr add 10.0.1.2/24 dev ns2eth1
176 ip -net "$ns2" addr add dead:beef:1::2/64 dev ns2eth1 nodad
177 ip -net "$ns2" link set ns2eth1 up
179 ip -net "$ns2" addr add 10.0.2.1/24 dev ns2eth3
180 ip -net "$ns2" addr add dead:beef:2::1/64 dev ns2eth3 nodad
181 ip -net "$ns2" link set ns2eth3 up
182 ip -net "$ns2" route add default via 10.0.2.2
183 ip -net "$ns2" route add default via dead:beef:2::2
184 ip netns exec "$ns2" sysctl -q net.ipv4.ip_forward=1
185 ip netns exec "$ns2" sysctl -q net.ipv6.conf.all.forwarding=1
187 ip -net "$ns3" addr add 10.0.2.2/24 dev ns3eth2
188 ip -net "$ns3" addr add dead:beef:2::2/64 dev ns3eth2 nodad
189 ip -net "$ns3" link set ns3eth2 up
191 ip -net "$ns3" addr add 10.0.3.2/24 dev ns3eth4
192 ip -net "$ns3" addr add dead:beef:3::2/64 dev ns3eth4 nodad
193 ip -net "$ns3" link set ns3eth4 up
194 ip -net "$ns3" route add default via 10.0.2.1
195 ip -net "$ns3" route add default via dead:beef:2::1
196 ip netns exec "$ns3" sysctl -q net.ipv4.ip_forward=1
197 ip netns exec "$ns3" sysctl -q net.ipv6.conf.all.forwarding=1
199 ip -net "$ns4" addr add 10.0.3.1/24 dev ns4eth3
200 ip -net "$ns4" addr add dead:beef:3::1/64 dev ns4eth3 nodad
201 ip -net "$ns4" link set ns4eth3 up
202 ip -net "$ns4" route add default via 10.0.3.2
203 ip -net "$ns4" route add default via dead:beef:3::2
207 ip netns exec $i sysctl -q net.mptcp.checksum_enabled=1
216 ip netns exec $ns ethtool -K $dev $flags 2>/dev/null
217 [ $? -eq 0 ] && echo "INFO: set $ns dev $dev: ethtool -K $flags"
228 [ $pick1 -ne 0 ] && flags="tso off"
229 [ $pick2 -ne 0 ] && flags="$flags gso off"
230 [ $pick3 -ne 0 ] && flags="$flags gro off"
232 [ -z "$flags" ] && return
247 ls -l "$1" 1>&2
249 tail -c 27 "$1"
259 if [ $? -ne 0 ] ;then
273 disabled_ns="ns_disabled-$sech-$(mktemp -u XXXXXX)"
277 if [ "$(ip netns exec ${disabled_ns} sysctl net.mptcp.enabled | awk '{ print $3 }')" -ne 1 ]; then
278 echo -e "net.mptcp.enabled sysctl is not 1 by default\t\t[ FAIL ]"
282 ip netns exec ${disabled_ns} sysctl -q net.mptcp.enabled=0
285 LC_ALL=C ip netns exec ${disabled_ns} ./mptcp_connect -p 10000 -s MPTCP 127.0.0.1 < "$cin" 2>&1 | \
286 grep -q "^socket: Protocol not available$" && err=1
289 if [ ${err} -eq 0 ]; then
290 echo -e "New MPTCP socket cannot be blocked via sysctl\t\t[ FAIL ]"
295 echo -e "New MPTCP socket can be blocked via sysctl\t\t[ OK ]"
302 t="ns_ulp-$sech-$(mktemp -u XXXXXX)"
305 if ! ip netns exec ${t} ./mptcp_connect -u -p 10000 -s TCP 127.0.0.1 2>&1; then
320 [ -z "${1##*:*}" ]
328 local ping_args="-q -c 1"
332 ping_args="${ping_args} -6"
336 if [ $? -ne 0 ] ; then
337 echo "$listener_ns -> $connect_addr connectivity [ FAIL ]" 1>&2
354 nstat -z -a "${mib}" | \
355 tail -n+2 | \
392 if [ "$rcvbuf" -gt 0 ]; then
393 extra_args="$extra_args -R $rcvbuf"
396 if [ "$sndbuf" -gt 0 ]; then
397 extra_args="$extra_args -S $sndbuf"
400 if [ -n "$testmode" ]; then
401 extra_args="$extra_args -m $testmode"
404 if [ -n "$extra_args" ] && $options_log; then
415 …printf "%.3s %-5s -> %.3s (%-20s) %-5s\t" ${connector_ns} ${cl_proto} ${listener_ns} ${addr_port} …
419 if [ -z $SUDO_USER ] ; then
422 capuser="-Z $SUDO_USER"
425 …local capfile="${rndh}-${connector_ns:0:3}-${listener_ns:0:3}-${cl_proto}-${srv_proto}-${connect_a…
426 local capopt="-i any -s 65535 -B 32768 ${capuser}"
428 …ip netns exec ${listener_ns} tcpdump ${capopt} -w "${capfile}-listener.pcap" >> "${capout}" 2>&1…
431 …ip netns exec ${connector_ns} tcpdump ${capopt} -w "${capfile}-connector.pcap" >> "${capout}" 2>&1…
438 nstat -n
441 nstat -n
451 ./mptcp_connect -t ${timeout_poll} -l -p $port -s ${srv_proto} \
461 ./mptcp_connect -t ${timeout_poll} -p $port -s ${cl_proto} \
487 duration=$((stop-start))
489 if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then
491 echo -e "\nnetns ${listener_ns} socket stat for ${port}:" 1>&2
492 ip netns exec ${listener_ns} ss -Menita 1>&2 -o "sport = :$port"
494 echo -e "\nnetns ${connector_ns} socket stat for ${port}:" 1>&2
495 ip netns exec ${connector_ns} ss -Menita 1>&2 -o "dport = :$port"
525 if [ ${stat_synrx_now_l} -lt ${expect_synrx} ]; then
526 printf "[ FAIL ] lower MPC SYN rx (%d) than expected (%d)\n" \
530 if [ ${stat_ackrx_now_l} -lt ${expect_ackrx} -a ${stat_ooo_now} -eq 0 ]; then
531 if [ ${stat_ooo_now} -eq 0 ]; then
532 printf "[ FAIL ] lower MPC ACK rx (%d) than expected (%d)\n" \
540 if [ $retc -eq 0 ] && [ $rets -eq 0 ]; then
544 if [ $cookies -eq 2 ];then
545 if [ $stat_cookietx_last -ge $stat_cookietx_now ] ;then
548 if [ $stat_cookierx_last -ge $stat_cookierx_now ] ;then
552 if [ $stat_cookietx_last -ne $stat_cookietx_now ] ;then
555 if [ $stat_cookierx_last -ne $stat_cookierx_now ] ;then
560 if [ ${stat_synrx_now_l} -gt ${expect_synrx} ]; then
564 if [ ${stat_ackrx_now_l} -gt ${expect_ackrx} ]; then
571 [ $retc -eq 0 ] && [ $rets -eq 0 ]
582 if [ $SIZE -eq 0 ]; then
590 rem=$((SIZE - (ksize * 1024)))
594 echo -e "\nMPTCP_TEST_FILE_END_MARKER" >> "$name"
596 echo "Created $name (size $(du -b "$name")) containing data sent by $who"
609 if [ $loopback -eq 0 ] && [ ${listener_ns} = ${connector_ns} ]; then
628 if [ $lret -ne 0 ]; then
633 if [ $do_tcp -eq 0 ]; then
643 if [ $lret -ne 0 ]; then
651 if [ $lret -ne 0 ]; then
656 if [ $do_tcp -gt 1 ] ;then
660 if [ $lret -ne 0 ]; then
679 run_tests_lo "$ns1" "$ns1" 10.0.1.1 1 "-P ${peekmode}"
680 run_tests_lo "$ns1" "$ns1" dead:beef:1::1 1 "-P ${peekmode}"
686 time_run=$((time_end-time_start))
695 if [ ${ret} -ne 0 ]; then
732 [ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss delay ${t…
733 echo -n "INFO: Using loss of $tc_loss "
734 test "$tc_delay" -gt 0 && echo -n "delay $tc_delay ms "
738 if [ -z "${tc_reorder}" ]; then
740 reorder1=$((100 - reorder1))
743 if [ $reorder_delay -gt 0 ] && [ $reorder1 -lt 100 ] && [ $reorder2 -gt 0 ]; then
745 echo -n "$tc_reorder with delay ${reorder_delay}ms "
749 elif [ "$reorder_delay" -gt 0 ];then
752 echo -n "$tc_reorder with delay ${reorder_delay}ms "
757 tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${reorder_delay}ms $tc_reorder
766 # ns1<->ns2 is not subject to reordering/tc delays. Use it to test
769 ip netns exec "$ns2" sysctl -q net.ipv4.tcp_syncookies=2
771 ip netns exec "$ns2" sysctl -q net.ipv4.tcp_syncookies=1