* [MPTCP] [PATCH] mptcp: Store 32 and 64-bit ACKs separately
@ 2020-01-16 1:13 Peter Krystad
0 siblings, 0 replies; only message in thread
From: Peter Krystad @ 2020-01-16 1:13 UTC (permalink / raw)
To: mptcp
[-- 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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-16 1:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-16 1:13 [MPTCP] [PATCH] mptcp: Store 32 and 64-bit ACKs separately Peter Krystad
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.