MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-next] mptcp: pm: drop redundant mptcp_pm_send_ack
@ 2025-04-05 14:33 Geliang Tang
  2025-04-05 15:47 ` MPTCP CI
  2025-04-10 17:38 ` Matthieu Baerts
  0 siblings, 2 replies; 4+ messages in thread
From: Geliang Tang @ 2025-04-05 14:33 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

mptcp_pm_send_ack() is called twice in __mptcp_pm_addr_send_ack(), which
makes the code a bit redundant. The first call to mptcp_pm_send_ack() when
a non-stale subflow is found in the loop can be removed. Instead, we can
break the loop to use the second mptcp_pm_send_ack().

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index be1e27ee393e..a4f9cb113018 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -225,8 +225,8 @@ void mptcp_pm_addr_send_ack(struct mptcp_sock *msk)
 	mptcp_for_each_subflow(msk, subflow) {
 		if (__mptcp_subflow_active(subflow)) {
 			if (!subflow->stale) {
-				mptcp_pm_send_ack(msk, subflow, false, false);
-				return;
+				alt = subflow;
+				break;
 			}
 
 			if (!alt)
-- 
2.43.0


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

end of thread, other threads:[~2025-04-15  3:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-05 14:33 [PATCH mptcp-next] mptcp: pm: drop redundant mptcp_pm_send_ack Geliang Tang
2025-04-05 15:47 ` MPTCP CI
2025-04-10 17:38 ` Matthieu Baerts
2025-04-15  3:44   ` Geliang Tang

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