Change IPPROTO_MPTCP
Subsystems (3)
Mat Martineau
cover Change IPPROTO_MPTCP
Instead of using 99 for IPPROTO_MPTCP (which IANA defines as "any private encryption scheme"), use 262 (0x100 | IPPROTO_TCP). The MPTCP self tests continue to run successfully with these changes.
Earlier in development we used 262 for IPPROTO_SUBFLOW as it would get truncated to 0x06 (IPPROTO_TCP) in the IP header. Now that IPPROTO_SUBFLOW has been removed in favor of using ULP, 262 is freed up for MPTCP.
Note that this does change the value of IPPROTO_MAX, and in reviewing the occurrences of that around the kernel most uses look fine. net/sunrpc/xprtrdma/svc_rdma_recvfrom.c has one instance of IPPROTO_MAX where its meaning is not immediately obvious.
Mat Martineau (2):
squash-to: Define IPPROTO_MPTCP
squash-to: add basic kselftest program
include/uapi/linux/in.h | 4 ++-- tools/include/uapi/linux/in.h | 2 ++ tools/testing/selftests/net/mptcp/mptcp_connect.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.22.0
Mat Martineau
PATCH 1/2 squash-to: Define IPPROTO_MPTCP
--- include/uapi/linux/in.h | 4 ++-- tools/include/uapi/linux/in.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)
include/uapi/linux/in.h +2 -2
@@ -64,8 +64,6 @@ enum {#define IPPROTO_BEETPH IPPROTO_BEETPH IPPROTO_ENCAP = 98, /* Encapsulation Header */#define IPPROTO_ENCAP IPPROTO_ENCAP - IPPROTO_MPTCP = 99, /* Multipath TCP connection */ -#define IPPROTO_MPTCP IPPROTO_MPTCP IPPROTO_PIM = 103, /* Protocol Independent Multicast */#define IPPROTO_PIM IPPROTO_PIM IPPROTO_COMP = 108, /* Compression Header Protocol */
@@ -78,6 +76,8 @@ enum {#define IPPROTO_MPLS IPPROTO_MPLS IPPROTO_RAW = 255, /* Raw IP packets */#define IPPROTO_RAW IPPROTO_RAW + IPPROTO_MPTCP = 262, /* Multipath TCP connection */ +#define IPPROTO_MPTCP IPPROTO_MPTCPIPPROTO_MAX };#endif
tools/include/uapi/linux/in.h +2 -0
@@ -76,6 +76,8 @@ enum {#define IPPROTO_MPLS IPPROTO_MPLS IPPROTO_RAW = 255, /* Raw IP packets */#define IPPROTO_RAW IPPROTO_RAW + IPPROTO_MPTCP = 262, /* Multipath TCP connection */ +#define IPPROTO_MPTCP IPPROTO_MPTCPIPPROTO_MAX };#endif
Signature · 1 line
2.22.0
Viet-Hoang Tran
Re: [MPTCP] [PATCH 1/2] squash-to: Define IPPROTO_MPTCP
Maybe I am concerned about the wrong thing but when looking at sockopt levels defined in include/linux/socket.h,
there is an entry of the same value 262 assigned to X25:
/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */ #define SOL_IP 0
/* #define SOL_ICMP 1 No-no-no! Due to Linux :-) we cannot use SOL_ICMP=1 */ #define SOL_TCP 6
#define SOL_UDP 17
...
#define SOL_X25 262
...
I don't know if it has any issue or implication though.
Hoang
Quoted 49 lines · Mat Martineau
Signed-off-by Mat Martineau <mathew.j.martineau(a)linux.intel.com>--- include/uapi/linux/in.h | 4 ++-- tools/include/uapi/linux/in.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)include/uapi/linux/in.h +2
-2@@ -64,8 +64,6 @@ enum {#define IPPROTO_BEETPH IPPROTO_BEETPH IPPROTO_ENCAP = 98, /* Encapsulation Header */#define IPPROTO_ENCAP IPPROTO_ENCAP - IPPROTO_MPTCP = 99, /* Multipath TCP connection */ -#define IPPROTO_MPTCP IPPROTO_MPTCP IPPROTO_PIM = 103, /* Protocol Independent Multicast */#define IPPROTO_PIM IPPROTO_PIM IPPROTO_COMP = 108, /* Compression Header Protocol */@@ -78,6 +76,8 @@ enum {#define IPPROTO_MPLS IPPROTO_MPLS IPPROTO_RAW = 255, /* Raw IP packets */#define IPPROTO_RAW IPPROTO_RAW + IPPROTO_MPTCP = 262, /* Multipath TCP connection */ +#define IPPROTO_MPTCP IPPROTO_MPTCPIPPROTO_MAX };#endif tools/include/uapi/linux/in.h +2
-1@@ -76,6 +76,8 @@ enum {#define IPPROTO_MPLS IPPROTO_MPLS IPPROTO_RAW = 255, /* Raw IP packets */#define IPPROTO_RAW IPPROTO_RAW + IPPROTO_MPTCP = 262, /* Multipath TCP connection */ +#define IPPROTO_MPTCP IPPROTO_MPTCPIPPROTO_MAX };#endif --2.22.0
_______________________________________________
mptcp mailing list
mptcp(a)lists.01.org
https://lists.01.org/mailman/listinfo/mptcp
Mat Martineau
Re: [MPTCP] [PATCH 1/2] squash-to: Define IPPROTO_MPTCP
Quoted 13 lines · Viet-Hoang Tran
Maybe I am concerned about the wrong thing but when looking at sockopt levels defined in include/linux/socket.h,there is an entry of the same value 262 assigned to X25:
/* Setsockoptions(2) level. Thanks to BSD these must match
IPPROTO_xxx*/ #defineSOL_IP0
/* #defineSOL_ICMP1 No-no-no! Due to Linux :-) we cannot use SOL_ICMP=1 */ #defineSOL_TCP6
#defineSOL_UDP17
...
#defineSOL_X25262
...
Quoted 1 line
I don't know if it has any issue or implication though.
Hello Hoang -
Thanks for noticing this. We'll probably define SOL_MPTCP at some point, so there's also the question of matching values for SOL_MPTCP and IPPROTO_MPTCP.
Other than changing sock->sk_protocol to 16 bits (which I posted on Friday), it seems like the main effect of choosing a larger integer for IPPROTO_MPTCP is increasing IPPROTO_MAX. That, in turn, increases a handful of array sizes:
- inet_diag_table
- xfrm4_state_afinfo (two arrays for type maps)
- xfrm6_state_afinfo (two arrays for type maps)
Maybe that's not a big deal, they're already fairly sparse arrays that trade space for speed.
At least it's easy to change for now!
Mat
Quoted 41 lines · Mat Martineau
Signed-off-by: Mat Martineau <mathew.j.martineau(a)linux.intel.com>
---
include/uapi/linux/in.h | 4 ++--
tools/include/uapi/linux/in.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h
index 649d8cd41b80..44df6dc1ff1d 100644
--- a/include/uapi/linux/in.h
+++ b/include/uapi/linux/in.h
@@ -64,8 +64,6 @@ enum {
#define IPPROTO_BEETPH IPPROTO_BEETPH
IPPROTO_ENCAP = 98, /* Encapsulation Header */
#define IPPROTO_ENCAP IPPROTO_ENCAP
- IPPROTO_MPTCP = 99, /* Multipath TCP connection */
-#define IPPROTO_MPTCP IPPROTO_MPTCP
IPPROTO_PIM = 103, /* Protocol Independent Multicast */
#define IPPROTO_PIM IPPROTO_PIM
IPPROTO_COMP = 108, /* Compression Header Protocol */
@@ -78,6 +76,8 @@ enum {
#define IPPROTO_MPLS IPPROTO_MPLS
IPPROTO_RAW = 255, /* Raw IP packets */
#define IPPROTO_RAW IPPROTO_RAW
+ IPPROTO_MPTCP = 262, /* Multipath TCP connection */
+#define IPPROTO_MPTCP IPPROTO_MPTCP
IPPROTO_MAX
};
#endif
diff --git a/tools/include/uapi/linux/in.h b/tools/include/uapi/linux/in.h
index e7ad9d350a28..44df6dc1ff1d 100644
--- a/tools/include/uapi/linux/in.h
+++ b/tools/include/uapi/linux/in.h
@@ -76,6 +76,8 @@ enum {
#define IPPROTO_MPLS IPPROTO_MPLS
IPPROTO_RAW = 255, /* Raw IP packets */
#define IPPROTO_RAW IPPROTO_RAW
+ IPPROTO_MPTCP = 262, /* Multipath TCP connection */
+#define IPPROTO_MPTCP IPPROTO_MPTCP
IPPROTO_MAX
};Quoted 11 lines
#endif
--
2.22.0
_______________________________________________
mptcp mailing list
mptcp(a)lists.01.org
https://lists.01.org/mailman/listinfo/mptcp--
Mat Martineau
Intel
Mat Martineau
PATCH 2/2 squash-to: add basic kselftest program
In reply to Mat Martineau--- tools/testing/selftests/net/mptcp/mptcp_connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/mptcp/mptcp_connect.c +1 -1
@@ -23,7 +23,7 @@extern int optind;#ifndef IPPROTO_MPTCP -#define IPPROTO_MPTCP 99 +#define IPPROTO_MPTCP 262#endif static bool listen_mode;
Signature · 1 line
2.22.0
Matthieu Baerts
Hi Mat,
Quoted 9 lines · Mat Martineau
Instead of using 99 for
IPPROTO_MPTCP(which IANA defines as "any private encryption scheme"), use 262 (0x100|IPPROTO_TCP). The MPTCP self tests continue to run successfully with these changes.Earlier in development we used 262 for
IPPROTO_SUBFLOWas it would get truncated to0x06(IPPROTO_TCP) in the IP header. Now thatIPPROTO_SUBFLOWhas been removed in favor of using ULP, 262 is freed up for MPTCP.
Quoted 8 lines
Note that this does change the value of
IPPROTO_MAX, and in reviewing the occurrences of that around the kernel most uses look fine.net/sunrpc/xprtrdma/svc_rdma_recvfrom.chas one instance ofIPPROTO_MAXwhere its meaning is not immediately obvious.Mat Martineau (2):
squash-to: DefineIPPROTO_MPTCP
squash-to: add basic kselftest program
Thank you for the patch.
- b2727bb697b3: "squash" of the first patch in "tcp: Define IPPROTO_MPTCP"
- signed-off was already there
- e993d4b99859: "squash" of the second patch in "mptcp: add basic kselftest program"
- no conflict
- d44c2b144d8a..532214a3e83e: result
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