Skip to contentSkip to conversation

two tc related patches

PATCH In review Geliang Tang 3 participants 6 messages Mar 13, 2024

Subsystems (3)
lore
Share & tools
lore

Geliang Tang

author reviewer
#0 lore raw

cover two tc related patches

From: Geliang Tang <[email protected]>

Two tc related patches.

Geliang Tang (2):
selftests: mptcp: add tc check for check_tools
selftests: mptcp: add ms units for tc-netem delay

 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 2 +-
 tools/testing/selftests/net/mptcp/mptcp_join.sh    | 8 ++++----
 tools/testing/selftests/net/mptcp/mptcp_lib.sh     | 6 ++++++
 tools/testing/selftests/net/mptcp/simult_flows.sh  | 6 +++---
 4 files changed, 14 insertions(+), 8 deletions(-)
Signature · 1 line
2.40.1
author reviewer
#1 lore raw

PATCH 1/2 selftests: mptcp: add tc check for check_tools

From: Geliang Tang <[email protected]>

tc are used in some test scripts: mptcp_connect.sh, mptcp_join.sh and simult_flows.sh. It makes sense to check if tc is installed before running these scripts, just like other tools. So this patch add 'tc' check for mptcp_lib_check_tools(), and check it in these test scripts.

---
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 2 +-
 tools/testing/selftests/net/mptcp/mptcp_join.sh    | 2 +-
 tools/testing/selftests/net/mptcp/mptcp_lib.sh     | 6 ++++++
 tools/testing/selftests/net/mptcp/simult_flows.sh  | 2 +-
 4 files changed, 9 insertions(+), 3 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +1 -1
index 4c4248554826..90c1c5c9caca 100755
@@ -147,7 +147,7 @@ cleanup()
 
 mptcp_lib_check_mptcp
 mptcp_lib_check_kallsyms
-mptcp_lib_check_tools ip
+mptcp_lib_check_tools ip tc
 
 sin=$(mktemp)
 sout=$(mktemp)
tools/testing/selftests/net/mptcp/mptcp_join.sh +1 -1
index 5e9211e89825..8f95e730f4e1 100755
@@ -142,7 +142,7 @@ init() {
 
 	mptcp_lib_check_mptcp
 	mptcp_lib_check_kallsyms
-	mptcp_lib_check_tools ip ss "${iptables}" "${ip6tables}"
+	mptcp_lib_check_tools ip tc ss "${iptables}" "${ip6tables}"
 
 	sin=$(mktemp)
 	sout=$(mktemp)
tools/testing/selftests/net/mptcp/mptcp_lib.sh +6 -0
index d529b4b37af8..1fa05405f65e 100644
@@ -384,6 +384,12 @@ mptcp_lib_check_tools() {
 				exit ${KSFT_SKIP}
 			fi
 			;;
+		"tc")
+			if ! tc -help &> /dev/null; then
+				mptcp_lib_pr_skip "Could not run test without tc tool"
+				exit ${KSFT_SKIP}
+			fi
+			;;
 		"ss")
 			if ! ss -h | grep -q MPTCP; then
 				mptcp_lib_pr_skip "ss tool does not support MPTCP"
tools/testing/selftests/net/mptcp/simult_flows.sh +1 -1
index 68ee92eccccb..72ea563c923c 100755
@@ -45,7 +45,7 @@ cleanup()
 }
 
 mptcp_lib_check_mptcp
-mptcp_lib_check_tools ip
+mptcp_lib_check_tools ip tc
 
 #  "$ns1"              ns2                    ns3
 #     ns1eth1    ns2eth1   ns2eth3      ns3eth1
Signature · 1 line
2.40.1
author reviewer
#2 lore raw

PATCH 2/2 selftests: mptcp: add ms units for tc-netem delay

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

'delay 1' in tc-netem is confusing, not sure if it's a delay of 1 second or 1 millisecond. This patch explicitly adds millisecond units to make these commands clearer.

---
 tools/testing/selftests/net/mptcp/mptcp_join.sh   | 6 +++---
 tools/testing/selftests/net/mptcp/simult_flows.sh | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +3 -3
index 8f95e730f4e1..70621cbbab09 100755
@@ -125,8 +125,8 @@ init_shapers()
 {
 	local i
 	for i in $(seq 1 4); do
-		tc -n $ns1 qdisc add dev ns1eth$i root netem rate 20mbit delay 1
-		tc -n $ns2 qdisc add dev ns2eth$i root netem rate 20mbit delay 1
+		tc -n $ns1 qdisc add dev ns1eth$i root netem rate 20mbit delay 1ms
+		tc -n $ns2 qdisc add dev ns2eth$i root netem rate 20mbit delay 1ms
 	done
 }
 
@@ -3212,7 +3212,7 @@ fail_tests()
 
 	# multiple subflows
 	if reset_with_fail "MP_FAIL MP_RST" 2; then
-		tc -n $ns2 qdisc add dev ns2eth1 root netem rate 1mbit delay 5
+		tc -n $ns2 qdisc add dev ns2eth1 root netem rate 1mbit delay 5ms
 		pm_nl_set_limits $ns1 0 1
 		pm_nl_set_limits $ns2 0 1
 		pm_nl_add_endpoint $ns2 10.0.2.2 dev ns2eth2 flags subflow
tools/testing/selftests/net/mptcp/simult_flows.sh +2 -2
index 72ea563c923c..e129fcb5a598 100755
@@ -216,8 +216,8 @@ run_test()
 	shift 4
 	local msg=$*
 
-	[ $delay1 -gt 0 ] && delay1="delay $delay1" || delay1=""
-	[ $delay2 -gt 0 ] && delay2="delay $delay2" || delay2=""
+	[ $delay1 -gt 0 ] && delay1="delay ${delay1}ms" || delay1=""
+	[ $delay2 -gt 0 ] && delay2="delay ${delay2}ms" || delay2=""
 
 	for dev in ns1eth1 ns1eth2; do
 		tc -n $ns1 qdisc del dev $dev root >/dev/null 2>&1
Signature · 1 line
2.40.1
#3 lore raw
In reply to Geliang Tang

Hi Geliang,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/8259068044

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/cd3741dc2965
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=834831

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

maintainer
#5 lore raw

Hi Geliang,

Quoted 7 lines · Matthieu Baerts

Hi Geliang,

Quoted 4 lines · Geliang Tang

From: Geliang Tang <[email protected]>

Two tc related patches.

Quoted 7 lines
Quoted 3 lines

Geliang Tang (2):
selftests: mptcp: add tc check for check_tools
selftests: mptcp: add ms units for tc-netem delay

Thank you, it looks good to me:

Now in our tree (feat. for next):

New patches for t/upstream:
- 4daabed4354a: selftests: mptcp: add tc check for check_tools
- 3b184258a310: selftests: mptcp: add ms units for tc-netem delay
- Results: 02195e22026a..e2c5d9481519 (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/5f3aa05a0186bfbf6f4d4feeb99657c756a6f456/checks

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.