Skip to content

Commit e548465

Browse files
cpaaschdavem330
authored andcommitted
selftests/mptcp: Better delay & reordering configuration
The delay was intended to be configured to "simulate" a high(er) BDP link. As such, it needs to be set as part of the loss-configuration and not as part of the netem reordering configuration. The reordering-config also requires a delay but that delay is the reordering-extend. So, a good approach is to set the reordering-extend as a function of the configured latency. E.g., 25% of the overall latency. To speed up the selftests, we limit the delay to 50ms maximum to avoid having the selftests run for too long. Finally, the intention of tc_reorder was that when it is unset, the test picks a random configuration. However, currently it is always initialized and thus the random config won't be picked up. Closes: multipath-tcp/mptcp_net-next#6 Reported-and-reviewed-by: Matthieu Baerts <[email protected]> Signed-off-by: Christoph Paasch <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d095c46 commit e548465

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tools/testing/selftests/net/mptcp/mptcp_connect.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ capture=false
1414
timeout=30
1515
ipv6=true
1616
ethtool_random_on=true
17-
tc_delay="$((RANDOM%400))"
17+
tc_delay="$((RANDOM%50))"
1818
tc_loss=$((RANDOM%101))
19-
tc_reorder=""
2019
testmode=""
2120
sndbuf=0
2221
rcvbuf=0
@@ -628,30 +627,32 @@ for sender in "$ns1" "$ns2" "$ns3" "$ns4";do
628627
do_ping "$ns4" $sender dead:beef:3::1
629628
done
630629
631-
[ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss
630+
[ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss delay ${tc_delay}ms
632631
echo -n "INFO: Using loss of $tc_loss "
633632
test "$tc_delay" -gt 0 && echo -n "delay $tc_delay ms "
634633
634+
reorder_delay=$(($tc_delay / 4))
635+
635636
if [ -z "${tc_reorder}" ]; then
636637
reorder1=$((RANDOM%10))
637638
reorder1=$((100 - reorder1))
638639
reorder2=$((RANDOM%100))
639640
640-
if [ $tc_delay -gt 0 ] && [ $reorder1 -lt 100 ] && [ $reorder2 -gt 0 ]; then
641+
if [ $reorder_delay -gt 0 ] && [ $reorder1 -lt 100 ] && [ $reorder2 -gt 0 ]; then
641642
tc_reorder="reorder ${reorder1}% ${reorder2}%"
642-
echo -n "$tc_reorder "
643+
echo -n "$tc_reorder with delay ${reorder_delay}ms "
643644
fi
644645
elif [ "$tc_reorder" = "0" ];then
645646
tc_reorder=""
646-
elif [ "$tc_delay" -gt 0 ];then
647+
elif [ "$reorder_delay" -gt 0 ];then
647648
# reordering requires some delay
648649
tc_reorder="reorder $tc_reorder"
649-
echo -n "$tc_reorder "
650+
echo -n "$tc_reorder with delay ${reorder_delay}ms "
650651
fi
651652
652653
echo "on ns3eth4"
653654
654-
tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${tc_delay}ms $tc_reorder
655+
tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${reorder_delay}ms $tc_reorder
655656
656657
for sender in $ns1 $ns2 $ns3 $ns4;do
657658
run_tests_lo "$ns1" "$sender" 10.0.1.1 1

0 commit comments

Comments
 (0)