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

2 # SPDX-License-Identifier: GPL-2.0
30 if [ $tc_loss -eq 100 ];then
32 elif [ $tc_loss -ge 10 ]; then
34 elif [ $tc_loss -ge 1 ]; then
41 echo "Usage: $0 [ -a ]"
42 echo -e "\t-d: tc/netem delay in milliseconds, e.g. \"-d 10\" (default random)"
43 echo -e "\t-l: tc/netem loss percentage, e.g. \"-l 0.02\" (default random)"
44 …echo -e "\t-r: tc/netem reorder mode, e.g. \"-r 25% 50% gap 5\", use "-r 0" to disable reordering …
45 …echo -e "\t-e: ethtool features to disable, e.g.: \"-e tso -e gso\" (default: randomly disable any…
46 echo -e "\t-4: IPv4 only: disable IPv6 tests (default: test both IPv4 and IPv6)"
47 echo -e "\t-c: capture packets for each test using tcpdump (default: no capture)"
48 echo -e "\t-f: size of file to transfer in bytes (default random)"
49 echo -e "\t-S: set sndbuf value (default: use kernel default)"
50 echo -e "\t-R: set rcvbuf value (default: use kernel default)"
51 echo -e "\t-m: test mode (poll, sendfile; default: poll)"
52 echo -e "\t-t: also run tests with TCP (use twice to non-fallback tcp)"
53 echo -e "\t-C: enable the MPTCP data checksum"
63 if [ $OPTARG -ge 0 ];then
66 echo "-d requires numeric argument, got \"$OPTARG\"" 1>&2
87 if [ $OPTARG -ge 0 ];then
90 echo "-S requires numeric argument, got \"$OPTARG\"" 1>&2
95 if [ $OPTARG -ge 0 ];then
98 echo "-R requires numeric argument, got \"$OPTARG\"" 1>&2
122 rndh=$(printf %x $sec)-$(mktemp -u XXXXXX)
123 ns1="ns1-$rndh"
124 ns2="ns2-$rndh"
125 ns3="ns3-$rndh"
126 ns4="ns4-$rndh"
132 rm -f "$cin_disconnect" "$cout_disconnect"
133 rm -f "$cin" "$cout"
134 rm -f "$sin" "$sout"
135 rm -f "$capout"
140 rm -f /tmp/$netns.{nstat,out}
144 ip -Version > /dev/null 2>&1
145 if [ $? -ne 0 ];then
161 ip -net $i link set lo up
166 # - drop 1% -> reorder 25%
167 # <- TSO off -
173 ip -net "$ns1" addr add 10.0.1.1/24 dev ns1eth2
174 ip -net "$ns1" addr add dead:beef:1::1/64 dev ns1eth2 nodad
176 ip -net "$ns1" link set ns1eth2 up
177 ip -net "$ns1" route add default via 10.0.1.2
178 ip -net "$ns1" route add default via dead:beef:1::2
180 ip -net "$ns2" addr add 10.0.1.2/24 dev ns2eth1
181 ip -net "$ns2" addr add dead:beef:1::2/64 dev ns2eth1 nodad
182 ip -net "$ns2" link set ns2eth1 up
184 ip -net "$ns2" addr add 10.0.2.1/24 dev ns2eth3
185 ip -net "$ns2" addr add dead:beef:2::1/64 dev ns2eth3 nodad
186 ip -net "$ns2" link set ns2eth3 up
187 ip -net "$ns2" route add default via 10.0.2.2
188 ip -net "$ns2" route add default via dead:beef:2::2
189 ip netns exec "$ns2" sysctl -q net.ipv4.ip_forward=1
190 ip netns exec "$ns2" sysctl -q net.ipv6.conf.all.forwarding=1
192 ip -net "$ns3" addr add 10.0.2.2/24 dev ns3eth2
193 ip -net "$ns3" addr add dead:beef:2::2/64 dev ns3eth2 nodad
194 ip -net "$ns3" link set ns3eth2 up
196 ip -net "$ns3" addr add 10.0.3.2/24 dev ns3eth4
197 ip -net "$ns3" addr add dead:beef:3::2/64 dev ns3eth4 nodad
198 ip -net "$ns3" link set ns3eth4 up
199 ip -net "$ns3" route add default via 10.0.2.1
200 ip -net "$ns3" route add default via dead:beef:2::1
201 ip netns exec "$ns3" sysctl -q net.ipv4.ip_forward=1
202 ip netns exec "$ns3" sysctl -q net.ipv6.conf.all.forwarding=1
204 ip -net "$ns4" addr add 10.0.3.1/24 dev ns4eth3
205 ip -net "$ns4" addr add dead:beef:3::1/64 dev ns4eth3 nodad
206 ip -net "$ns4" link set ns4eth3 up
207 ip -net "$ns4" route add default via 10.0.3.2
208 ip -net "$ns4" route add default via dead:beef:3::2
212 ip netns exec $i sysctl -q net.mptcp.checksum_enabled=1
221 ip netns exec $ns ethtool -K $dev $flags 2>/dev/null
222 [ $? -eq 0 ] && echo "INFO: set $ns dev $dev: ethtool -K $flags"
233 [ $pick1 -ne 0 ] && flags="tso off"
234 [ $pick2 -ne 0 ] && flags="$flags gso off"
235 [ $pick3 -ne 0 ] && flags="$flags gro off"
237 [ -z "$flags" ] && return
252 ls -l "$1" 1>&2
254 tail -c 27 "$1"
264 if [ $? -ne 0 ] ;then
278 disabled_ns="ns_disabled-$sech-$(mktemp -u XXXXXX)"
282 if [ "$(ip netns exec ${disabled_ns} sysctl net.mptcp.enabled | awk '{ print $3 }')" -ne 1 ]; then
283 echo -e "net.mptcp.enabled sysctl is not 1 by default\t\t[ FAIL ]"
287 ip netns exec ${disabled_ns} sysctl -q net.mptcp.enabled=0
290 LC_ALL=C ip netns exec ${disabled_ns} ./mptcp_connect -p 10000 -s MPTCP 127.0.0.1 < "$cin" 2>&1 | \
291 grep -q "^socket: Protocol not available$" && err=1
294 if [ ${err} -eq 0 ]; then
295 echo -e "New MPTCP socket cannot be blocked via sysctl\t\t[ FAIL ]"
300 echo -e "New MPTCP socket can be blocked via sysctl\t\t[ OK ]"
307 [ -z "${1##*:*}" ]
315 local ping_args="-q -c 1"
319 ping_args="${ping_args} -6"
323 if [ $? -ne 0 ] ; then
324 echo "$listener_ns -> $connect_addr connectivity [ FAIL ]" 1>&2
341 nstat -z -a "${mib}" | \
342 tail -n+2 | \
379 if [ "$rcvbuf" -gt 0 ]; then
380 extra_args="$extra_args -R $rcvbuf"
383 if [ "$sndbuf" -gt 0 ]; then
384 extra_args="$extra_args -S $sndbuf"
387 if [ -n "$testmode" ]; then
388 extra_args="$extra_args -m $testmode"
391 if [ -n "$extra_args" ] && $options_log; then
402 …printf "%.3s %-5s -> %.3s (%-20s) %-5s\t" ${connector_ns} ${cl_proto} ${listener_ns} ${addr_port} …
406 if [ -z $SUDO_USER ] ; then
409 capuser="-Z $SUDO_USER"
412 …local capfile="${rndh}-${connector_ns:0:3}-${listener_ns:0:3}-${cl_proto}-${srv_proto}-${connect_a…
413 local capopt="-i any -s 65535 -B 32768 ${capuser}"
415 …ip netns exec ${listener_ns} tcpdump ${capopt} -w "${capfile}-listener.pcap" >> "${capout}" 2>&1…
418 …ip netns exec ${connector_ns} tcpdump ${capopt} -w "${capfile}-connector.pcap" >> "${capout}" 2>&1…
425 nstat -n
428 nstat -n
440 ./mptcp_connect -t ${timeout_poll} -l -p $port -s ${srv_proto} \
450 ./mptcp_connect -t ${timeout_poll} -p $port -s ${cl_proto} \
476 duration=$((stop-start))
478 if [ ${rets} -ne 0 ] || [ ${retc} -ne 0 ]; then
480 echo -e "\nnetns ${listener_ns} socket stat for ${port}:" 1>&2
481 ip netns exec ${listener_ns} ss -Menita 1>&2 -o "sport = :$port"
483 echo -e "\nnetns ${connector_ns} socket stat for ${port}:" 1>&2
484 ip netns exec ${connector_ns} ss -Menita 1>&2 -o "dport = :$port"
514 if [ ${stat_synrx_now_l} -lt ${expect_synrx} ]; then
515 printf "[ FAIL ] lower MPC SYN rx (%d) than expected (%d)\n" \
519 if [ ${stat_ackrx_now_l} -lt ${expect_ackrx} -a ${stat_ooo_now} -eq 0 ]; then
520 if [ ${stat_ooo_now} -eq 0 ]; then
521 printf "[ FAIL ] lower MPC ACK rx (%d) than expected (%d)\n" \
533 local csum_err_s_nr=$((csum_err_s - stat_csum_err_s))
534 if [ $csum_err_s_nr -gt 0 ]; then
539 local csum_err_c_nr=$((csum_err_c - stat_csum_err_c))
540 if [ $csum_err_c_nr -gt 0 ]; then
546 if [ $retc -eq 0 ] && [ $rets -eq 0 ]; then
550 if [ $cookies -eq 2 ];then
551 if [ $stat_cookietx_last -ge $stat_cookietx_now ] ;then
554 if [ $stat_cookierx_last -ge $stat_cookierx_now ] ;then
558 if [ $stat_cookietx_last -ne $stat_cookietx_now ] ;then
561 if [ $stat_cookierx_last -ne $stat_cookierx_now ] ;then
566 if [ ${stat_synrx_now_l} -gt ${expect_synrx} ]; then
570 if [ ${stat_ackrx_now_l} -gt ${expect_ackrx} ]; then
577 [ $retc -eq 0 ] && [ $rets -eq 0 ]
588 if [ $SIZE -eq 0 ]; then
596 rem=$((SIZE - (ksize * 1024)))
600 echo -e "\nMPTCP_TEST_FILE_END_MARKER" >> "$name"
602 echo "Created $name (size $(du -b "$name")) containing data sent by $who"
615 if [ $loopback -eq 0 ] && [ ${listener_ns} = ${connector_ns} ]; then
634 if [ $lret -ne 0 ]; then
639 if [ $do_tcp -eq 0 ]; then
649 if [ $lret -ne 0 ]; then
657 if [ $lret -ne 0 ]; then
662 if [ $do_tcp -gt 1 ] ;then
666 if [ $lret -ne 0 ]; then
695 ip netns exec "$listener_ns" nft -f /dev/stdin <<"EOF"
699 type filter hook prerouting priority -150;
706 if [ $? -ne 0 ]; then
714 r6flag="-6"
719 ip -net "$listener_ns" $r6flag rule add fwmark 1 lookup 100
720 if [ $? -ne 0 ]; then
726 ip -net "$listener_ns" route add local $local_addr/0 dev lo table 100
727 if [ $? -ne 0 ]; then
729 ip -net "$listener_ns" $r6flag rule del fwmark 1 lookup 100
737 local extra_args="-o TRANSPARENT"
743 ip -net "$listener_ns" $r6flag rule del fwmark 1 lookup 100
744 ip -net "$listener_ns" route del local $local_addr/0 dev lo table 100
746 if [ $lret -ne 0 ]; then
761 run_tests_lo "$ns1" "$ns1" 10.0.1.1 1 "-P ${peekmode}"
762 run_tests_lo "$ns1" "$ns1" dead:beef:1::1 1 "-P ${peekmode}"
781 run_tests_lo "$ns1" "$ns1" 10.0.1.1 1 "-I 3 -i $old_cin"
782 run_tests_lo "$ns1" "$ns1" dead:beef:1::1 1 "-I 3 -i $old_cin"
795 time_run=$((time_end-time_start))
804 if [ ${ret} -ne 0 ]; then
839 [ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss delay ${t…
840 echo -n "INFO: Using loss of $tc_loss "
841 test "$tc_delay" -gt 0 && echo -n "delay $tc_delay ms "
845 if [ -z "${tc_reorder}" ]; then
847 reorder1=$((100 - reorder1))
850 if [ $reorder_delay -gt 0 ] && [ $reorder1 -lt 100 ] && [ $reorder2 -gt 0 ]; then
852 echo -n "$tc_reorder with delay ${reorder_delay}ms "
856 elif [ "$reorder_delay" -gt 0 ];then
859 echo -n "$tc_reorder with delay ${reorder_delay}ms "
864 tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${reorder_delay}ms $tc_reorder
873 # ns1<->ns2 is not subject to reordering/tc delays. Use it to test
876 ip netns exec "$ns2" sysctl -q net.ipv4.tcp_syncookies=2
878 ip netns exec "$ns2" sysctl -q net.ipv4.tcp_syncookies=1