network/tcp_cc: add new tests bbr01 and bbr02
cover network/tcp_cc: add new tests bbr01 and bbr02
The patches are adding two new tests for BBR congestion control algorithm.
* bbr01 test is a simple one and similar to dctcp01 but not using ECN when emulating packet loss.
* bbr02 test, in addition to packet loss emulation with ECN, is using delay, reorder and corrupt features of 'tc'. And also iterates the different queueing disciplines.
The last test, I guess, should use TST_TEST_DATA for passing queueing disciplines.
Alexey Kodanev (6):
network: rename dcctp dir to tcp_cc
dctcp01: convert to new API and move common code to a library network/tcp_cc/dctcp01: increase packet loss for dctcp network/tcp_cc/lib: add a function to set qdisc and txqueuelen network/tcp_cc: add new test bbr01
network/tcp_cc: add new test bbr02
runtest/net.features | 5 ++ testcases/network/dctcp/Makefile | 22 -------- testcases/network/dctcp/dctcp01.sh | 91 -------------------------------- testcases/network/tcp_cc/Makefile | 22 ++++++++ testcases/network/tcp_cc/bbr01.sh | 32 +++++++++++ testcases/network/tcp_cc/bbr02.sh | 45 ++++++++++++++++ testcases/network/tcp_cc/dctcp01.sh | 38 +++++++++++++ testcases/network/tcp_cc/tcp_cc_lib.sh | 91 ++++++++++++++++++++++++++++++++ 8 files changed, 233 insertions(+), 113 deletions(-) delete mode 100644 testcases/network/dctcp/Makefile delete mode 100755 testcases/network/dctcp/dctcp01.sh create mode 100644 testcases/network/tcp_cc/Makefile create mode 100755 testcases/network/tcp_cc/bbr01.sh create mode 100755 testcases/network/tcp_cc/bbr02.sh create mode 100755 testcases/network/tcp_cc/dctcp01.sh create mode 100755 testcases/network/tcp_cc/tcp_cc_lib.sh
PATCH 1/6 network: rename dcctp dir to tcp_cc
This directory will include other TCP congestion control related tests, not only dctcp algorithm.
--- testcases/network/dctcp/Makefile | 22 -------- testcases/network/dctcp/dctcp01.sh | 91 ----------------------------------- testcases/network/tcp_cc/Makefile | 22 ++++++++ testcases/network/tcp_cc/dctcp01.sh | 91 +++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+), 113 deletions(-) delete mode 100644 testcases/network/dctcp/Makefile delete mode 100755 testcases/network/dctcp/dctcp01.sh create mode 100644 testcases/network/tcp_cc/Makefile create mode 100755 testcases/network/tcp_cc/dctcp01.sh
testcases/network/dctcp/Makefile deleted +0 -22
@@ -1,22 +0,0 @@ -# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -top_srcdir ?= ../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := dctcp01.sh - -include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/network/dctcp/dctcp01.sh deleted +0 -91
91 lines not on this page · raw message
testcases/network/tcp_cc/Makefile new file +22 -0
@@ -0,0 +1,22 @@ +# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := dctcp01.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/network/tcp_cc/dctcp01.sh new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 1/6 network: rename dcctp dir to tcp_cc
Quoted 4 lines
This directory will include other TCP congestion control related tests, not only dctcp algorithm.
Signed-off-by Alexey Kodanev <[email protected]>
PATCH 1/6 network: rename dcctp dir to tcp_cc
In reply to Alexey KodanevHi Alexey,
Quoted 4 lines
This directory will include other TCP congestion control related tests, not only dctcp algorithm.
Signed-off-by Alexey Kodanev <[email protected]>
Kind regards,
Petr
PATCH 2/6 dctcp01: convert to new API and move common code to a library
In reply to Alexey Kodanev--- testcases/network/tcp_cc/Makefile | 2 +- testcases/network/tcp_cc/dctcp01.sh | 80 +++++-------------------------- testcases/network/tcp_cc/tcp_cc_lib.sh | 57 ++++++++++++++++++++++ 3 files changed, 71 insertions(+), 68 deletions(-) create mode 100755 testcases/network/tcp_cc/tcp_cc_lib.sh
testcases/network/tcp_cc/Makefile +1 -1
@@ -17,6 +17,6 @@ top_srcdir ?= ../../.. include $(top_srcdir)/include/mk/env_pre.mk -INSTALL_TARGETS := dctcp01.sh +INSTALL_TARGETS := *.sh include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/network/tcp_cc/dctcp01.sh +13 -67
104 lines not on this page · raw message
testcases/network/tcp_cc/tcp_cc_lib.sh new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 2/6 dctcp01: convert to new API and move common code to a library
Hi Alexey,
Quoted 1 line
Signed-off-by Alexey Kodanev <[email protected]>
Kind regards,
Petr
PATCH 3/6 network/tcp_cc/dctcp01: increase packet loss for dctcp
In reply to Alexey KodanevAvoid false positive failures for this test-case.
--- testcases/network/tcp_cc/dctcp01.sh | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
testcases/network/tcp_cc/dctcp01.sh +4 -3
@@ -13,7 +13,7 @@ TST_MIN_KVER="3.18" cleanup() { - tc qdisc del dev $(tst_iface) root netem loss 0.03% ecn + tc qdisc del dev $(tst_iface) root netem loss 0.5% ecn tcp_cc_cleanup }
@@ -22,8 +22,9 @@ setup() { tcp_cc_setup - tst_res TINFO "emulate congestion with packet loss 0.03% and ECN" - tc qdisc add dev $(tst_iface) root netem loss 0.03% ecn > /dev/null 2>&1 + tst_res TINFO "emulate congestion with packet loss 0.5% and ECN" + tc qdisc add dev $(tst_iface) root netem loss 0.5% ecn > /dev/null 2>&1 + if [ $? -ne 0 ]; then tst_brkm TCONF "netem doesn't support ECN" fi
Signature · 1 line
1.7.1
PATCH 3/6 network/tcp_cc/dctcp01: increase packet loss for dctcp
Hi Alexey,
Quoted 3 lines
Avoid false positive failures for this test-case.
Signed-off-by Alexey Kodanev <[email protected]>
Kind regards,
Petr
PATCH 4/6 network/tcp_cc/lib: add a function to set qdisc and txqueuelen
In reply to Alexey Kodanev--- testcases/network/tcp_cc/tcp_cc_lib.sh | 34 ++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-)
testcases/network/tcp_cc/tcp_cc_lib.sh +34 -0
@@ -9,6 +9,8 @@ TST_NEEDS_CMDS="sysctl tc" . tst_net.sh def_alg="cubic" +prev_qlen= +prev_queue= prev_alg= set_cong_alg()
@@ -21,8 +23,16 @@ set_cong_alg() tcp_cc_cleanup() { + local rmt_dev="dev $(tst_iface rhost)" + [ "$prev_cong_ctl" ] && \ tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg + + [ "$prev_qlen" ] && \ + tst_rhost_run -c "ip li set txqueuelen $prev_qlen $rmt_dev" + + [ "$prev_queue" ] && \ + tst_rhost_run -c "tc qdisc replace $rmt_dev root $prev_queue" } tcp_cc_setup()
@@ -30,6 +40,30 @@ tcp_cc_setup() prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)" } +qdisc_list="pfifo_fast codel pfifo fq hfsc hhf htb pie prio sfb sfq" + +tcp_cc_set_qdisc() +{ + local qdisc="$1" + local qlen="${2:-1000}" + local cmd="tc qdisc replace" + local rmt_dev="$(tst_iface rhost)" + + tst_res TINFO "set qdisc on $(tst_iface rhost) to $qdisc len $qlen" + + [ -z "$prev_qlen" ] && \ + prev_qlen=$(tst_rhost_run -s -c \ + "cat /sys/class/net/$rmt_dev/tx_queue_len") + + [ -z "$prev_queue" ] && \ + prev_queue=$(tst_rhost_run -s -c \ + "tc qdisc show dev $rmt_dev | head -1" | \ + cut -f2 -d' ') + + tst_rhost_run -s -c "ip li set txqueuelen $qlen dev $rmt_dev" + tst_rhost_run -s -c "$cmd dev $rmt_dev root $qdisc" +} + tcp_cc_test01() { local alg=$1
Signature · 1 line
1.7.1
PATCH 4/6 network/tcp_cc/lib: add a function to set qdisc and txqueuelen
Quoted 1 line
Signed-off-by Alexey Kodanev <[email protected]>
Kind regards,
Petr
PATCH 4/6 network/tcp_cc/lib: add a function to set qdisc and txqueuelen
In reply to Alexey KodanevHi Alexey,
Quoted 36 lines
Signed-off-by Alexey Kodanev <[email protected]>--- testcases/network/tcp_cc/tcp_cc_lib.sh | 34 ++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-)testcases/network/tcp_cc/tcp_cc_lib.sh +10
-0@@ -9,6 +9,8 @@ TST_NEEDS_CMDS="sysctl tc" . tst_net.sh def_alg="cubic" +prev_qlen= +prev_queue= prev_alg= set_cong_alg()@@ -21,8 +23,16 @@ set_cong_alg() tcp_cc_cleanup() { + local rmt_dev="dev $(tst_iface rhost)" + [ "$prev_cong_ctl" ] && \ tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg + + [ "$prev_qlen" ] && \ + tst_rhost_run -c "ip li set txqueuelen $prev_qlen $rmt_dev" + + [ "$prev_queue" ] && \ + tst_rhost_run -c "tc qdisc replace $rmt_dev root $prev_queue" } tcp_cc_setup()
testcases/network/tcp_cc/tcp_cc_lib.sh tcp_cc_setup() · line 43
Quoted 4 lines
testcases/network/tcp_cc/tcp_cc_lib.sh +1
-0@@ -30,6 +40,30 @@ tcp_cc_setup() prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)" } +qdisc_list="pfifo_fast codel pfifo fq hfsc hhf htb pie prio sfb sfq"
Maybe just one thing: wouldn't be better to have this upper case as it's library variable shared in tests? But it's only a minor nit.
Kind regards,
Petr
PATCH 4/6 network/tcp_cc/lib: add a function to set qdisc and txqueuelen
In reply to Alexey KodanevHi Alexey,
Quoted 36 lines
Signed-off-by Alexey Kodanev <[email protected]>--- testcases/network/tcp_cc/tcp_cc_lib.sh | 34 ++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-)testcases/network/tcp_cc/tcp_cc_lib.sh +10
-0@@ -9,6 +9,8 @@ TST_NEEDS_CMDS="sysctl tc" . tst_net.sh def_alg="cubic" +prev_qlen= +prev_queue= prev_alg= set_cong_alg()@@ -21,8 +23,16 @@ set_cong_alg() tcp_cc_cleanup() { + local rmt_dev="dev $(tst_iface rhost)" + [ "$prev_cong_ctl" ] && \ tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg + + [ "$prev_qlen" ] && \ + tst_rhost_run -c "ip li set txqueuelen $prev_qlen $rmt_dev" + + [ "$prev_queue" ] && \ + tst_rhost_run -c "tc qdisc replace $rmt_dev root $prev_queue" } tcp_cc_setup()
testcases/network/tcp_cc/tcp_cc_lib.sh tcp_cc_setup() · line 43
Quoted 4 lines
testcases/network/tcp_cc/tcp_cc_lib.sh +1
-0@@ -30,6 +40,30 @@ tcp_cc_setup() prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)" } +qdisc_list="pfifo_fast codel pfifo fq hfsc hhf htb pie prio sfb sfq"
Maybe just one thing: wouldn't be better to have this upper case as it's library variable shared in tests? But it's only a minor nit.
Kind regards,
Petr
PATCH 4/6 network/tcp_cc/lib: add a function to set qdisc and txqueuelen
Hi Alexey,
Quoted 1 line
Quoted 1 line
Signed-off-by Alexey Kodanev <[email protected]>
Forget to add
Quoted 1 line
Quoted 1 line
---
...
Quoted 4 lines
Quoted 1 line
+qdisc_list="pfifo_fast codel pfifo fq hfsc hhf htb pie prio sfb sfq"
Maybe just one thing: wouldn't be better to have this upper case as it's library variable shared in tests? But it's only a minor nit.
Kind regards,
Petr
PATCH 5/6 network/tcp_cc: add new test bbr01
In reply to Alexey KodanevEmulates congestion with packet loss. The test expects that 'bbr' congestion-control algorithm not significantly worse than 'cubic'.
--- runtest/net.features | 2 ++ testcases/network/tcp_cc/bbr01.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 0 deletions(-) create mode 100755 testcases/network/tcp_cc/bbr01.sh
runtest/net.features +2 -0
@@ -1,6 +1,8 @@ # # Stress tests for various network features # +bbr01 bbr01.sh +bbr01_ipv6 bbr01.sh -6 bind_noport01 bind_noport01.sh bind_noport01_ipv6 bind_noport01.sh -6
testcases/network/tcp_cc/bbr01.sh new file +32 -0
@@ -0,0 +1,32 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved. + +TST_SETUP="setup" +TST_TESTFUNC="do_test" +TST_CLEANUP="cleanup" +TST_MIN_KVER="4.13" + +. tcp_cc_lib.sh + +cleanup() +{ + tc qdisc del dev $(tst_iface) root netem + + tcp_cc_cleanup +} + +setup() +{ + tcp_cc_setup + + tst_res TINFO "emulate congestion with packet loss 0.5%" + ROD tc qdisc add dev $(tst_iface) root netem loss 0.5% +} + +do_test() +{ + tcp_cc_test01 bbr -50 +} + +tst_run
Signature · 1 line
1.7.1
PATCH 5/6 network/tcp_cc: add new test bbr01
Hi Alexey,
Quoted 5 lines
Emulates congestion with packet loss. The test expects that 'bbr' congestion-control algorithm not significantly worse than 'cubic'.
Signed-off-by Alexey Kodanev <[email protected]>
Kind regards,
Petr
PATCH 5/6 network/tcp_cc: add new test bbr01
In reply to Alexey KodanevHi Alexey,
Quoted 5 lines
Emulates congestion with packet loss. The test expects that 'bbr' congestion-control algorithm not significantly worse than 'cubic'.
Signed-off-by Alexey Kodanev <[email protected]>
Kind regards,
Petr
PATCH 6/6 network/tcp_cc: add new test bbr02
In reply to Alexey KodanevDifference, comparing to bbr01:
* Uses different (not default) qdisc: pfifo_fast, codel, pfifo, fq, hfsc, hhf, htb, pie, prio, sfb and sfq.
* Emulates congestion not only with packet loss but with delay, corrupt and reorder.
The test expects that 'bbr' congestion-control algorithm not significantly worse than 'cubic'.
--- runtest/net.features | 3 ++ testcases/network/tcp_cc/bbr02.sh | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 0 deletions(-) create mode 100755 testcases/network/tcp_cc/bbr02.sh
runtest/net.features +3 -0
@@ -4,6 +4,9 @@ bbr01 bbr01.sh bbr01_ipv6 bbr01.sh -6 +bbr02 bbr02.sh +bbr02_ipv6 bbr02.sh -6 + bind_noport01 bind_noport01.sh bind_noport01_ipv6 bind_noport01.sh -6
testcases/network/tcp_cc/bbr02.sh new file +45 -0
45 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 6/6 network/tcp_cc: add new test bbr02
Hi Alexey,
Quoted 11 lines
Difference, comparing to bbr01:
* Uses different (not default) qdisc:
pfifo_fast, codel, pfifo, fq, hfsc, hhf, htb, pie, prio, sfb and sfq.
* Emulates congestion not only with packet loss but with delay, corrupt and reorder.The test expects that 'bbr' congestion-control algorithm not significantly worse than 'cubic'.
Signed-off-by Alexey Kodanev <[email protected]>
testcases/network/tcp_cc/bbr02.sh line 38
Quoted 9 lines
---
testcases/network/tcp_cc/bbr02.sh new file +7
-0+do_test() +{ + for q in $qdisc_list; do + if tc qdisc add $q >/dev/null 2>&1; then + tst_res TCONF "$q qdisc not supported" + continue + fi
Yes, this one would of using TST_TEST_DATA.
Kind regards,
Petr
PATCH 6/6 network/tcp_cc: add new test bbr02
Quoted 14 lines · Petr Vorel
Hi Alexey,
Quoted 11 lines
Difference, comparing to bbr01:
* Uses different (not default) qdisc:
pfifo_fast, codel, pfifo, fq, hfsc, hhf, htb, pie, prio, sfb and sfq.
* Emulates congestion not only with packet loss but with delay, corrupt and reorder.The test expects that 'bbr' congestion-control algorithm not significantly worse than 'cubic'.
Signed-off-by Alexey Kodanev <[email protected]>Acked-by Petr Vorel <[email protected]>
...
Quoted 9 lines
testcases/network/tcp_cc/bbr02.sh line 38
Quoted 7 lines
testcases/network/tcp_cc/bbr02.sh new file +7
-0+do_test() +{ + for q in $qdisc_list; do + if tc qdisc add $q >/dev/null 2>&1; then + tst_res TCONF "$q qdisc not supported" + continue + fiYes, this one would of using
TST_TEST_DATA.
Thanks for the review Petr!
The patch-set applied and now using new TST_TEST_DATA.
Also I've added one more patch that checks support in kernel.
PATCH 6/6 network/tcp_cc: add new test bbr02
Hi Alexey,
Quoted 3 lines
Thanks for the review Petr!
The patch-set applied and now using new
TST_TEST_DATA.
Great. I cleanup it in patchwork.
Quoted 1 line
Also I've added one more patch that checks support in kernel.
Great. TCONF instead of TFAIL is always wanted :).
Kind regards,
Petr
PATCH 6/6 network/tcp_cc: add new test bbr02
In reply to Alexey KodanevHi Alexey,
Quoted 11 lines
Difference, comparing to bbr01:
* Uses different (not default) qdisc:
pfifo_fast, codel, pfifo, fq, hfsc, hhf, htb, pie, prio, sfb and sfq.
* Emulates congestion not only with packet loss but with delay, corrupt and reorder.The test expects that 'bbr' congestion-control algorithm not significantly worse than 'cubic'.
Signed-off-by Alexey Kodanev <[email protected]>
...
testcases/network/tcp_cc/bbr02.sh line 38
Quoted 7 lines
testcases/network/tcp_cc/bbr02.sh new file +7
-0+do_test() +{ + for q in $qdisc_list; do + if tc qdisc add $q >/dev/null 2>&1; then + tst_res TCONF "$q qdisc not supported" + continue + fi
Yes, this one would of using TST_TEST_DATA.
Kind regards,
Petr
cover network/tcp_cc: add new tests bbr01 and bbr02
In reply to Alexey KodanevHi Alexey,
Quoted 9 lines
The patches are adding two new tests for BBR congestion control algorithm.
* bbr01 test is a simple one and similar to dctcp01 but not using ECN when emulating packet loss.
* bbr02 test, in addition to packet loss emulation with ECN, is using delay, reorder and corrupt features of 'tc'. And also iterates the different queueing disciplines.
Whole patchset looks good to me. I hope to have deeper look tomorrow or on Monday (if you don't merge it before).
Quoted 2 lines
The last test, I guess, should use
TST_TEST_DATAfor passing queueing disciplines.
Yes.
Kind regards,
Petr