Skip to contentSkip to conversation

selftests: mptcp: small pcap-related improvements

PATCH In review Matthieu Baerts (NGI0) 3 participants 7 messages May 1 – May 21

Subsystems (3)
lore
Share & tools
lore

Matthieu Baerts (NGI0)

author maintainer
#0 lore raw

cover selftests: mptcp: small pcap-related improvements

- Patches 1-2: add test name in pcap files.

- Patch 3: drop payload from pcap by limiting the per packet size.

---
Matthieu Baerts (NGI0) (3):
selftests: mptcp: connect: test name in pcap file
selftests: mptcp: simult_flow: test name in pcap file
selftests: mptcp: pcap: drop most of the payload

 tools/testing/selftests/net/mptcp/mptcp_connect.sh |  8 ++++----
 tools/testing/selftests/net/mptcp/mptcp_join.sh    |  2 +-
 tools/testing/selftests/net/mptcp/simult_flows.sh  | 11 ++++++++---
 3 files changed, 13 insertions(+), 8 deletions(-)

---
base-commit: 7478b1b74fb5013908a4237d3f929f3db03fb74e
change-id: 20260501-mptcp-sft-pcap-prefix-b6b6250c50ce

Best regards,

Signature · 1 line
Matthieu Baerts (NGI0) <[email protected]>
author maintainer
#1 lore raw

PATCH 1/3 selftests: mptcp: connect: test name in pcap file

Even if the pcap prefix is printed in the test, it is clearer if this prefix also include the test name: mptcp_connect.

With this, it is easily possible to find out which pcap was produced by which test, and easily delete the right ones.

---
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +3 -3
index a6447f7a31fe..091edee9a7bf 100755
@@ -212,8 +212,8 @@ if $checksum; then
 fi
 
 if $capture; then
-	rndh="${ns1:4}"
-	mptcp_lib_pr_info "Packet capture files will have this prefix: ${rndh}-"
+	capprefix="mptcp_connect-${ns1:4}"
+	mptcp_lib_pr_info "pcap will have this prefix: ${capprefix}-"
 fi
 
 set_ethtool_flags() {
@@ -372,7 +372,7 @@ do_transfer()
 			capuser="-Z $SUDO_USER"
 		fi
 
-		local capfile="${rndh}-${connector_ns:0:3}-${listener_ns:0:3}-${cl_proto}-${srv_proto}-${connect_addr}-${port}"
+		local capfile="${capprefix}-${connector_ns:0:3}-${listener_ns:0:3}-${cl_proto}-${srv_proto}-${connect_addr}-${port}"
 		local capopt="-i any -s 65535 -B 32768 ${capuser}"
 
 		ip netns exec ${listener_ns} tcpdump ${capopt} \
Signature · 1 line
2.53.0
author maintainer
#2 lore raw

PATCH 2/3 selftests: mptcp: simult_flow: test name in pcap file

In reply to Matthieu Baerts (NGI0)

To be able to easily find out which pcap was produced by which test, the selftest name is now added to the pcap file, similar to the other tests.

While at it, print the prefix name to be able to find which capture files have been produced by which test after several runs. This prefix was not printed anywhere before.

---
 tools/testing/selftests/net/mptcp/simult_flows.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
tools/testing/selftests/net/mptcp/simult_flows.sh +7 -2
index d11a8b949aab..2d26d09009f1 100755
@@ -24,6 +24,7 @@ small=""
 sout=""
 cout=""
 capout=""
+capprefix=""
 size=0
 
 usage() {
@@ -70,6 +71,11 @@ setup()
 
 	mptcp_lib_ns_init ns1 ns2 ns3
 
+	if $capture; then
+		capprefix="simult_flows-${ns1:4}"
+		mptcp_lib_pr_info "pcap will have this prefix: ${capprefix}-"
+	fi
+
 	ip link add ns1eth1 netns "$ns1" type veth peer name ns2eth1 netns "$ns2"
 	ip link add ns1eth2 netns "$ns1" type veth peer name ns2eth2 netns "$ns2"
 	ip link add ns2eth3 netns "$ns2" type veth peer name ns3eth1 netns "$ns3"
@@ -136,14 +142,13 @@ do_transfer()
 
 	if $capture; then
 		local capuser
-		local rndh="${ns1:4}"
 		if [ -z $SUDO_USER ] ; then
 			capuser=""
 		else
 			capuser="-Z $SUDO_USER"
 		fi
 
-		local capfile="${rndh}-${port}"
+		local capfile="${capprefix}-${port}"
 		local capopt="-i any -s 65535 -B 32768 ${capuser}"
 
 		ip netns exec ${ns3}  tcpdump ${capopt} -w "${capfile}-listener.pcap"  >> "${capout}" 2>&1 &
Signature · 1 line
2.53.0
author maintainer
#3 lore raw

PATCH 3/3 selftests: mptcp: pcap: drop most of the payload

In reply to Matthieu Baerts (NGI0)

Limit the size of each captured packet to 108B (IPv4 only) or 128B (a mix of v4 and v6): this should drop most of the payload that is generally not needed when debugging an issue.

8 bytes are left in this payload, to be able to inspect the beginning, just in case.

Please also note that generally, this payload is usually mostly filled with 0, except at the end. This reduces the .pcap sizes, and reduce IO usage, which helps debugging issues.

---
 tools/testing/selftests/net/mptcp/mptcp_connect.sh | 2 +-
 tools/testing/selftests/net/mptcp/mptcp_join.sh    | 2 +-
 tools/testing/selftests/net/mptcp/simult_flows.sh  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +1 -1
index 091edee9a7bf..321cef29e288 100755
@@ -373,7 +373,7 @@ do_transfer()
 		fi
 
 		local capfile="${capprefix}-${connector_ns:0:3}-${listener_ns:0:3}-${cl_proto}-${srv_proto}-${connect_addr}-${port}"
-		local capopt="-i any -s 65535 -B 32768 ${capuser}"
+		local capopt="-i any -s 128 -B 32768 ${capuser}"
 
 		ip netns exec ${listener_ns} tcpdump ${capopt} \
 			-w "${capfile}-listener.pcap" >> "${capout}" 2>&1 &
tools/testing/selftests/net/mptcp/mptcp_join.sh +1 -1
index c6bb345d056b..85d24f8929db 100755
@@ -967,7 +967,7 @@ cond_start_capture()
 		capfile=$(printf "mp_join-%02u-%s.pcap" "$MPTCP_LIB_TEST_COUNTER" "$ns")
 
 		echo "Capturing traffic for test $MPTCP_LIB_TEST_COUNTER into $capfile"
-		ip netns exec "$ns" tcpdump -i any -s 65535 -B 32768 $capuser -w "$capfile" > "$capout" 2>&1 &
+		ip netns exec "$ns" tcpdump -i any -s 128 -B 32768 $capuser -w "$capfile" > "$capout" 2>&1 &
 		cappid=$!
 
 		sleep 1
tools/testing/selftests/net/mptcp/simult_flows.sh +1 -1
index 2d26d09009f1..3c0b28878619 100755
@@ -149,7 +149,7 @@ do_transfer()
 		fi
 
 		local capfile="${capprefix}-${port}"
-		local capopt="-i any -s 65535 -B 32768 ${capuser}"
+		local capopt="-i any -s 108 -B 32768 ${capuser}"
 
 		ip netns exec ${ns3}  tcpdump ${capopt} -w "${capfile}-listener.pcap"  >> "${capout}" 2>&1 &
 		local cappid_listener=$!
Signature · 1 line
2.53.0
#4 lore raw
In reply to Matthieu Baerts (NGI0)

Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Unstable: 2 failed test(s): packetdrill_mp_capable packetdrill_syscalls ⚠️
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/25226030943

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

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 Reviewed-by on the v1 series
#5 lore raw
In reply to Matthieu Baerts (NGI0)
Quoted 11 lines · On Fri, 1 May 2026, Matthieu Baerts (NGI0) wrote:

- Patches 1-2: add test name in pcap files.

- Patch 3: drop payload from pcap by limiting the per packet size.

---
Matthieu Baerts (NGI0) (3):
selftests: mptcp: connect: test name in pcap file
selftests: mptcp: simult_flow: test name in pcap file
selftests: mptcp: pcap: drop most of the payload

Quoted 7 lines
tools/testing/selftests/net/mptcp/mptcp_connect.sh |  8 ++++----
tools/testing/selftests/net/mptcp/mptcp_join.sh    |  2 +-
tools/testing/selftests/net/mptcp/simult_flows.sh  | 11 ++++++++---
3 files changed, 13 insertions(+), 8 deletions(-)

---
base-commit: 7478b1b74fb5013908a4237d3f929f3db03fb74e
change-id: 20260501-mptcp-sft-pcap-prefix-b6b6250c50ce

Series LGTM, thanks Matthieu

author maintainer
#6 lore raw

Hi Mat,

Quoted 7 lines · Mat Martineau
Quoted 3 lines · On Fri, 1 May 2026, Matthieu Baerts (NGI0) wrote:

- Patches 1-2: add test name in pcap files.

- Patch 3: drop payload from pcap by limiting the per packet size.

Series LGTM, thanks Matthieu

Thank you for the review! Now in our tree:

New patches for t/upstream:
- f61bf3c2aaee: selftests: mptcp: connect: test name in pcap file
- 1c879ef9314d: selftests: mptcp: simult_flow: test name in pcap file
- 6fce373a33a2: selftests: mptcp: pcap: drop most of the payload
- Results: 1fa2f477d53d..676e99102442 (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/02d6f438cb554cd30299e2857b36e4d3ff9b1735/checks

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.