All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Krystad <peter.krystad at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] [PATCH] mptcp: Store 32 and 64-bit ACKs separately
Date: Wed, 15 Jan 2020 17:13:09 -0800	[thread overview]
Message-ID: <20200116011309.3202-1-peter.krystad@linux.intel.com> (raw)

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

Will be useful optimizing struct mptcp_options_received.

squashto: Implement MPTCP receive path

Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
---
 include/linux/tcp.h |  2 ++
 net/mptcp/options.c | 24 ++++++++++++++++--------
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 0d00dad4b85d..6abf8d9f1a42 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -82,6 +82,8 @@ struct tcp_sack_block {
 struct mptcp_options_received {
 	u64	sndr_key;
 	u64	rcvr_key;
+	u32	data_ack32;
+	u32	data_seq32;
 	u64	data_ack;
 	u64	data_seq;
 	u32	subflow_seq;
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index db224e050666..b7f1892d8320 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -142,21 +142,23 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize,
 		if (mp_opt->use_ack) {
 			if (mp_opt->ack64) {
 				mp_opt->data_ack = get_unaligned_be64(ptr);
+				pr_debug("data_ack=%llu", mp_opt->data_ack);
 				ptr += 8;
 			} else {
-				mp_opt->data_ack = get_unaligned_be32(ptr);
+				mp_opt->data_ack32 = get_unaligned_be32(ptr);
+				pr_debug("data_ack32=%u", mp_opt->data_ack32);
 				ptr += 4;
 			}
-
-			pr_debug("data_ack=%llu", mp_opt->data_ack);
 		}
 
 		if (mp_opt->use_map) {
 			if (mp_opt->dsn64) {
 				mp_opt->data_seq = get_unaligned_be64(ptr);
+				pr_debug("data_seq=%llu", mp_opt->data_seq);
 				ptr += 8;
 			} else {
-				mp_opt->data_seq = get_unaligned_be32(ptr);
+				mp_opt->data_seq32 = get_unaligned_be32(ptr);
+				pr_debug("data_seq32=%u", mp_opt->data_seq32);
 				ptr += 4;
 			}
 
@@ -166,9 +168,8 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize,
 			mp_opt->data_len = get_unaligned_be16(ptr);
 			ptr += 2;
 
-			pr_debug("data_seq=%llu subflow_seq=%u data_len=%u",
-				 mp_opt->data_seq, mp_opt->subflow_seq,
-				 mp_opt->data_len);
+			pr_debug("subflow_seq=%u data_len=%u",
+				 mp_opt->subflow_seq, mp_opt->data_len);
 		}
 
 		break;
@@ -428,7 +429,10 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb,
 	memset(mpext, 0, sizeof(*mpext));
 
 	if (mp_opt->use_map) {
-		mpext->data_seq = mp_opt->data_seq;
+		if (mp_opt->dsn64)
+			mpext->data_seq = mp_opt->data_seq;
+		else
+			mpext->data_seq = mp_opt->data_seq32;
 		mpext->subflow_seq = mp_opt->subflow_seq;
 		mpext->data_len = mp_opt->data_len;
 		mpext->use_map = 1;
@@ -436,6 +440,10 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb,
 	}
 
 	if (mp_opt->use_ack) {
+		if (mp_opt->ack64)
+			mpext->data_ack = mp_opt->data_ack;
+		else
+			mpext->data_ack = mp_opt->data_ack32;
 		mpext->data_ack = mp_opt->data_ack;
 		mpext->use_ack = 1;
 		mpext->ack64 = mp_opt->ack64;
-- 
2.17.2

                 reply	other threads:[~2020-01-16  1:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200116011309.3202-1-peter.krystad@linux.intel.com \
    --to=unknown@example.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 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.