All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [RFC PATCH 4/6] options: ack pending sequence
@ 2019-11-08 22:09 Florian Westphal
  0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2019-11-08 22:09 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

This allows us to include some of the bytes already pending on the subflow
in the DSS ack instead of having to wait for the next recv (which
updates msk->ack_seq value).

Signed-off-by: Florian Westphal <fw(a)strlen.de>
---
 net/mptcp/options.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 80dbe7662cea..b488bf07ada5 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -418,13 +418,20 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
 		ack_size += TCPOLEN_MPTCP_DSS_BASE;
 
 	if (ack_size <= remaining) {
+		const struct mptcp_subflow_context *subflow;
 		struct mptcp_sock *msk;
 
 		dss_size += ack_size;
 
-		msk = mptcp_sk(mptcp_subflow_ctx(sk)->conn);
+		subflow = mptcp_subflow_ctx(sk);
+		msk = mptcp_sk(subflow->conn);
 		if (msk) {
-			opts->ext_copy.data_ack = msk->ack_seq;
+			u64 ack_seq = READ_ONCE(msk->ack_seq);
+
+			if (subflow->map_valid)
+				ack_seq += subflow->data_avail;
+
+			opts->ext_copy.data_ack = ack_seq;
 		} else {
 			mptcp_crypto_key_sha1(mptcp_subflow_ctx(sk)->remote_key,
 					      NULL, &opts->ext_copy.data_ack);
-- 
2.23.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-08 22:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 22:09 [MPTCP] [RFC PATCH 4/6] options: ack pending sequence Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.