Skip to contentSkip to conversation

mptcp: pm: kernel: flush: do not reset ADD_ADDR limit

PATCH In review Heyne, Maximilian 3 participants 4 messages Sep 10, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mptcp: pm: kernel: flush: do not reset ADD_ADDR limit

From: "Matthieu Baerts (NGI0)" <[email protected]>

commit 68fc0f4b0d25692940cdc85c68e366cae63e1757 upstream.

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.

[adjusted patch by removing WRITE_ONCE to take into account the missing
commit 72603d207d59 ("mptcp: use WRITE_ONCE for the pernet *_max")]

---
For some reason only the corresponding selftest patch was backported and it's now failing on 5.10 kernels. I tested that with this patch the selftest is succeeding again.

---
 net/mptcp/pm_netlink.c | 1 -
 1 file changed, 1 deletion(-)
net/mptcp/pm_netlink.c +0 -1
index 32379fc706cac..c31a1dc69f835 100644
@@ -869,7 +869,6 @@ static void __flush_addrs(struct pm_nl_pernet *pernet)
 static void __reset_counters(struct pm_nl_pernet *pernet)
 {
 	pernet->add_addr_signal_max = 0;
-	pernet->add_addr_accept_max = 0;
 	pernet->local_addr_max = 0;
 	pernet->addrs = 0;
 }
Signature · 12 lines
2.47.3




Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597
Reviewed-by on v1 1/1
#1 lore raw

Hi Maximilian,

Quoted 20 lines · Maximilian

From: "Matthieu Baerts (NGI0)" <[email protected]>

commit 68fc0f4b0d25692940cdc85c68e366cae63e1757 upstream.

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.

Quoted 7 lines

[adjusted patch by removing WRITE_ONCE to take into account the missing
commit 72603d207d59 ("mptcp: use WRITE_ONCE for the pernet *_max")]

---
For some reason only the corresponding selftest patch was backported and it's now failing on 5.10 kernels. I tested that with this patch the selftest is succeeding again.

Thank you for this backport. It looks good to me!

I was waiting for the FAILED notification for this patch before adapting it for v5.10, but it looks like I never got it, see:

https://lore.kernel.org/[email protected]

No problem, that was not critical, and we now have a fix :)

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.
#2 lore raw
In reply to Heyne, Maximilian

Hi Max,

I'm not responsible for net/mptcp/pm_netlink.c nor can I be found in git blame of that file.

Why did you send this patch to me and having all the relevant persons in CC?

Best regards,
Oliver

Quoted 43 lines · Maximilian

From: "Matthieu Baerts (NGI0)" <[email protected]>

commit 68fc0f4b0d25692940cdc85c68e366cae63e1757 upstream.

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.

[adjusted patch by removing WRITE_ONCE to take into account the missing
commit 72603d207d59 ("mptcp: use WRITE_ONCE for the pernet *_max")]

---
For some reason only the corresponding selftest patch was backported and it's now failing on 5.10 kernels. I tested that with this patch the selftest is succeeding again.

---
  net/mptcp/pm_netlink.c | 1 -
  1 file changed, 1 deletion(-)
net/mptcp/pm_netlink.c +0 -1
index 32379fc706cac..c31a1dc69f835 100644
@@ -869,7 +869,6 @@ static void __flush_addrs(struct pm_nl_pernet *pernet)
  static void __reset_counters(struct pm_nl_pernet *pernet)
  {
  	pernet->add_addr_signal_max = 0;
-	pernet->add_addr_accept_max = 0;
  	pernet->local_addr_max = 0;
  	pernet->addrs = 0;
  }
#3 lore raw
Quoted 6 lines · Oliver Hartkopp

Hi Max,

I'm not responsible for net/mptcp/pm_netlink.c nor can I be found in git blame of that file.

Why did you send this patch to me and having all the relevant persons in CC?

Hi Oliver,

I don't see your email address in the CC list of my patch. Did you get this mail via some list maybe? To be explicit, I have used the following command to send the mail:

  git send-email --cc-cmd "./scripts/get_maintainer.pl --norolestats 0001-mptcp-pm-kernel-flush-do-not-reset-ADD_ADDR-limit.patch" 0001-mptcp-pm-kernel-flush-do-not-reset-ADD_ADDR-limit.patch

This uses the get_maintainer.pl from the 5.10 tree though.

Regards,
Maximilian

Quoted 36 lines

Best regards,
Oliver

Quoted 31 lines · Maximilian

From: "Matthieu Baerts (NGI0)" <[email protected]>

commit 68fc0f4b0d25692940cdc85c68e366cae63e1757 upstream.

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.

[adjusted patch by removing WRITE_ONCE to take into account the missing
commit 72603d207d59 ("mptcp: use WRITE_ONCE for the pernet *_max")]

---
For some reason only the corresponding selftest patch was backported and it's now failing on 5.10 kernels. I tested that with this patch the selftest is succeeding again.

---
  net/mptcp/pm_netlink.c | 1 -
  1 file changed, 1 deletion(-)
Quoted 13 lines

net/mptcp/pm_netlink.c static void __flush_addrs(struct pm_nl_pernet *pernet) · line 874

Quoted 12 lines
net/mptcp/pm_netlink.c +0 -1
index 32379fc706cac..c31a1dc69f835 100644
@@ -869,7 +869,6 @@ static void __flush_addrs(struct pm_nl_pernet *pernet)
  static void __reset_counters(struct pm_nl_pernet *pernet)
  {
  	pernet->add_addr_signal_max = 0;
-	pernet->add_addr_accept_max = 0;
  	pernet->local_addr_max = 0;
  	pernet->addrs = 0;
  }

Amazon Web Services Development Center Germany GmbH Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597