mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit
@ 2025-08-06 14:22 Matthieu Baerts (NGI0)
  2025-08-06 14:22 ` [PATCH mptcp-net 1/2] " Matthieu Baerts (NGI0)
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-08-06 14:22 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts (NGI0), Thomas Dreibholz

A flush of the MPTCP endpoints should not affect the MPTCP limits. In
other words, 'ip mptcp endpoint flush' should not change 'ip mptcp
limits'.

But it was the case. Patch 1 fixes the issue, and Patch 2 modified
pm_netlink.sh selftest to validate the modification on the kernel side.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (2):
      mptcp: pm: kernel: flush: do not reset ADD_ADDR limit
      selftests: mptcp: pm: check flush doesn't reset limits

 net/mptcp/pm_kernel.c                           | 1 -
 tools/testing/selftests/net/mptcp/pm_netlink.sh | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
---
base-commit: 8353c34f924e5fb87e86e5587e15df160add9a44
change-id: 20250806-mptcp-pm-flush-limit-c5a2d74fc2ea

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


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

* [PATCH mptcp-net 1/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit
  2025-08-06 14:22 [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit Matthieu Baerts (NGI0)
@ 2025-08-06 14:22 ` Matthieu Baerts (NGI0)
  2025-08-06 14:22 ` [PATCH mptcp-net 2/2] selftests: mptcp: pm: check flush doesn't reset limits Matthieu Baerts (NGI0)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-08-06 14:22 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts (NGI0), Thomas Dreibholz

A flush of the MPTCP endpoints should not affect the MPTCP limits. In
other words, 'ip mptcp endpoint flush' should not change 'ip mptcp
limits'.

But it was the case: the MPTCP_PM_ATTR_RCV_ADD_ADDRS (add_addr_accepted)
limit was reset by accident. Removing the reset of this counter during a
flush fixes this issue.

Fixes: 01cacb00b35c ("mptcp: add netlink-based PM")
Reported-by: Thomas Dreibholz <dreibh@simula.no>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/579
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/pm_kernel.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
index 7ec81d5195d412b850dcb550f91384f75b11b347..f30df8e884a0b3de9fb092e5774cafe08f6350ce 100644
--- a/net/mptcp/pm_kernel.c
+++ b/net/mptcp/pm_kernel.c
@@ -1086,7 +1086,6 @@ static void __flush_addrs(struct list_head *list)
 static void __reset_counters(struct pm_nl_pernet *pernet)
 {
 	WRITE_ONCE(pernet->add_addr_signal_max, 0);
-	WRITE_ONCE(pernet->add_addr_accept_max, 0);
 	WRITE_ONCE(pernet->local_addr_max, 0);
 	pernet->addrs = 0;
 }

-- 
2.50.0


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

* [PATCH mptcp-net 2/2] selftests: mptcp: pm: check flush doesn't reset limits
  2025-08-06 14:22 [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit Matthieu Baerts (NGI0)
  2025-08-06 14:22 ` [PATCH mptcp-net 1/2] " Matthieu Baerts (NGI0)
@ 2025-08-06 14:22 ` Matthieu Baerts (NGI0)
  2025-08-06 16:02 ` [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit MPTCP CI
  2025-08-14  0:25 ` Mat Martineau
  3 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-08-06 14:22 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts (NGI0)

This modification is linked to the parent commit where the received
ADD_ADDR limit was accidentally reset when the endpoints were flushed.

To validate that, the test is now flushing endpoints after having set
new limits, and before checking them.

The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests,
but it validates the previous fix for an issue introduced by this commit
ID.

Fixes: 01cacb00b35c ("mptcp: add netlink-based PM")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/pm_netlink.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh
index 2e6648a2b2c0c6ea0e9f030c942077a0f483092f..ac7ec6f9402376a34602ef1ca6c4822e8dde0ded 100755
--- a/tools/testing/selftests/net/mptcp/pm_netlink.sh
+++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh
@@ -198,6 +198,7 @@ set_limits 1 9 2>/dev/null
 check "get_limits" "${default_limits}" "subflows above hard limit"
 
 set_limits 8 8
+flush_endpoint  ## to make sure it doesn't affect the limits
 check "get_limits" "$(format_limits 8 8)" "set limits"
 
 flush_endpoint

-- 
2.50.0


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

* Re: [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit
  2025-08-06 14:22 [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit Matthieu Baerts (NGI0)
  2025-08-06 14:22 ` [PATCH mptcp-net 1/2] " Matthieu Baerts (NGI0)
  2025-08-06 14:22 ` [PATCH mptcp-net 2/2] selftests: mptcp: pm: check flush doesn't reset limits Matthieu Baerts (NGI0)
@ 2025-08-06 16:02 ` MPTCP CI
  2025-08-14  0:25 ` Mat Martineau
  3 siblings, 0 replies; 6+ messages in thread
From: MPTCP CI @ 2025-08-06 16:02 UTC (permalink / raw)
  To: Matthieu Baerts; +Cc: mptcp

Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Unstable: 1 failed test(s): selftest_mptcp_connect 🔴
- KVM Validation: debug: 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/16780011899

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


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)

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

* Re: [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit
  2025-08-06 14:22 [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit Matthieu Baerts (NGI0)
                   ` (2 preceding siblings ...)
  2025-08-06 16:02 ` [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit MPTCP CI
@ 2025-08-14  0:25 ` Mat Martineau
  2025-08-15 11:00   ` Matthieu Baerts
  3 siblings, 1 reply; 6+ messages in thread
From: Mat Martineau @ 2025-08-14  0:25 UTC (permalink / raw)
  To: Matthieu Baerts (NGI0); +Cc: mptcp, Thomas Dreibholz

On Wed, 6 Aug 2025, Matthieu Baerts (NGI0) wrote:

> A flush of the MPTCP endpoints should not affect the MPTCP limits. In
> other words, 'ip mptcp endpoint flush' should not change 'ip mptcp
> limits'.
>
> But it was the case. Patch 1 fixes the issue, and Patch 2 modified
> pm_netlink.sh selftest to validate the modification on the kernel side.
>
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
> Matthieu Baerts (NGI0) (2):
>      mptcp: pm: kernel: flush: do not reset ADD_ADDR limit
>      selftests: mptcp: pm: check flush doesn't reset limits
>
> net/mptcp/pm_kernel.c                           | 1 -
> tools/testing/selftests/net/mptcp/pm_netlink.sh | 1 +
> 2 files changed, 1 insertion(+), 1 deletion(-)
> ---
> base-commit: 8353c34f924e5fb87e86e5587e15df160add9a44
> change-id: 20250806-mptcp-pm-flush-limit-c5a2d74fc2ea
>

Series LGTM, thanks Matthieu!

Reviewed-by: Mat Martineau <martineau@kernel.org>



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

* Re: [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit
  2025-08-14  0:25 ` Mat Martineau
@ 2025-08-15 11:00   ` Matthieu Baerts
  0 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts @ 2025-08-15 11:00 UTC (permalink / raw)
  To: Mat Martineau; +Cc: mptcp, Thomas Dreibholz

Hi Mat,

On 14/08/2025 02:25, Mat Martineau wrote:
> On Wed, 6 Aug 2025, Matthieu Baerts (NGI0) wrote:
> 
>> A flush of the MPTCP endpoints should not affect the MPTCP limits. In
>> other words, 'ip mptcp endpoint flush' should not change 'ip mptcp
>> limits'.
>>
>> But it was the case. Patch 1 fixes the issue, and Patch 2 modified
>> pm_netlink.sh selftest to validate the modification on the kernel side.
>>
>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>> ---
>> Matthieu Baerts (NGI0) (2):
>>      mptcp: pm: kernel: flush: do not reset ADD_ADDR limit
>>      selftests: mptcp: pm: check flush doesn't reset limits
>>
>> net/mptcp/pm_kernel.c                           | 1 -
>> tools/testing/selftests/net/mptcp/pm_netlink.sh | 1 +
>> 2 files changed, 1 insertion(+), 1 deletion(-)
>> ---
>> base-commit: 8353c34f924e5fb87e86e5587e15df160add9a44
>> change-id: 20250806-mptcp-pm-flush-limit-c5a2d74fc2ea
>>
> 
> Series LGTM, thanks Matthieu!
> 
> Reviewed-by: Mat Martineau <martineau@kernel.org>

Thank you for the review!

Now in our tree (fixes for -net):

New patches for t/upstream-net and t/upstream:
- 7f177b98bfef: mptcp: pm: kernel: flush: do not reset ADD_ADDR limit
- d62e61868bae: selftests: mptcp: pm: check flush doesn't reset limits
- Results: e81a6d054101..3f23a1fbaa6a (export-net)
- Results: 6e5604790ba7..7c14230bb733 (export)

Tests are now in progress:

- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/af6558fbffb5f4001db78a0b124920bc4555ae7a/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/0e9edf26da4f62d2781a9cdca55e6e6af18d5c0e/checks

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


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

end of thread, other threads:[~2025-08-15 11:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 14:22 [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit Matthieu Baerts (NGI0)
2025-08-06 14:22 ` [PATCH mptcp-net 1/2] " Matthieu Baerts (NGI0)
2025-08-06 14:22 ` [PATCH mptcp-net 2/2] selftests: mptcp: pm: check flush doesn't reset limits Matthieu Baerts (NGI0)
2025-08-06 16:02 ` [PATCH mptcp-net 0/2] mptcp: pm: kernel: flush: do not reset ADD_ADDR limit MPTCP CI
2025-08-14  0:25 ` Mat Martineau
2025-08-15 11:00   ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).