Skip to contentSkip to conversation

mptcp: skip to next candidate if subflow has unacked data

PATCH In review Florian Westphal 3 participants 4 messages Oct 1, 2020 – Oct 17, 2020

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author
#0 lore raw

PATCH 1/1 mptcp: skip to next candidate if subflow has unacked data

In case a subflow path is blocked, MPTCP-level retransmit may not take place anymore because such subflow is likely to have unacked data left in its write queue.

Ignore subflows that have experienced loss and test next candidate.

Fixes 3b1d6210a95773691 ("mptcp: implement and use MPTCP-level retransmission")
Signed-off-by Florian Westphal <fw(a)strlen.de>
---
 net/mptcp/protocol.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/mptcp/protocol.c +4 -1
index 7aa52a3bc5e2..0266d8ac24d2 100644
@@ -1732,8 +1732,11 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk)
 			continue;
 
 		/* still data outstanding at TCP level?  Don't retransmit. */
-		if (!tcp_write_queue_empty(ssk))
+		if (!tcp_write_queue_empty(ssk)) {
+			if (inet_csk(ssk)->icsk_ca_state >= TCP_CA_Loss)
+				continue;
 			return NULL;
+		}
 
 		if (subflow->backup) {
 			if (!backup)
Signature · 1 line
2.26.2
#1 lore raw
Quoted 31 lines · Florian Westphal

In case a subflow path is blocked, MPTCP-level retransmit may not take place anymore because such subflow is likely to have unacked data left in its write queue.

Ignore subflows that have experienced loss and test next candidate.

Fixes 3b1d6210a95773691 ("mptcp: implement and use MPTCP-level retransmission")
Signed-off-by Florian Westphal <fw(a)strlen.de>

---
net/mptcp/protocol.c | 5 ++++-

1 file changed, 4 insertions(+), 1 deletion(-)
net/mptcp/protocol.c +4 -1
index 7aa52a3bc5e2..0266d8ac24d2 100644
@@ -1732,8 +1732,11 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk)
 			continue;
 
 		/* still data outstanding at TCP level?  Don't retransmit. */
-		if (!tcp_write_queue_empty(ssk))
+		if (!tcp_write_queue_empty(ssk)) {
+			if (inet_csk(ssk)->icsk_ca_state >= TCP_CA_Loss)
+				continue;
 			return NULL;
+		}
 
 		if (subflow->backup) {
 			if (!backup)
Signature · 1 line
2.26.2

Checking for the loss state is an improvement when the first subflow in the list is blocking retransmissions, looks like a good idea to me.

We can still get inconsistent retransmission behavior depending on the order of subflows in the list - if the first non-loss subflow has an empty write queue then retransmission will happen even if other subflows have queued data. I suppose this causes the opposite problem, retransmitting when it should wait. Better to handle a fix for that separately?

--
Mat Martineau
Intel

author
#2 lore raw
Quoted 5 lines · Mat Martineau

We can still get inconsistent retransmission behavior depending on the order of subflows in the list - if the first non-loss subflow has an empty write queue then retransmission will happen even if other subflows have queued data. I suppose this causes the opposite problem, retransmitting when it should wait. Better to handle a fix for that separately?

Yes, if we observe too many bogus retransmits then the mptcp-level retransmit timer is firing too early, i'd say thats a different bug.

#3 lore raw
In reply to Florian Westphal

Hi Florian, Mat,

Quoted 5 lines · Florian Westphal

In case a subflow path is blocked, MPTCP-level retransmit may not take place anymore because such subflow is likely to have unacked data left in its write queue.

Ignore subflows that have experienced loss and test next candidate.

Thank you for the patch and the review!

Just applied with Mat's Reviewed-by.

- 15321713bc1f: mptcp: skip to next candidate if subflow has unacked data
- Results: 3fd01a5ab17b..0e70ef7be280

Tests and export will be started soon!

Cheers,
Matt

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