MPTCP Linux Development
 help / color / mirror / Atom feed
* [MPTCP] [PATCH mptcp 1/3] mptcp: schedule worker when subflow is closed
@ 2021-02-02 17:47 Florian Westphal
  0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2021-02-02 17:47 UTC (permalink / raw)
  To: mptcp 

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

When remote side closes a subflow we should schedule the worker to
dispose of the subflow in a timely manner.

Otherwise, SF_CLOSED event won't be generated until the mptcp
socket itself is closing or local side is closing another subflow.

Signed-off-by: Florian Westphal <fw(a)strlen.de>
---
 net/mptcp/subflow.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index b8b670cb6116..57f6361eb07c 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1413,6 +1413,13 @@ static void subflow_state_change(struct sock *sk)
 	if (mptcp_subflow_data_available(sk))
 		mptcp_data_ready(parent, sk);
 
+	if (sk->sk_state == TCP_CLOSE &&
+	    !test_and_set_bit(MPTCP_WORK_CLOSE_SUBFLOW, &mptcp_sk(parent)->flags)) {
+		sock_hold(parent);
+		if (!schedule_work(&mptcp_sk(parent)->work))
+			sock_put(parent);
+	}
+
 	if (__mptcp_check_fallback(mptcp_sk(parent)) &&
 	    !subflow->rx_eof && subflow_is_done(sk)) {
 		subflow->rx_eof = 1;
-- 
2.26.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-02 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-02 17:47 [MPTCP] [PATCH mptcp 1/3] mptcp: schedule worker when subflow is closed Florian Westphal

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