mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Yonglong Li <liyonglong@chinatelecom.cn>
To: mptcp@lists.linux.dev, mptcp@lists.01.org
Cc: mathew.j.martineau@linux.intel.com, matthieu.baerts@tessares.net,
	fw@strlen.de, pabeni@redhat.com,
	Yonglong Li <liyonglong@chinatelecom.cn>
Subject: [PATCH v2] mptcp: ensure there is unacked data at all subflow
Date: Thu,  1 Apr 2021 14:34:50 +0800	[thread overview]
Message-ID: <1617258890-11776-1-git-send-email-liyonglong@chinatelecom.cn> (raw)

MPTCP-level retransmit may take place if first subflow
without data in its write queue and second subflow is likely to
have unacked data left in its write queue. In this condition data
maybe double retransmited.

Signed-off-by: Yonglong Li <liyonglong@chinatelecom.cn>
---
 net/mptcp/protocol.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 9d7e7e1..66707ab 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2072,6 +2072,7 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk)
 {
 	struct mptcp_subflow_context *subflow;
 	struct sock *backup = NULL;
+	struct sock *idle = NULL;
 
 	sock_owned_by_me((const struct sock *)msk);
 
@@ -2097,10 +2098,11 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk)
 			continue;
 		}
 
-		return ssk;
+		if (!idle)
+			idle = ssk;
 	}
 
-	return backup;
+	return idle ? : backup;
 }
 
 static void mptcp_dispose_initial_subflow(struct mptcp_sock *msk)
-- 
1.8.3.1


             reply	other threads:[~2021-04-01  6:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  6:34 Yonglong Li [this message]
2021-04-01  7:28 ` [PATCH v2] mptcp: ensure there is unacked data at all subflow Geliang Tang
2021-04-01  7:49   ` Yonglong Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1617258890-11776-1-git-send-email-liyonglong@chinatelecom.cn \
    --to=liyonglong@chinatelecom.cn \
    --cc=fw@strlen.de \
    --cc=mathew.j.martineau@linux.intel.com \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.01.org \
    --cc=mptcp@lists.linux.dev \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).