Skip to content

Commit

Permalink
selftests: mptcp: tune timeout and delay for simult_flows cases
Browse files Browse the repository at this point in the history
We currently have some instabilities in the simult_flows tests-case.
The problem boils down to the unneeded large wait introduced by the
tests to allow for the MPJ handshake to complete, which can also
introduce a quite relevant variance.

Do wait on a single side of the connection, remove the delay at
shutdown time and tune the expected test time with the above.

Closes: multipath-tcp/mptcp_net-next#137
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Paolo Abeni authored and intel-lab-lkp committed Sep 6, 2021
1 parent 78828ad commit 36a818c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion tools/testing/selftests/net/mptcp/mptcp_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,6 @@ static void parse_opts(int argc, char **argv)
case 'j':
cfg_join = true;
cfg_mode = CFG_MODE_POLL;
cfg_wait = 400000;
break;
case 'r':
cfg_remove = true;
Expand Down
21 changes: 15 additions & 6 deletions tools/testing/selftests/net/mptcp/simult_flows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ setup()
sout=$(mktemp)
cout=$(mktemp)
capout=$(mktemp)
size=$((2048 * 4096))
size=$((2048 * 4096 * 4))
dd if=/dev/zero of=$small bs=4096 count=20 >/dev/null 2>&1
dd if=/dev/zero of=$large bs=4096 count=$((size / 4096)) >/dev/null 2>&1

Expand Down Expand Up @@ -128,7 +128,11 @@ do_transfer()
local cin=$1
local sin=$2
local max_time=$3
local reverse=$4
local port
local srv_args="-j"
local cl_args=""

port=$((10000+$test_cnt))
test_cnt=$((test_cnt+1))

Expand Down Expand Up @@ -159,9 +163,14 @@ do_transfer()
sleep 1
fi

if [ "$reverse" = true ]; then
srv_args=""
cl_args="-j"
fi

timeout ${timeout_test} \
ip netns exec ${ns3} \
./mptcp_connect -jt ${timeout_poll} -l -p $port \
./mptcp_connect $srv_args -t ${timeout_poll} -l -p $port \
0.0.0.0 < "$sin" > "$sout" &
local spid=$!

Expand All @@ -171,7 +180,7 @@ do_transfer()
start=$(date +%s%3N)
timeout ${timeout_test} \
ip netns exec ${ns1} \
./mptcp_connect -jt ${timeout_poll} -p $port \
./mptcp_connect $cl_args -t ${timeout_poll} -p $port \
10.0.3.3 < "$cin" > "$cout" &
local cpid=$!

Expand Down Expand Up @@ -244,12 +253,12 @@ run_test()
tc -n $ns2 qdisc add dev ns2eth1 root netem rate ${rate1}mbit $delay1
tc -n $ns2 qdisc add dev ns2eth2 root netem rate ${rate2}mbit $delay2

# time is measure in ms
local time=$((size * 8 * 1000 / (( $rate1 + $rate2) * 1024 *1024) ))
# time is measure in ms, account for headers overhead, with DSS+ACK64 presence
local time=$((size * 8 * 1000 * 1514 / (( $rate1 + $rate2) * 1024 * 1024 * 1424) ))

# mptcp_connect will do some sleeps to allow the mp_join handshake
# completion
time=$((time + 1350))
time=$((time + 350))

printf "%-50s" "$msg"
do_transfer $small $large $((time * 11 / 10))
Expand Down

0 comments on commit 36a818c

Please sign in to comment.