diff mbox series

[v2,07/13] subflow: sk_data_ready: make wakeup on tcp sock conditional

Message ID 20191118214538.21931-8-fw@strlen.de
State Accepted, archived
Delegated to: Matthieu Baerts
Headers show
Series [v2] mptcp: wmem accounting and nonblocking io support | expand

Commit Message

Florian Westphal Nov. 18, 2019, 9:45 p.m. UTC
No need for this unless we don't have a parent or the socket is not
mp capable.

Only the mptcp socket will be waiting for events.  In case the mptcp
socket connected to a tcp-only peer, we're in fallback mode and need
to wakeup the parent too.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 net/mptcp/subflow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index ff38d54392cd..976e49349276 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -646,10 +646,13 @@  static void subflow_data_ready(struct sock *sk)
 	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
 	struct sock *parent = subflow->conn;
 
-	subflow->tcp_sk_data_ready(sk);
+	if (!parent || !(subflow->mp_capable || subflow->mp_join)) {
+		subflow->tcp_sk_data_ready(sk);
 
-	if (!parent || !(subflow->mp_capable || subflow->mp_join))
+		if (parent)
+			parent->sk_data_ready(parent);
 		return;
+	}
 
 	/* always propagate the EoF */
 	if (mptcp_subflow_data_available(sk) || subflow->rx_eof) {