Commit e5484658 authored by Christoph Paasch's avatar Christoph Paasch Committed by David S. Miller

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: https://github.com/multipath-tcp/mptcp_net-next/issues/6Reported-and-reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarChristoph Paasch <cpaasch@apple.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d095c462
...@@ -14,9 +14,8 @@ capture=false ...@@ -14,9 +14,8 @@ capture=false
timeout=30 timeout=30
ipv6=true ipv6=true
ethtool_random_on=true ethtool_random_on=true
tc_delay="$((RANDOM%400))" tc_delay="$((RANDOM%50))"
tc_loss=$((RANDOM%101)) tc_loss=$((RANDOM%101))
tc_reorder=""
testmode="" testmode=""
sndbuf=0 sndbuf=0
rcvbuf=0 rcvbuf=0
...@@ -628,30 +627,32 @@ for sender in "$ns1" "$ns2" "$ns3" "$ns4";do ...@@ -628,30 +627,32 @@ for sender in "$ns1" "$ns2" "$ns3" "$ns4";do
do_ping "$ns4" $sender dead:beef:3::1 do_ping "$ns4" $sender dead:beef:3::1
done done
[ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss [ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss random $tc_loss delay ${tc_delay}ms
echo -n "INFO: Using loss of $tc_loss " echo -n "INFO: Using loss of $tc_loss "
test "$tc_delay" -gt 0 && echo -n "delay $tc_delay ms " test "$tc_delay" -gt 0 && echo -n "delay $tc_delay ms "
reorder_delay=$(($tc_delay / 4))
if [ -z "${tc_reorder}" ]; then if [ -z "${tc_reorder}" ]; then
reorder1=$((RANDOM%10)) reorder1=$((RANDOM%10))
reorder1=$((100 - reorder1)) reorder1=$((100 - reorder1))
reorder2=$((RANDOM%100)) reorder2=$((RANDOM%100))
if [ $tc_delay -gt 0 ] && [ $reorder1 -lt 100 ] && [ $reorder2 -gt 0 ]; then if [ $reorder_delay -gt 0 ] && [ $reorder1 -lt 100 ] && [ $reorder2 -gt 0 ]; then
tc_reorder="reorder ${reorder1}% ${reorder2}%" tc_reorder="reorder ${reorder1}% ${reorder2}%"
echo -n "$tc_reorder " echo -n "$tc_reorder with delay ${reorder_delay}ms "
fi fi
elif [ "$tc_reorder" = "0" ];then elif [ "$tc_reorder" = "0" ];then
tc_reorder="" tc_reorder=""
elif [ "$tc_delay" -gt 0 ];then elif [ "$reorder_delay" -gt 0 ];then
# reordering requires some delay # reordering requires some delay
tc_reorder="reorder $tc_reorder" tc_reorder="reorder $tc_reorder"
echo -n "$tc_reorder " echo -n "$tc_reorder with delay ${reorder_delay}ms "
fi fi
echo "on ns3eth4" echo "on ns3eth4"
tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${tc_delay}ms $tc_reorder tc -net "$ns3" qdisc add dev ns3eth4 root netem delay ${reorder_delay}ms $tc_reorder
for sender in $ns1 $ns2 $ns3 $ns4;do for sender in $ns1 $ns2 $ns3 $ns4;do
run_tests_lo "$ns1" "$sender" 10.0.1.1 1 run_tests_lo "$ns1" "$sender" 10.0.1.1 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment