Skip to contentSkip to conversation

mptcp: only wake parent if subflow is writable

PATCH In review Florian Westphal 2 participants 2 messages Aug 21, 2020 – Aug 28, 2020

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author
#0 lore raw

PATCH 1/1 mptcp: only wake parent if subflow is writable

mptcp_connect.sh -d 10 -l 0 -r 0 -e "" -f $((100 * 1024 * 1024)) -m poll

will result in frequent write errors:
ns1 MPTCP -> ns3 (10.0.2.2:10010 ) MPTCP write: Resource temporarily unavailable

We promised write() would not block but then no subflow was ready to accept more data.

Changing the 'free' check to 'writeable' (which checks the available space is above min thresh) makes those errors go away.

Note that there are still poll timeouts:
ns1 MPTCP -> ns2 (10.0.1.2:10006 ) MPTCP copyfd_io_poll: poll timed out (events: POLLIN 1, POLLOUT 0)
copyfd_io_poll: poll timed out (events: POLLIN 0, POLLOUT 4)

This appears unrelated, they also appear without this change.

Signed-off-by Florian Westphal <fw(a)strlen.de>
---
 net/mptcp/subflow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/subflow.c +1 -1
index 82f6d2d9e39e..3585fd63c757 100644
@@ -972,7 +972,7 @@ static void subflow_write_space(struct sock *sk)
 	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
 	struct sock *parent = subflow->conn;
 
-	if (!sk_stream_memory_free(sk))
+	if (!sk_stream_is_writeable(sk))
 		return;
 
 	WRITE_ONCE(subflow->writable, true);
Signature · 1 line
2.26.2
#1 lore raw

Hi Florian, Mat,

Quoted 11 lines · Florian Westphal

mptcp_connect.sh -d 10 -l 0 -r 0 -e "" -f $((100 * 1024 * 1024)) -m poll

will result in frequent write errors:
ns1 MPTCP -> ns3 (10.0.2.2:10010 ) MPTCP write: Resource temporarily unavailable

We promised write() would not block but then no subflow was ready to accept more data.

Changing the 'free' check to 'writeable' (which checks the available space is above min thresh) makes those errors go away.

Quoted 7 lines

Note that there are still poll timeouts:
ns1 MPTCP -> ns2 (10.0.1.2:10006 ) MPTCP copyfd_io_poll: poll timed out (events: POLLIN 1, POLLOUT 0)
copyfd_io_poll: poll timed out (events: POLLIN 0, POLLOUT 4)

This appears unrelated, they also appear without this change.

Signed-off-by Florian Westphal <fw(a)strlen.de>

Thank you for the patch and the review!

Applied at the end of the series.

Tests + export are in progress!

Cheers,
Matt

Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net