mptcp: only wake parent if subflow is writable
Subsystems (2)
Florian Westphal
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.
--- net/mptcp/subflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/subflow.c +1 -1
@@ -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
Matthieu Baerts
Hi Florian, Mat,
Quoted 11 lines · Florian Westphal
mptcp_connect.sh-d 10 -l 0 -r 0 -e "" -f $((100 * 1024 * 1024)) -m pollwill result in frequent write errors:
ns1 MPTCP -> ns3 (10.0.2.2:10010 ) MPTCP write: Resource temporarily unavailableWe 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 ) MPTCPcopyfd_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