Skip to contentSkip to conversation

network/tcp_cc: add new tests bbr01 and bbr02

PATCH New Alexey Kodanev 3 participants 22 messages May 21, 2018 – Jun 8, 2018

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
deleted file mode 100644
index 82a6262..0000000
@@ -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
new file mode 100644
index 0000000..82a6262
@@ -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
#4 lore raw

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
index 82a6262..a564eb4 100644
@@ -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
#6 lore raw

PATCH 3/6 network/tcp_cc/dctcp01: increase packet loss for dctcp

In reply to Alexey Kodanev

Avoid 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
index 02b27cf..3562f5a 100755
@@ -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
#8 lore raw

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
index b96c8af..7e93e1d 100755
@@ -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
#10 lore raw

PATCH 4/6 network/tcp_cc/lib: add a function to set qdisc and txqueuelen

In reply to Alexey Kodanev

Hi Alexey,

Quoted 36 lines
---
 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
index b96c8af..7e93e1d 100755
@@ -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

#11 lore raw

PATCH 4/6 network/tcp_cc/lib: add a function to set qdisc and txqueuelen

In reply to Alexey Kodanev

Hi Alexey,

Quoted 36 lines
---
 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
index b96c8af..7e93e1d 100755
@@ -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

#12 lore raw

PATCH 4/6 network/tcp_cc/lib: add a function to set qdisc and txqueuelen

Hi Alexey,

Quoted 1 line
Quoted 1 line

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

#13 lore raw

PATCH 5/6 network/tcp_cc: add new test bbr01

In reply to Alexey Kodanev

Emulates 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
index df78c04..732c053 100644
@@ -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
new file mode 100755
index 0000000..3825c22
@@ -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
#16 lore raw

PATCH 6/6 network/tcp_cc: add new test bbr02

In reply to Alexey Kodanev

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'.

---
 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
index 732c053..eac1b2b 100644
@@ -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
#17 lore raw

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'.

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

#18 lore raw

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'.

...

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
+		fi

Yes, 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.

#19 lore raw

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

#20 lore raw

PATCH 6/6 network/tcp_cc: add new test bbr02

In reply to Alexey Kodanev

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'.

...

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

#21 lore raw

cover network/tcp_cc: add new tests bbr01 and bbr02

In reply to Alexey Kodanev

Hi 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_DATA for passing queueing disciplines.

Yes.

Kind regards,
Petr