Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup
@ 2026-05-27 12:11 Matthieu Baerts (NGI0)
  2026-05-27 12:11 ` [PATCH net 1/3] selftests: mptcp: simult_flows: disable GSO Matthieu Baerts (NGI0)
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-05-27 12:11 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
	Florian Westphal
  Cc: netdev, mptcp, linux-kselftest, linux-kernel,
	Matthieu Baerts (NGI0), stable, Geliang Tang

Bufferbloat is baaaad, even in our selftests: let's kill it (or at least
reduce it). By doing that, the tests (seem to) have a more stable
transfer, and are then less unstable. That's what patches 1-2 are doing,
and they can be backported up to 5.10.

Patch 3 is not related: a small fix in the selftests to remove temp
files that were not deleted in some conditions, since v5.13.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Geliang Tang (1):
      selftests: mptcp: sockopt: set EXIT trap earlier

Matthieu Baerts (NGI0) (2):
      selftests: mptcp: simult_flows: disable GSO
      selftests: mptcp: simult_flows: adapt limits

 tools/testing/selftests/net/mptcp/mptcp_sockopt.sh |  2 +-
 tools/testing/selftests/net/mptcp/simult_flows.sh  | 34 ++++++++++++----------
 2 files changed, 19 insertions(+), 17 deletions(-)
---
base-commit: dd433671fef381fdaf7b530c631e6b782d66e224
change-id: 20260527-net-mptcp-sft-bufferbloat-exit-8059196adce4

Best regards,
--  
Matthieu Baerts (NGI0) <matttbe@kernel.org>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net 1/3] selftests: mptcp: simult_flows: disable GSO
  2026-05-27 12:11 [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup Matthieu Baerts (NGI0)
@ 2026-05-27 12:11 ` Matthieu Baerts (NGI0)
  2026-05-27 12:11 ` [PATCH net 2/3] selftests: mptcp: simult_flows: adapt limits Matthieu Baerts (NGI0)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-05-27 12:11 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
	Florian Westphal
  Cc: netdev, mptcp, linux-kselftest, linux-kernel,
	Matthieu Baerts (NGI0), stable

Netem is used to apply a rate limit, and its 'limit' option is per
packet.

Disable GSO on both sides to work with packets of a specific size. That
increases the number of packets, but stabilise the throughput. As a
consequence, limits are more adapted, and the bufferbloat is reduced.

Fixes: 8c09412e584d ("selftests: mptcp: more stable simult_flows tests")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/simult_flows.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh
index d11a8b949aab..345cf200c653 100755
--- a/tools/testing/selftests/net/mptcp/simult_flows.sh
+++ b/tools/testing/selftests/net/mptcp/simult_flows.sh
@@ -76,13 +76,13 @@ setup()
 
 	ip -net "$ns1" addr add 10.0.1.1/24 dev ns1eth1
 	ip -net "$ns1" addr add dead:beef:1::1/64 dev ns1eth1 nodad
-	ip -net "$ns1" link set ns1eth1 up mtu 1500
+	ip -net "$ns1" link set ns1eth1 up mtu 1500 gso_max_segs 0
 	ip -net "$ns1" route add default via 10.0.1.2
 	ip -net "$ns1" route add default via dead:beef:1::2
 
 	ip -net "$ns1" addr add 10.0.2.1/24 dev ns1eth2
 	ip -net "$ns1" addr add dead:beef:2::1/64 dev ns1eth2 nodad
-	ip -net "$ns1" link set ns1eth2 up mtu 1500
+	ip -net "$ns1" link set ns1eth2 up mtu 1500 gso_max_segs 0
 	ip -net "$ns1" route add default via 10.0.2.2 metric 101
 	ip -net "$ns1" route add default via dead:beef:2::2 metric 101
 
@@ -91,21 +91,21 @@ setup()
 
 	ip -net "$ns2" addr add 10.0.1.2/24 dev ns2eth1
 	ip -net "$ns2" addr add dead:beef:1::2/64 dev ns2eth1 nodad
-	ip -net "$ns2" link set ns2eth1 up mtu 1500
+	ip -net "$ns2" link set ns2eth1 up mtu 1500 gso_max_segs 0
 
 	ip -net "$ns2" addr add 10.0.2.2/24 dev ns2eth2
 	ip -net "$ns2" addr add dead:beef:2::2/64 dev ns2eth2 nodad
-	ip -net "$ns2" link set ns2eth2 up mtu 1500
+	ip -net "$ns2" link set ns2eth2 up mtu 1500 gso_max_segs 0
 
 	ip -net "$ns2" addr add 10.0.3.2/24 dev ns2eth3
 	ip -net "$ns2" addr add dead:beef:3::2/64 dev ns2eth3 nodad
-	ip -net "$ns2" link set ns2eth3 up mtu 1500
+	ip -net "$ns2" link set ns2eth3 up mtu 1500 gso_max_segs 0
 	ip netns exec "$ns2" sysctl -q net.ipv4.ip_forward=1
 	ip netns exec "$ns2" sysctl -q net.ipv6.conf.all.forwarding=1
 
 	ip -net "$ns3" addr add 10.0.3.3/24 dev ns3eth1
 	ip -net "$ns3" addr add dead:beef:3::3/64 dev ns3eth1 nodad
-	ip -net "$ns3" link set ns3eth1 up mtu 1500
+	ip -net "$ns3" link set ns3eth1 up mtu 1500 gso_max_segs 0
 	ip -net "$ns3" route add default via 10.0.3.2
 	ip -net "$ns3" route add default via dead:beef:3::2
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 2/3] selftests: mptcp: simult_flows: adapt limits
  2026-05-27 12:11 [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup Matthieu Baerts (NGI0)
  2026-05-27 12:11 ` [PATCH net 1/3] selftests: mptcp: simult_flows: disable GSO Matthieu Baerts (NGI0)
@ 2026-05-27 12:11 ` Matthieu Baerts (NGI0)
  2026-05-27 12:11 ` [PATCH net 3/3] selftests: mptcp: sockopt: set EXIT trap earlier Matthieu Baerts (NGI0)
  2026-05-28 21:42 ` [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup Jakub Kicinski
  3 siblings, 0 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-05-27 12:11 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
	Florian Westphal
  Cc: netdev, mptcp, linux-kselftest, linux-kernel,
	Matthieu Baerts (NGI0), stable

Avoid using a fixed limit, no matter the setup. This was causing too
high bufferbloat in some situations, e.g. with a low bandwidth and very
low delay because the default limit was too high for this case.

Instead, use more appropriated limits. Note that unbalanced bandwidth
modes seem to require slightly higher limits to cope with the different
bursts.

Fixes: 8c09412e584d ("selftests: mptcp: more stable simult_flows tests")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/simult_flows.sh | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh
index 345cf200c653..7b9aabe10170 100755
--- a/tools/testing/selftests/net/mptcp/simult_flows.sh
+++ b/tools/testing/selftests/net/mptcp/simult_flows.sh
@@ -223,9 +223,11 @@ run_test()
 	local rate2=$2
 	local delay1=$3
 	local delay2=$4
+	local limit1=$5
+	local limit2=$6
 	local lret
 	local dev
-	shift 4
+	shift 6
 	local msg=$*
 
 	[ $delay1 -gt 0 ] && delay1="delay ${delay1}ms" || delay1=""
@@ -240,10 +242,10 @@ run_test()
 
 	# keep the queued pkts number low, or the RTT estimator will see
 	# increasing latency over time.
-	tc -n $ns1 qdisc add dev ns1eth1 root netem rate ${rate1}mbit $delay1 limit 50
-	tc -n $ns1 qdisc add dev ns1eth2 root netem rate ${rate2}mbit $delay2 limit 50
-	tc -n $ns2 qdisc add dev ns2eth1 root netem rate ${rate1}mbit $delay1 limit 50
-	tc -n $ns2 qdisc add dev ns2eth2 root netem rate ${rate2}mbit $delay2 limit 50
+	tc -n $ns1 qdisc add dev ns1eth1 root netem rate ${rate1}mbit $delay1 limit ${limit1}
+	tc -n $ns1 qdisc add dev ns1eth2 root netem rate ${rate2}mbit $delay2 limit ${limit2}
+	tc -n $ns2 qdisc add dev ns2eth1 root netem rate ${rate1}mbit $delay1 limit ${limit1}
+	tc -n $ns2 qdisc add dev ns2eth2 root netem rate ${rate2}mbit $delay2 limit ${limit2}
 
 	# time is measured in ms, account for transfer size, aggregated link speed
 	# and header overhead (10%)
@@ -301,13 +303,13 @@ done
 
 setup
 mptcp_lib_subtests_last_ts_reset
-run_test 10 10 0 0 "balanced bwidth"
-run_test 10 10 1 25 "balanced bwidth with unbalanced delay"
+run_test 10 10 0 0  20 20 "balanced bwidth"
+run_test 10 10 1 25 20 50 "balanced bwidth with unbalanced delay"
 
 # we still need some additional infrastructure to pass the following test-cases
-MPTCP_LIB_SUBTEST_FLAKY=1 run_test 10 3 0 0 "unbalanced bwidth"
-run_test 10 3 1 25 "unbalanced bwidth with unbalanced delay"
-run_test 10 3 25 1 "unbalanced bwidth with opposed, unbalanced delay"
+MPTCP_LIB_SUBTEST_FLAKY=1 run_test 10 3 0 0  30 20 "unbalanced bwidth"
+run_test 10 3 1 25 40 30 "unbalanced bwidth with unbalanced delay"
+run_test 10 3 25 1 50 30 "unbalanced bwidth with opposed, unbalanced delay"
 
 mptcp_lib_result_print_all_tap
 exit $ret

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 3/3] selftests: mptcp: sockopt: set EXIT trap earlier
  2026-05-27 12:11 [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup Matthieu Baerts (NGI0)
  2026-05-27 12:11 ` [PATCH net 1/3] selftests: mptcp: simult_flows: disable GSO Matthieu Baerts (NGI0)
  2026-05-27 12:11 ` [PATCH net 2/3] selftests: mptcp: simult_flows: adapt limits Matthieu Baerts (NGI0)
@ 2026-05-27 12:11 ` Matthieu Baerts (NGI0)
  2026-05-28 21:42 ` [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup Jakub Kicinski
  3 siblings, 0 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-05-27 12:11 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
	Florian Westphal
  Cc: netdev, mptcp, linux-kselftest, linux-kernel,
	Matthieu Baerts (NGI0), stable, Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

Set the EXIT trap for cleanup immediately after creating temporary file
variables, before init and make_file, to ensure cleanup runs on any
failure or interruption during the early setup phase.

Fixes: dc65fe82fb07 ("selftests: mptcp: add packet mark test case")
Cc: stable@vger.kernel.org
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh
index ab8bce06b262..e850a87429b6 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh
@@ -355,10 +355,10 @@ sin=$(mktemp)
 sout=$(mktemp)
 cin=$(mktemp)
 cout=$(mktemp)
+trap cleanup EXIT
 init
 make_file "$cin" "client" 1
 make_file "$sin" "server" 1
-trap cleanup EXIT
 mptcp_lib_subtests_last_ts_reset
 
 run_tests $ns1 $ns2 10.0.1.1

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup
  2026-05-27 12:11 [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup Matthieu Baerts (NGI0)
                   ` (2 preceding siblings ...)
  2026-05-27 12:11 ` [PATCH net 3/3] selftests: mptcp: sockopt: set EXIT trap earlier Matthieu Baerts (NGI0)
@ 2026-05-28 21:42 ` Jakub Kicinski
  2026-05-28 23:13   ` Matthieu Baerts
  3 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2026-05-28 21:42 UTC (permalink / raw)
  To: Matthieu Baerts (NGI0)
  Cc: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, Shuah Khan, Florian Westphal, netdev,
	mptcp, linux-kselftest, linux-kernel, stable

On Wed, 27 May 2026 22:11:33 +1000 Matthieu Baerts (NGI0) wrote:
> Bufferbloat is baaaad, even in our selftests: let's kill it (or at least
> reduce it). By doing that, the tests (seem to) have a more stable
> transfer, and are then less unstable. That's what patches 1-2 are doing,
> and they can be backported up to 5.10.

Could you explain a little more what this is actually fixing?
Does it give a huge increase in test stability?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup
  2026-05-28 21:42 ` [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup Jakub Kicinski
@ 2026-05-28 23:13   ` Matthieu Baerts
  2026-05-28 23:39     ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: Matthieu Baerts @ 2026-05-28 23:13 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, Shuah Khan, Florian Westphal, netdev,
	mptcp, linux-kselftest, linux-kernel, stable

Hi Jakub,

On 29/05/2026 07:42, Jakub Kicinski wrote:
> On Wed, 27 May 2026 22:11:33 +1000 Matthieu Baerts (NGI0) wrote:
>> Bufferbloat is baaaad, even in our selftests: let's kill it (or at least
>> reduce it). By doing that, the tests (seem to) have a more stable
>> transfer, and are then less unstable. That's what patches 1-2 are doing,
>> and they can be backported up to 5.10.
> 
> Could you explain a little more what this is actually fixing?

The simult_flows.sh test simulates very low speed links using netem
qdiscs. With the current configuration, still a large amount of packets
can be queued, which means high TCP RTT samples and then large receive
buffer size. Minimal inaccuracy in the pacing rate can lead to using
only one subflow towards the end of the connection for a considerable
amount of data, while the test expects to use the 2 available paths in
parallel.

> Does it give a huge increase in test stability?
I would say no: the test was not that flaky, mainly on NIPA in fact, and
around 4% in the last 100 tests [1]. On my side, I had to get my system
busy to reproduce the issues. My hope is that the success rate on NIPA
switches from 96 to ~100%. No failure since its introduction in
"net-next-2026-05-27--15-00".

I sent them to net, just to increase the stability when validating
stable kernels as well. But all of this is not urgent, and this series
can be applied in net-next if preferred. Do you want me to resend this
series targeting net-next?

[1] https://netdev.bots.linux.dev/flakes.html?tn-needle=simult-flows-sh

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup
  2026-05-28 23:13   ` Matthieu Baerts
@ 2026-05-28 23:39     ` Jakub Kicinski
  0 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2026-05-28 23:39 UTC (permalink / raw)
  To: Matthieu Baerts
  Cc: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Paolo Abeni, Simon Horman, Shuah Khan, Florian Westphal, netdev,
	mptcp, linux-kselftest, linux-kernel, stable

On Fri, 29 May 2026 09:13:44 +1000 Matthieu Baerts wrote:
> Hi Jakub,
> 
> On 29/05/2026 07:42, Jakub Kicinski wrote:
> > On Wed, 27 May 2026 22:11:33 +1000 Matthieu Baerts (NGI0) wrote:  
> >> Bufferbloat is baaaad, even in our selftests: let's kill it (or at least
> >> reduce it). By doing that, the tests (seem to) have a more stable
> >> transfer, and are then less unstable. That's what patches 1-2 are doing,
> >> and they can be backported up to 5.10.  
> > 
> > Could you explain a little more what this is actually fixing?  
> 
> The simult_flows.sh test simulates very low speed links using netem
> qdiscs. With the current configuration, still a large amount of packets
> can be queued, which means high TCP RTT samples and then large receive
> buffer size. Minimal inaccuracy in the pacing rate can lead to using
> only one subflow towards the end of the connection for a considerable
> amount of data, while the test expects to use the 2 available paths in
> parallel.
> 
> > Does it give a huge increase in test stability?  
> I would say no: the test was not that flaky, mainly on NIPA in fact, and
> around 4% in the last 100 tests [1]. On my side, I had to get my system
> busy to reproduce the issues. My hope is that the success rate on NIPA
> switches from 96 to ~100%. No failure since its introduction in
> "net-next-2026-05-27--15-00".
> 
> I sent them to net, just to increase the stability when validating
> stable kernels as well. But all of this is not urgent, and this series
> can be applied in net-next if preferred. Do you want me to resend this
> series targeting net-next?

Thanks for explaining, I will take these via net-next, no problem.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-05-28 23:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 12:11 [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup Matthieu Baerts (NGI0)
2026-05-27 12:11 ` [PATCH net 1/3] selftests: mptcp: simult_flows: disable GSO Matthieu Baerts (NGI0)
2026-05-27 12:11 ` [PATCH net 2/3] selftests: mptcp: simult_flows: adapt limits Matthieu Baerts (NGI0)
2026-05-27 12:11 ` [PATCH net 3/3] selftests: mptcp: sockopt: set EXIT trap earlier Matthieu Baerts (NGI0)
2026-05-28 21:42 ` [PATCH net 0/3] selftests: mptcp: reduce bufferbloat and cleanup Jakub Kicinski
2026-05-28 23:13   ` Matthieu Baerts
2026-05-28 23:39     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox