Skip to contentSkip to conversation

squash-to patches for "add helpers in mptcp_lib.sh"

PATCH In review Geliang Tang 3 participants 8 messages Mar 7, 2024

Subsystems (3)
lore
Share & tools
lore

Geliang Tang

author reviewer
#0 lore raw

cover squash-to patches for "add helpers in mptcp_lib.sh"

From: Geliang Tang <[email protected]>

Two squash-to patches for "add helpers and vars in mptcp_lib.sh, part 3".

Geliang Tang (2):
Squash to "selftests: mptcp: connect: add dedicated port counter" Squash to "selftests: mptcp: connect: use += operator to append
strings"

 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
Signature · 1 line
2.40.1
author reviewer
#1 lore raw

PATCH 1/2 Squash to "selftests: mptcp: connect: add dedicated port counter"

From: Geliang Tang <[email protected]>

Move port++ from the beginning of do_transfer to the end of it, then 9999 can be set to 10000, the same as 19999.

---
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +4 -4
index 5942256857a5..8feb4eef0931 100755
@@ -33,7 +33,7 @@ do_tcp=0
 checksum=false
 filesize=0
 connect_per_transfer=1
-port=$((10000 - 1))
+port=10000
 
 if [ $tc_loss -eq 100 ];then
 	tc_loss=1%
@@ -320,8 +320,6 @@ do_transfer()
 	local local_addr="$6"
 	local extra_args="$7"
 
-	port=$((port + 1))
-
 	if [ "$rcvbuf" -gt 0 ]; then
 		extra_args+=" -R $rcvbuf"
 	fi
@@ -446,6 +444,8 @@ do_transfer()
 		return 1
 	fi
 
+	port=$((port+1))
+
 	mptcp_lib_check_transfer $sin $cout "file received by client"
 	retc=$?
 	mptcp_lib_check_transfer $cin $sout "file received by server"
@@ -719,7 +719,7 @@ EOF
 
 	mptcp_lib_pr_info "test $msg"
 
-	port=$((20000 - 1))
+	port=20000
 	local extra_args="-o TRANSPARENT"
 	do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP \
 		    ${connect_addr} ${local_addr} "${extra_args}"
Signature · 1 line
2.40.1
maintainer
#2 lore raw

Re: [PATCH mptcp-next 1/2] Squash to "selftests: mptcp: connect: add dedicated port counter"

Hi Geliang,

Quoted 4 lines · Geliang Tang

From: Geliang Tang <[email protected]>

Move port++ from the beginning of do_transfer to the end of it, then 9999 can be set to 10000, the same as 19999.

I initially wanted to do that, but...

Quoted 28 lines
---
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +1 -3
index 5942256857a5..8feb4eef0931 100755
@@ -33,7 +33,7 @@ do_tcp=0
 checksum=false
 filesize=0
 connect_per_transfer=1
-port=$((10000 - 1))
+port=10000
 
 if [ $tc_loss -eq 100 ];then
 	tc_loss=1%
@@ -320,8 +320,6 @@ do_transfer()
 	local local_addr="$6"
 	local extra_args="$7"
 
-	port=$((port + 1))
-
 	if [ "$rcvbuf" -gt 0 ]; then
 		extra_args+=" -R $rcvbuf"
 	fi

tools/testing/selftests/net/mptcp/mptcp_connect.sh do_transfer() · line 444

Quoted 1 line
tools/testing/selftests/net/mptcp/mptcp_connect.sh +0 -0
@@ -446,6 +444,8 @@ do_transfer()
 		return 1

... the counter will not be incremented in case of failure.

To avoid incrementing the counter from different places, I found it safer to start it one off the first one. We can still see it's 10000.

tools/testing/selftests/net/mptcp/mptcp_connect.sh do_transfer() · line 447

Quoted 3 lines
tools/testing/selftests/net/mptcp/mptcp_connect.sh +1 -0
 	fi
 
+	port=$((port+1))

(it is not really the end of the function :) )

tools/testing/selftests/net/mptcp/mptcp_connect.sh EOF · line 725

Quoted 13 lines
tools/testing/selftests/net/mptcp/mptcp_connect.sh +2 -1
+
 	mptcp_lib_check_transfer $sin $cout "file received by client"
 	retc=$?
 	mptcp_lib_check_transfer $cin $sout "file received by server"
@@ -719,7 +719,7 @@ EOF
 
 	mptcp_lib_pr_info "test $msg"
 
-	port=$((20000 - 1))
+	port=20000
 	local extra_args="-o TRANSPARENT"
 	do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP \
 		    ${connect_addr} ${local_addr} "${extra_args}"

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.
author reviewer
#3 lore raw

Re: [PATCH mptcp-next 1/2] Squash to "selftests: mptcp: connect: add dedicated port counter"

Hi Matt,

Quoted 32 lines · Matthieu Baerts

Hi Geliang,

Quoted 4 lines · Geliang Tang

From: Geliang Tang <[email protected]>

Move port++ from the beginning of do_transfer to the end of it, then 9999 can be set to 10000, the same as 19999.

I initially wanted to do that, but...

Quoted 22 lines
---
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +1 -1
index 5942256857a5..8feb4eef0931 100755
@@ -33,7 +33,7 @@ do_tcp=0
 checksum=false
 filesize=0
 connect_per_transfer=1
-port=$((10000 - 1))
+port=10000
 
 if [ $tc_loss -eq 100 ];then
 	tc_loss=1%
@@ -320,8 +320,6 @@ do_transfer()
 	local local_addr="$6"
 	local extra_args="$7"
 
Quoted 9 lines

tools/testing/selftests/net/mptcp/mptcp_connect.sh do_transfer() · line 444

Quoted 7 lines
tools/testing/selftests/net/mptcp/mptcp_connect.sh +0 -2
-	port=$((port + 1))
-
 	if [ "$rcvbuf" -gt 0 ]; then
 		extra_args+=" -R $rcvbuf"
 	fi
@@ -446,6 +444,8 @@ do_transfer()
 		return 1

... the counter will not be incremented in case of failure.

Yes, let's drop this patch.

Thanks,
-Geliang

Quoted 28 lines

To avoid incrementing the counter from different places, I found it safer to start it one off the first one. We can still see it's 10000.

tools/testing/selftests/net/mptcp/mptcp_connect.sh do_transfer() · line 447

Quoted 3 lines
tools/testing/selftests/net/mptcp/mptcp_connect.sh +1 -0
 	fi
 
+	port=$((port+1))

(it is not really the end of the function :) )

tools/testing/selftests/net/mptcp/mptcp_connect.sh EOF · line 725

Quoted 13 lines
tools/testing/selftests/net/mptcp/mptcp_connect.sh +2 -1
+
 	mptcp_lib_check_transfer $sin $cout "file received by client"
 	retc=$?
 	mptcp_lib_check_transfer $cin $sout "file received by server"
@@ -719,7 +719,7 @@ EOF
 
 	mptcp_lib_pr_info "test $msg"
 
-	port=$((20000 - 1))
+	port=20000
 	local extra_args="-o TRANSPARENT"
 	do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP \
 		    ${connect_addr} ${local_addr} "${extra_args}"

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.
author reviewer
#4 lore raw

PATCH 2/2 Squash to "selftests: mptcp: connect: use += operator to append strings"

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

Append the fallback note into 'extra' string too.

---
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +2 -3
index 8feb4eef0931..c1733c38a2de 100755
@@ -451,6 +451,7 @@ do_transfer()
 	mptcp_lib_check_transfer $cin $sout "file received by server"
 	rets=$?
 
+	local extra=""
 	local stat_synrx_now_l
 	local stat_ackrx_now_l
 	local stat_cookietx_now
@@ -484,7 +485,7 @@ do_transfer()
 					  "than expected (${expect_ackrx})"
 			rets=1
 		else
-			printf "[ Note ] fallback due to TCP OoO"
+			extra+=" [ Note ] fallback due to TCP OoO"
 		fi
 	fi
 
@@ -507,8 +508,6 @@ do_transfer()
 		fi
 	fi
 
-	local extra=""
-
 	if [ $cookies -eq 2 ];then
 		if [ $stat_cookietx_last -ge $stat_cookietx_now ] ;then
 			extra+=" WARN: CookieSent: did not advance"
Signature · 1 line
2.40.1
#5 lore raw

Re: Squash to "selftests: mptcp: connect: use += operator to append strings": Tests Results

Hi Geliang,

Thank you for your modifications, that's great!

Our CI (GitHub Action) did some validations and here is its report:

- KVM Validation: normal:
- Success! ✅:
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/8181456175

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/a61bf0e8b8fd

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)

#6 lore raw

Re: Squash to "selftests: mptcp: connect: use += operator to append strings": Tests Results

In reply to Geliang Tang

Hi Geliang,

Thank you for your modifications, that's great!

Our CI (Cirrus) did some validations with a debug kernel and here is its report:

- KVM Validation: debug (except selftest_mptcp_join):
- Unstable: 1 failed test(s): packetdrill_mp_join 🔴:
- Task: https://cirrus-ci.com/task/6082312262123520
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6082312262123520/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
- Unstable: 1 failed test(s): selftest_mptcp_join 🔴:
- Task: https://cirrus-ci.com/task/5519362308702208
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5519362308702208/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/a61bf0e8b8fd

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-debug

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

Re: [PATCH mptcp-next 2/2] Squash to "selftests: mptcp: connect: use += operator to append strings"

In reply to Geliang Tang

Hi Geliang,

Quoted 3 lines · Geliang Tang

From: Geliang Tang <[email protected]>

Append the fallback note into 'extra' string too.

Thanks, just applied this patch 2/2 and the other one you sent today + my suggestion:

- 853ccbd0b6df: "squashed" in "selftests: mptcp: connect: use += operator to append strings"
- 346ae0576b55: "squashed" in "selftests: mptcp: print test results with colors"
- 405273a52e3c: "squashed" in "selftests: mptcp: print test results with colors"

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20240307T094044

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.