Skip to contentSkip to conversation

Move MPTCP #defines to internal header

PATCH In review Peter Krystad 3 participants 7 messages Jun 13, 2019 – Jun 14, 2019

Subsystems (3)
lore
Share & tools
lore

Peter Krystad

author
#0 lore raw

cover Move MPTCP #defines to internal header

Like it says...

Peter Krystad (4):
mptcp: Move TCPOLEN #defines to protocol.h
mptcp: Move TCPOLEN #defines to protocol.h
mptcp: Move TCPOLEN #defines to protocol.h
mptcp: make flag field naming consistent

 include/net/tcp.h    |  9 ---------
 net/mptcp/options.c  |  4 ++--
 net/mptcp/protocol.h | 16 +++++++++++++---
 3 files changed, 15 insertions(+), 14 deletions(-)
Signature · 1 line
2.17.2
author
#1 lore raw

PATCH 1/4 mptcp: Move TCPOLEN #defines to protocol.h

squashto: Handle MPTCP TCP options

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 include/net/tcp.h    | 3 ---
 net/mptcp/protocol.h | 5 +++++
 2 files changed, 5 insertions(+), 3 deletions(-)
include/net/tcp.h +0 -3
index 80f6955add88..bea4a8416974 100644
@@ -212,9 +212,6 @@ void tcp_time_wait(struct sock *sk, int state, int timeo);
 #define TCPOLEN_MD5SIG_ALIGNED		20
 #define TCPOLEN_MSS_ALIGNED		4
 #define TCPOLEN_EXP_SMC_BASE_ALIGNED	8
-#define TCPOLEN_MPTCP_MPC_SYN		12
-#define TCPOLEN_MPTCP_MPC_SYNACK	20
-#define TCPOLEN_MPTCP_MPC_ACK		20
 #define TCPOLEN_MPTCP_DSS_BASE		4
 #define TCPOLEN_MPTCP_DSS_ACK32		4
 #define TCPOLEN_MPTCP_DSS_ACK64		8
net/mptcp/protocol.h +5 -0
index a4f0e7d3bd62..040aaa1011c6 100644
@@ -20,6 +20,11 @@
 #define MPTCPOPT_MP_FAIL	6
 #define MPTCPOPT_MP_FASTCLOSE	7
 
+/* MPTCP suboption lengths */
+#define TCPOLEN_MPTCP_MPC_SYN		12
+#define TCPOLEN_MPTCP_MPC_SYNACK	20
+#define TCPOLEN_MPTCP_MPC_ACK		20
+
 #define MPTCPOPT_VERSION_MASK	0x0F
 
 /* MPTCP handshake flags */
Signature · 1 line
2.17.2
author
#2 lore raw

PATCH 2/4 mptcp: Move TCPOLEN #defines to protocol.h

In reply to Peter Krystad

squashto: Write MTPCP DSS headers....

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 include/net/tcp.h    | 4 ----
 net/mptcp/protocol.h | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
include/net/tcp.h +0 -4
index bea4a8416974..ca4b799f4604 100644
@@ -212,12 +212,8 @@ void tcp_time_wait(struct sock *sk, int state, int timeo);
 #define TCPOLEN_MD5SIG_ALIGNED		20
 #define TCPOLEN_MSS_ALIGNED		4
 #define TCPOLEN_EXP_SMC_BASE_ALIGNED	8
-#define TCPOLEN_MPTCP_DSS_BASE		4
 #define TCPOLEN_MPTCP_DSS_ACK32		4
-#define TCPOLEN_MPTCP_DSS_ACK64		8
 #define TCPOLEN_MPTCP_DSS_MAP32		10
-#define TCPOLEN_MPTCP_DSS_MAP64		14
-#define TCPOLEN_MPTCP_DSS_CHECKSUM	2
 
 /* Flags in tp->nonagle */
 #define TCP_NAGLE_OFF		1	/* Nagle's algo is disabled */
net/mptcp/protocol.h +4 -0
index 040aaa1011c6..f4c69acc3ca5 100644
@@ -24,6 +24,10 @@
 #define TCPOLEN_MPTCP_MPC_SYN		12
 #define TCPOLEN_MPTCP_MPC_SYNACK	20
 #define TCPOLEN_MPTCP_MPC_ACK		20
+#define TCPOLEN_MPTCP_DSS_BASE		4
+#define TCPOLEN_MPTCP_DSS_ACK64		8
+#define TCPOLEN_MPTCP_DSS_MAP64		14
+#define TCPOLEN_MPTCP_DSS_CHECKSUM	2
 
 #define MPTCPOPT_VERSION_MASK	0x0F
 
Signature · 1 line
2.17.2
author
#3 lore raw

PATCH 3/4 mptcp: Move TCPOLEN #defines to protocol.h

In reply to Peter Krystad

squashto: Implement MTPCP receive path

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 include/net/tcp.h    | 2 --
 net/mptcp/protocol.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/tcp.h +0 -2
index ca4b799f4604..ef93bb4cb733 100644
@@ -212,8 +212,6 @@ void tcp_time_wait(struct sock *sk, int state, int timeo);
 #define TCPOLEN_MD5SIG_ALIGNED		20
 #define TCPOLEN_MSS_ALIGNED		4
 #define TCPOLEN_EXP_SMC_BASE_ALIGNED	8
-#define TCPOLEN_MPTCP_DSS_ACK32		4
-#define TCPOLEN_MPTCP_DSS_MAP32		10
 
 /* Flags in tp->nonagle */
 #define TCP_NAGLE_OFF		1	/* Nagle's algo is disabled */
net/mptcp/protocol.h +2 -0
index f4c69acc3ca5..2393d2194d28 100644
@@ -25,7 +25,9 @@
 #define TCPOLEN_MPTCP_MPC_SYNACK	20
 #define TCPOLEN_MPTCP_MPC_ACK		20
 #define TCPOLEN_MPTCP_DSS_BASE		4
+#define TCPOLEN_MPTCP_DSS_ACK32		4
 #define TCPOLEN_MPTCP_DSS_ACK64		8
+#define TCPOLEN_MPTCP_DSS_MAP32		10
 #define TCPOLEN_MPTCP_DSS_MAP64		14
 #define TCPOLEN_MPTCP_DSS_CHECKSUM	2
 
Signature · 1 line
2.17.2
author
#4 lore raw

PATCH 4/4 mptcp: make flag field naming consistent

In reply to Peter Krystad

squashto: Handle MPTCP TCP options

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/options.c  | 4 ++--
 net/mptcp/protocol.h | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)
net/mptcp/options.c +2 -2
index d285a33cd480..984de1edd946 100644
@@ -29,7 +29,7 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize,
 		    opsize != TCPOLEN_MPTCP_MPC_SYNACK)
 			break;
 
-		mp_opt->version = *ptr++ & MPTCPOPT_VERSION_MASK;
+		mp_opt->version = *ptr++ & MPTCP_VERSION_MASK;
 		if (mp_opt->version != 0)
 			break;
 
@@ -430,7 +430,7 @@ void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts)
 
 		*ptr++ = htonl((TCPOPT_MPTCP << 24) | (len << 16) |
 			       (MPTCPOPT_MP_CAPABLE << 12) |
-			       ((MPTCPOPT_VERSION_MASK & 0) << 8) |
+			       ((MPTCP_VERSION_MASK & 0) << 8) |
 			       MPTCP_CAP_HMAC_SHA1);
 		put_unaligned_be64(opts->sndr_key, ptr);
 		ptr += 2;
net/mptcp/protocol.h +2 -3
index 2393d2194d28..3200dc63577b 100644
@@ -31,9 +31,8 @@
 #define TCPOLEN_MPTCP_DSS_MAP64		14
 #define TCPOLEN_MPTCP_DSS_CHECKSUM	2
 
-#define MPTCPOPT_VERSION_MASK	0x0F
-
-/* MPTCP handshake flags */
+/* MPTCP MP_CAPABLE flags */
+#define MPTCP_VERSION_MASK	(0x0F)
 #define MPTCP_CAP_CHECKSUM_REQD	BIT(7)
 #define MPTCP_CAP_EXTENSIBILITY	BIT(6)
 #define MPTCP_CAP_HMAC_SHA1	BIT(0)
Signature · 1 line
2.17.2
#5 lore raw
In reply to Peter Krystad

Hi,

Quoted 8 lines · Peter Krystad

Like it says...

Peter Krystad (4):
mptcp: Move TCPOLEN #defines to protocol.h
mptcp: Move TCPOLEN #defines to protocol.h
mptcp: Move TCPOLEN #defines to protocol.h
mptcp: make flag field naming consistent

Quoted 4 lines
 include/net/tcp.h    |  9 ---------
 net/mptcp/options.c  |  4 ++--
 net/mptcp/protocol.h | 16 +++++++++++++---
 3 files changed, 15 insertions(+), 14 deletions(-)

Thank you for following-up so fastly! I like how you split the changes to hopefully simplify the merge.

LGTM,

Thanks!

Paolo

#6 lore raw
In reply to Peter Krystad

Hi Peter, Paolo,

Quoted 7 lines · Peter Krystad

Like it says...

Peter Krystad (4):
mptcp: Move TCPOLEN #defines to protocol.h
mptcp: Move TCPOLEN #defines to protocol.h
mptcp: Move TCPOLEN #defines to protocol.h
mptcp: make flag field naming consistent

Thank you for the patches and the review!

1)
- 04315cde541a: "squash" in "mptcp: Handle MPTCP TCP options" (with a
small conflict)
- 24d7971f53d8: conflict
- 952528707b4d: conflict
2)
- c8bd7a330237: "squash" in "mptcp: Write MPTCP DSS headers to
outgoing data packets"
- 7f26de3a2add: conflict
3)
- cd98bf4f67da: "squash" in "mptcp: Implement MPTCP receive path"
- no conflict
4)
- c7a47030a18b: "squash" in "mptcp: Handle MPTCP TCP options"
- no conflict

9ff7aba894d0..f9b94b899a7f: result

All signed-off were already there.
Tests are all OK.

Cheers,
Matt

Signature · 5 lines
Matthieu Baerts | R&D Engineer
matthieu.baerts(a)tessares.net
Tessares SA | Hybrid Access Solutions
www.tessares.net
1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium