MPTCP architecture proposal for discussion
Subsystems (3)
Mat Martineau
cover MPTCP architecture proposal for discussion
Hello everyone,
Peter and I have been working on this patch set to show how how MPTCP can fit in to the Linux networking stack while using these design ideas:
* Applications opt-in to MPTCP using IPPROTO_MPTCP, regular TCP sockets are still the default. A socket created with socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP) will attempt to form a MPTCP connection. IPPROTO_MPTCP == 99 as a placeholder.
* Subflows exist within the kernel as separate sockets, owned by a MPTCP connection-level socket that is visible to userspace.
* Adds an optional area to struct sk_buff to store MPTCP metadata without increasing the size of normal sk_buffs.
* Adds the CONFIG_MPTCP option to Kconfig.
The following patches can form an MPTCP connection with the multipath-tcp.org kernel (tested with v0.94), and send DSS mappings that are accepted for the initial data packet. It is an early implementation, and I don't represent it as being upstreamable as-is or being everyone's idea of what an eventual upstream implementation will necessarily look like. It has significant limitations:
* Only one subflow is supported, no joins, and only ipv4.
* Does not support DSS checksums. Checksums must be disabled on the remote stack (for multipath-tcp.org, 'sudo sysctl -w net.mptcp.mptcp_checksum=0')
* Lots of debug statements (although they use dynamic debug and are disabled by default) and TODOs.
* The connection falls back to TCP after the first data packet because there's no MPTCP option on the ack after the handshake completes and the first data is exchanged.
* It's only been tested sending small amounts of data, and will reject system calls attempting to write more data than can fit in one mapping.
I should have an additional patch soon that handles the receive path (getting the MPTCP option up to the connection level socket to parse and handle mappings) and adds the MPTCP option to ACK packets.
Hopefully there are are some interesting concepts to discuss, and this code helps us assess how workable the above design principles are. Thanks in advance for your feedback on the benefits or drawbacks of this code, how it might be improved, or how other approaches might compare.
The patch set applies to net-next (as of commit 5d22d47b9ed96e on 2018-03-27). I have also pushed it to:
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(mptcp-proposal branch)
Mat Martineau (6):
tcp: Add MPTCP option number
tcp: Define IPPROTO_MPTCP
skbuff: Add shared control buffer
tcp: Export low-level TCP functions
mptcp: More efficient byte order handling
mptcp: Write MPTCP DSS headers to outgoing data packets
Peter Krystad (10):
mptcp: Add MPTCP socket stubs
mptcp: Handle MPTCP TCP options
tcp: Add IPPROTO_SUBFLOW
tcp: expose tcp routines and structs for MPTCP
mptcp: Create SUBFLOW socket for outgoing connections
mptcp: Create SUBFLOW socket for incoming connections
mptcp: Add key generation and token tree
mptcp: Add getname() socket operation
mptcp: Add shutdown() socket operation
mptcp: Implement setsockopt()/getsockopt()
include/linux/skbuff.h | 24 +- include/linux/tcp.h | 14 + include/net/inet_common.h | 3 + include/net/mptcp.h | 177 ++++++++++++ include/net/tcp.h | 8 + include/uapi/linux/in.h | 4 + net/Kconfig | 1 + net/Makefile | 1 + net/core/skbuff.c | 53 +++- net/ipv4/af_inet.c | 2 +- net/ipv4/tcp.c | 12 +- net/ipv4/tcp_input.c | 15 ++ net/ipv4/tcp_ipv4.c | 4 +- net/ipv4/tcp_output.c | 184 ++++++++++++- net/mptcp/Kconfig | 10 + net/mptcp/Makefile | 3 + net/mptcp/crypto.c | 209 ++++++++++++++ net/mptcp/options.c | 177 ++++++++++++ net/mptcp/protocol.c | 673 ++++++++++++++++++++++++++++++++++++++++++++++ net/mptcp/subflow.c | 351 ++++++++++++++++++++++++ net/mptcp/token.c | 222 +++++++++++++++ 21 files changed, 2121 insertions(+), 26 deletions(-) create mode 100644 include/net/mptcp.h create mode 100644 net/mptcp/Kconfig create mode 100644 net/mptcp/Makefile create mode 100644 net/mptcp/crypto.c create mode 100644 net/mptcp/options.c create mode 100644 net/mptcp/protocol.c create mode 100644 net/mptcp/subflow.c create mode 100644 net/mptcp/token.c
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 1/16 tcp: Add MPTCP option number
TCP option 30 is allocated for MPTCP by the IANA.
--- include/net/tcp.h | 1 + 1 file changed, 1 insertion(+)
include/net/tcp.h +1 -0
@@ -182,6 +182,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo);#define TCPOPT_SACK 5/* SACK Block */ #define TCPOPT_TIMESTAMP 8/* Better RTT estimations/PAWS */ #define TCPOPT_MD5SIG 19/* MD5 Signature (RFC2385) */ +#define TCPOPT_MPTCP 30/* Multipath TCP (RFC6824) */ #define TCPOPT_FASTOPEN 34/* Fast open (RFC7413) */ #define TCPOPT_EXP 254/* Experimental */ /* Magic number to be after the option value for sharing TCP
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 2/16 tcp: Define IPPROTO_MPTCP
In reply to Mat MartineauTo open a MPTCP socket with socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP), IPPROTO_MPTCP needs a value that differs from IPPROTO_TCP. The existing IPPROTO numbers mostly map directly to IANA-specified protocol numbers. MPTCP does not have a protocol number allocated because MPTCP packets use the TCP protocol number. Use private number not used OTA.
--- include/uapi/linux/in.h | 2 ++ 1 file changed, 2 insertions(+)
include/uapi/linux/in.h +2 -0
@@ -64,6 +64,8 @@ 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 */
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 3/16 mptcp: Add MPTCP socket stubs
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
Implements the infrastructure for MPTCP sockets.
MPTCP sockets open one in-kernel TCP socket per subflow. These subflow sockets are only managed by the MPTCP socket that owns them and are not visible from userspace. This commit allows a userspace program to open an MPTCP socket with:
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP);
The resulting socket is simply a wrapper around a single regular TCP socket, without any of the MPTCP protocol implemented over the wire.
--- include/net/mptcp.h | 31 ++++++++++++ net/Kconfig | 1 + net/Makefile | 1 + net/mptcp/Kconfig | 10 ++++ net/mptcp/Makefile | 3 ++ net/mptcp/protocol.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 184 insertions(+) create mode 100644 include/net/mptcp.h create mode 100644 net/mptcp/Kconfig create mode 100644 net/mptcp/Makefile create mode 100644 net/mptcp/protocol.c
include/net/mptcp.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* Multipath TCP +* +* Copyright (c) 2017, Intel Corporation. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms and conditions of the GNU General Public License, +* version 2, as published by the Free Software Foundation. +* +* This program is distributed in the hope it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +*/ + +#ifndef __NET_MPTCP_H +#define __NET_MPTCP_H + +/* MPTCP connection sock */ +struct mptcp_sock { +/* inet_connection_sock must be the first member */ +struct inet_connection_sock sk; +struct socket *subflow; +}; + +static inline struct mptcp_sock *mptcp_sk (const struct sock *sk) +{ +return (struct mptcp_sock *)sk; +} + +#endif /* __NET_MPTCP_H */
net/Kconfig +1 -0
@@ -88,6 +88,7 @@ if INET source "net/ipv4/Kconfig" source "net/ipv6/Kconfig" source "net/netlabel/Kconfig" +source "net/mptcp/Kconfig" endif # if INET
net/Makefile +1 -0
@@ -85,3 +85,4 @@ obj-y += l3mdev/ endif obj-$(CONFIG_QRTR) += qrtr/ obj-$(CONFIG_NET_NCSI) += ncsi/ +obj-$(CONFIG_MPTCP) += mptcp/
net/mptcp/Kconfig new file +10 -0
@@ -0,0 +1,10 @@ + +config MPTCP + bool "Multipath TCP" + depends on INET + ---help--- + Multipath TCP (MPTCP) connections send and receive data over multiple + subflows in order to utilize multiple network paths. Each subflow + uses the TCP protocol, and TCP options carry header information for + MPTCP. +
net/mptcp/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +obj-$(CONFIG_MPTCP) += mptcp.o + +mptcp-y := protocol.o
net/mptcp/protocol.c new file +138 -0
138 lines not on this page · raw message
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 4/16 mptcp: Handle MPTCP TCP options
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
--- include/linux/tcp.h | 14 ++++ include/net/mptcp.h | 49 ++++++++++++++ include/net/tcp.h | 2 + net/ipv4/tcp_input.c | 15 +++++ net/ipv4/tcp_output.c | 72 ++++++++++++++++++++ net/mptcp/Makefile | 2 +- net/mptcp/options.c | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 330 insertions(+), 1 deletion(-) create mode 100644 net/mptcp/options.c
include/linux/tcp.h +14 -0
@@ -104,6 +104,16 @@ struct tcp_options_received {u8 num_sacks;/* Number of SACK blocks */ u16 user_mss;/* mss requested by user in ioctl */ u16 mss_clamp;/* Maximal mss, negotiated at connection setup */ +struct { +u8 mp_capable :1 , + mp_join :1 , + dss :1 , + version :4 ; +u8 flags; +u64 sndr_key; +u64 rcvr_key; + } mptcp; + };static inline void tcp_clear_options (struct tcp_options_received *rx_opt)
@@ -113,6 +123,7 @@ static inline void tcp_clear_options(struct tcp_options_received *rx_opt)#if IS_ENABLED (CONFIG_SMC ) rx_opt->smc_ok =0 ;#endif + rx_opt->mptcp.mp_capable = rx_opt->mptcp.mp_join = rx_opt->mptcp.dss =0 ; }/* This is the max number of SACKS that we'll generate and process. It's safe
@@ -137,6 +148,7 @@ struct tcp_request_sock {* FastOpen it's the seq# * after data-in-SYN. */ +bool is_mptcp; };static inline struct tcp_request_sock *tcp_rsk (const struct request_sock *req)
@@ -384,6 +396,8 @@ struct tcp_sock {*/ struct request_sock *fastopen_rsk;u32 *saved_syn; + +bool is_mptcp; };enum tsq_enum {
include/net/mptcp.h +49 -0
59 lines not on this page · raw message
include/net/tcp.h +2 -0
@@ -214,6 +214,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_MPC_SYN 12 +#define TCPOLEN_MPTCP_MPC_SYNACK 20/* Flags in tp->nonagle */ #define TCP_NAGLE_OFF 1/* Nagle's algo is disabled */
net/ipv4/tcp_input.c +15 -0
@@ -78,6 +78,7 @@#include <linux/errqueue.h> #include <trace/events/tcp.h> #include <linux/static_key.h> +#include <net/mptcp.h> int sysctl_tcp_max_orphans__read_mostly =NR_FILE ;
@@ -3785,6 +3786,10 @@ void tcp_parse_options(const struct net *net,*/ break ;#endif +case TCPOPT_MPTCP : +mptcp_parse_option (ptr, opsize, opt_rx); +break ; +case TCPOPT_FASTOPEN : tcp_parse_fastopen_option( opsize - TCPOLEN_FASTOPEN_BASE,
@@ -5670,6 +5675,15 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,tcp_sync_mss (sk, icsk->icsk_pmtu_cookie);tcp_initialize_rcv_mss (sk); +// @@ could use a callout here +if (tp->is_mptcp) { +struct subflow_sock *subflow =subflow_sk (sk); +if (subflow->request_mptcp && tp->rx_opt.mptcp.mp_capable) { + subflow->mp_capable =1 ; + subflow->remote_key = tp->rx_opt.mptcp.sndr_key; + } + } +/* Remember, tcp_poll() does not lock socket! * Change state from SYN-SENT only after copied_seq * is initialized. */
@@ -6245,6 +6259,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,tcp_rsk (req)->af_specific = af_ops;tcp_rsk (req)->ts_off =0 ; +tcp_rsk (req)->is_mptcp =0 ;tcp_clear_options (&tmp_opt); tmp_opt.mss_clamp = af_ops->mss_clamp;
net/ipv4/tcp_output.c +72 -0
114 lines not on this page · raw message
net/mptcp/Makefile +1 -1
@@ -1,3 +1,3 @@ obj-$(CONFIG_MPTCP) += mptcp.o -mptcp-y := protocol.o +mptcp-y := protocol.o options.o
net/mptcp/options.c new file +177 -0
177 lines not on this page · raw message
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 5/16 tcp: Add IPPROTO_SUBFLOW
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
IANA protocol numbers fit in a single byte, however the protocol field of struct inet_protosw is an unsigned short so defining IPPROTO_SUBFLOW as a 16-bit value greater than 0xFF with the same LSB as IPPROTO_TCP is convenient for registering a unique protocol with inet_register_protosw() that still transmits packets with IPPROTO_TCP as the protocol number.
--- include/uapi/linux/in.h | 2 ++ 1 file changed, 2 insertions(+)
include/uapi/linux/in.h +2 -0
@@ -78,6 +78,8 @@ enum {#define IPPROTO_MPLS IPPROTO_MPLS IPPROTO_RAW = 255, /* Raw IP packets */#define IPPROTO_RAW IPPROTO_RAW + IPPROTO_SUBFLOW = 262, /* Multipath TCP (IPPROTO_TCP | 0x100) */ +#define IPPROTO_SUBFLOW IPPROTO_SUBFLOWIPPROTO_MAX };#endif
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 6/16 tcp: expose tcp routines and structs for MPTCP
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
tcp_v4_init_sock(), inet_compat_ioctl()tcp_request_sock_ipv4_ops
This function is needed for MPTCP subflow initialization.
--- include/net/inet_common.h | 3 +++ include/net/mptcp.h | 2 ++ include/net/tcp.h | 1 + net/ipv4/af_inet.c | 2 +- net/ipv4/tcp_ipv4.c | 4 ++-- 5 files changed, 9 insertions(+), 3 deletions(-)
include/net/inet_common.h +3 -0
@@ -35,6 +35,9 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);int inet_getname (struct socket *sock,struct sockaddr *uaddr,int peer);int inet_ioctl (struct socket *sock,unsigned int cmd,unsigned long arg); +#ifdef CONFIG_COMPAT +int inet_compat_ioctl (struct socket *sock,unsigned int cmd,unsigned long arg); +#endif int inet_ctl_sock_create (struct sock **sk,unsigned short family,unsigned short type,unsigned char protocol,struct net *net);
include/net/mptcp.h +2 -0
@@ -56,6 +56,8 @@ unsigned int mptcp_synack_options(struct request_sock *req,void mptcp_get_options (const struct sk_buff *skb,struct tcp_options_received *options); +extern const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops; +#else static inline void mptcp_parse_option(const unsigned char *ptr, int opsize,
include/net/tcp.h +1 -0
@@ -430,6 +430,7 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,int tcp_v4_do_rcv (struct sock *sk,struct sk_buff *skb);int tcp_v4_connect (struct sock *sk,struct sockaddr *uaddr,int addr_len);int tcp_connect (struct sock *sk); +int tcp_v4_init_sock (struct sock *sk);enum tcp_synack_type {TCP_SYNACK_NORMAL ,TCP_SYNACK_FASTOPEN ,
net/ipv4/af_inet.c +1 -1
@@ -930,7 +930,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)EXPORT_SYMBOL (inet_ioctl);#ifdef CONFIG_COMPAT -static int inet_compat_ioctl (struct socket *sock,unsigned int cmd,unsigned long arg) +int inet_compat_ioctl (struct socket *sock,unsigned int cmd,unsigned long arg) {struct sock *sk = sock->sk;int err = -ENOIOCTLCMD ;
net/ipv4/tcp_ipv4.c +2 -2
@@ -1287,7 +1287,7 @@ struct request_sock_ops tcp_request_sock_ops __read_mostly = { .syn_ack_timeout = tcp_syn_ack_timeout, }; -static const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = { +const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = { .mss_clamp =TCP_MSS_DEFAULT , #ifdef CONFIG_TCP_MD5SIG .req_md5_lookup = tcp_v4_md5_lookup,
@@ -1876,7 +1876,7 @@ static const struct tcp_sock_af_ops tcp_sock_ipv4_specific = {/* NOTE: A lot of things set to zero explicitly by call to * sk_alloc() so need not be done here. */ -static int tcp_v4_init_sock (struct sock *sk) +int tcp_v4_init_sock (struct sock *sk) {struct inet_connection_sock *icsk =inet_csk (sk);
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 7/16 mptcp: Create SUBFLOW socket for outgoing connections
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
Override the bind() and connect() methods of the MPTCP socket so they may act on the subflow socket and use the .sk_rx_dst_set() handler in the subflow proto to capture when the responding SYN-ACK is received.
--- include/net/mptcp.h | 46 +++++++++++- net/mptcp/Makefile | 2 +- net/mptcp/protocol.c | 151 ++++++++++++++++++++++++++++++++++++---- net/mptcp/subflow.c | 192 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 376 insertions(+), 15 deletions(-) create mode 100644 net/mptcp/subflow.c
include/net/mptcp.h +45 -1
@@ -37,7 +37,10 @@struct mptcp_sock {/* inet_connection_sock must be the first member */ struct inet_connection_sock sk; -struct socket *subflow; +u64 local_key; +u64 remote_key; +struct socket *connection_list;/* @@ needs to be a list */ +struct socket *subflow;/* outgoing connect, listener or !mp_capable */ };static inline struct mptcp_sock *mptcp_sk (const struct sock *sk)
@@ -45,6 +48,42 @@ static inline struct mptcp_sock *mptcp_sk(const struct sock *sk)return (struct mptcp_sock *)sk; } +/* MPTCP subflow sock structure */ +struct subflow_sock { +/* tcp_sock must be the first member */ +struct tcp_sock sk; +u64 local_key; +u64 remote_key; +bool request_mptcp;// send MP_CAPABLE +bool checksum; +bool version; +bool mp_capable;// remote is MPTCP capable +bool fourth_ack;// send initial DSS +struct sock *conn;// parent mptcp_sock +}; + +static inline struct subflow_sock *subflow_sk (const struct sock *sk) +{ +return (struct subflow_sock *)sk; +} + +struct subflow_request_sock { +struct tcp_request_sock sk; +u8 mp_capable :1 , + mp_join :1 , + checksum :1 , + backup :1 , + version :4 ; +u64 local_key; +u64 remote_key; +}; + +static inline +struct subflow_request_sock *subflow_rsk (const struct request_sock *rsk) +{ +return (struct subflow_request_sock *)rsk; +} +#ifdef CONFIG_MPTCP void mptcp_parse_option(const unsigned char *ptr, int opsize,
@@ -53,6 +92,11 @@ unsigned int mptcp_syn_options(struct sock *sk, u64 *local_key);unsigned int mptcp_synack_options (struct request_sock *req,u64 *local_key,u64 *remote_key); +void mptcp_finish_connect (struct sock *sk,int mp_capable); + +int mptcp_subflow_init (void ); +void mptcp_subflow_exit (void ); +void mptcp_get_options (const struct sk_buff *skb,struct tcp_options_received *options);
net/mptcp/Makefile +1 -1
@@ -1,3 +1,3 @@ obj-$(CONFIG_MPTCP) += mptcp.o -mptcp-y := protocol.o options.o +mptcp-y := protocol.o subflow.o options.o
net/mptcp/protocol.c +138 -13
228 lines not on this page · raw message
net/mptcp/subflow.c new file +192 -0
192 lines not on this page · raw message
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 8/16 mptcp: Create SUBFLOW socket for incoming connections
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
Override the conn_request() and syn_recv_sock() handlers in the inet_connection_sock to handle incoming MPTCP SYNs and the ACK to the response SYN.
--- net/mptcp/protocol.c | 52 ++++++++++++++++++++++- net/mptcp/subflow.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 162 insertions(+), 5 deletions(-)
net/mptcp/protocol.c +50 -2
@@ -118,6 +118,44 @@ static void mptcp_close(struct sock *sk, long timeout) } } +static struct sock *mptcp_accept (struct sock *sk,int flags,int *err, +bool kern) +{ +struct mptcp_sock *msk =mptcp_sk (sk); +struct socket *listener = msk->subflow; +struct socket *new_sock; +struct socket *mp; +struct subflow_sock *subflow; + +pr_debug ("msk=%p, listener=%p" , msk, listener->sk); + *err =kernel_accept (listener, &new_sock, flags); +if (*err <0 ) +return NULL ; + + subflow =subflow_sk (new_sock->sk); +pr_debug ("new_sock=%p" , subflow); + + *err =sock_create (PF_INET ,SOCK_STREAM ,IPPROTO_MPTCP , &mp); +if (*err <0 ) { +kernel_sock_shutdown (new_sock,SHUT_RDWR ); +sock_release (new_sock); +return NULL ; + } + + msk =mptcp_sk (mp->sk); +pr_debug ("msk=%p" , msk); + +if (subflow->mp_capable) { + msk->remote_key = subflow->remote_key; + msk->local_key = subflow->local_key; + msk->connection_list = new_sock; + }else { + msk->subflow = new_sock; + } + +return mp->sk; +} +static int mptcp_get_port (struct sock *sk,unsigned short snum) {struct mptcp_sock *msk =mptcp_sk (sk);
@@ -167,12 +205,22 @@ int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,return err; } +int mptcp_listen (struct socket *sock,int backlog) +{ +struct mptcp_sock *msk =mptcp_sk (sock->sk); +struct socket *subflow = msk->subflow; + +pr_debug ("msk=%p, subflow=%p" , msk, subflow->sk); + +return inet_listen (subflow, backlog); +} +static struct proto mptcp_prot = { .name ="MPTCP" , .owner =THIS_MODULE , .init = mptcp_init_sock, .close = mptcp_close, - .accept = inet_csk_accept, + .accept = mptcp_accept, .connect = mptcp_connect, .shutdown = tcp_shutdown, .sendmsg = mptcp_sendmsg,
@@ -195,7 +243,7 @@ const struct proto_ops mptcp_stream_ops = { .getname = inet_getname, .poll = tcp_poll, .ioctl = inet_ioctl, - .listen = inet_listen, + .listen = mptcp_listen, .shutdown = inet_shutdown, .setsockopt = sock_common_setsockopt, .getsockopt = sock_common_getsockopt,
net/mptcp/subflow.c +112 -3
151 lines not on this page · raw message
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 9/16 mptcp: Add key generation and token tree
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
Generate the local keys, IDSN, and token when creating a new socket. Introduce the token tree to track all tokens in use using a radix tree with the MPTCP token itself as the index.
--- include/net/mptcp.h | 25 ++++++ net/mptcp/Makefile | 2 +- net/mptcp/crypto.c | 213 +++++++++++++++++++++++++++++++++++++++++++++++++ net/mptcp/protocol.c | 21 ++++- net/mptcp/subflow.c | 30 ++++++- net/mptcp/token.c | 221 +++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 508 insertions(+), 4 deletions(-) create mode 100644 net/mptcp/crypto.c create mode 100644 net/mptcp/token.c
include/net/mptcp.h +25 -0
@@ -39,6 +39,7 @@ struct mptcp_sock {struct inet_connection_sock sk;u64 local_key;u64 remote_key; +u32 token;struct socket *connection_list;/* @@ needs to be a list */ struct socket *subflow;/* outgoing connect, listener or !mp_capable */ };
@@ -54,6 +55,7 @@ struct subflow_sock {struct tcp_sock sk;u64 local_key;u64 remote_key; +u32 token;bool request_mptcp;// send MP_CAPABLE bool checksum;bool version;
@@ -76,6 +78,7 @@ struct subflow_request_sock { version :4 ;u64 local_key;u64 remote_key; +u32 token; }; static inline
@@ -102,6 +105,28 @@ void mptcp_get_options(const struct sk_buff *skb,extern const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops; +void token_init (void ); +void token_new_request (struct request_sock *req,const struct sk_buff *skb); +void token_destroy_request (u32 token); +void token_new_connect (struct sock *sk); +void token_new_accept (struct sock *sk); +void token_destroy (u32 token); + +void crypto_init (void ); +u32 crypto_v4_get_nonce (__be32 saddr,__be32 daddr, +__be16 sport,__be16 dport); +u64 crypto_v4_get_key (__be32 saddr,__be32 daddr, +__be16 sport,__be16 dport); +u64 crypto_v6_get_key (const struct in6_addr *saddr, +const struct in6_addr *daddr, +__be16 sport,__be16 dport); +u32 crypto_v6_get_nonce (const struct in6_addr *saddr, +const struct in6_addr *daddr, +__be16 sport,__be16 dport); +void crypto_key_sha1 (u64 key,u32 *token,u64 *idsn); +void crypto_hmac_sha1 (const u8 *key_1,const u8 *key_2,u32 *hash_out, +int arg_num, ...); +#else static inline void mptcp_parse_option(const unsigned char *ptr, int opsize,
net/mptcp/Makefile +1 -1
@@ -1,3 +1,3 @@ obj-$(CONFIG_MPTCP) += mptcp.o -mptcp-y := protocol.o subflow.o options.o +mptcp-y := protocol.o subflow.o options.o token.o crypto.o
net/mptcp/crypto.c new file +213 -0
213 lines not on this page · raw message
net/mptcp/protocol.c +19 -2
@@ -38,6 +38,8 @@ static int mptcp_connect(struct sock *sk, struct sockaddr *saddr, int len)if (!err) { msk->remote_key = subflow->remote_key; msk->local_key = subflow->local_key; + msk->token = subflow->token; +pr_debug ("token=%u" , subflow->token); msk->connection_list = msk->subflow; msk->subflow =NULL ; }
@@ -91,13 +93,11 @@ static int mptcp_init_sock(struct sock *sk)struct subflow_sock *subflow =subflow_sk (sf->sk);pr_debug ("subflow=%p" , subflow); - msk->local_key =1234567887654321 ;// @@ fixed for now msk->subflow = sf; subflow->conn = sk; subflow->request_mptcp =1 ;// @@ if MPTCP enabled subflow->checksum =1 ;// @@ if checksum enabled subflow->version =0 ; - subflow->local_key = msk->local_key; }return err;
@@ -148,6 +148,8 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,if (subflow->mp_capable) { msk->remote_key = subflow->remote_key; msk->local_key = subflow->local_key; + msk->token = subflow->token; +pr_debug ("token=%u" , msk->token); msk->connection_list = new_sock; }else { msk->subflow = new_sock;
@@ -156,6 +158,15 @@ static struct sock *mptcp_accept(struct sock *sk, int flags, int *err,return mp->sk; } +static void mptcp_destroy (struct sock *sk) +{ +struct mptcp_sock *msk =mptcp_sk (sk); + +pr_debug ("msk=%p, subflow=%p" , sk, msk->subflow->sk); + +token_destroy (msk->token); +} +static int mptcp_get_port (struct sock *sk,unsigned short snum) {struct mptcp_sock *msk =mptcp_sk (sk);
@@ -186,6 +197,8 @@ void mptcp_finish_connect(struct sock *sk, int mp_capable)if (mp_capable) { msk->remote_key = subflow->remote_key; msk->local_key = subflow->local_key; + msk->token = subflow->token; +pr_debug ("token=%u" , msk->token); msk->connection_list = msk->subflow; msk->subflow =NULL ; }
@@ -223,6 +236,7 @@ static struct proto mptcp_prot = { .accept = mptcp_accept, .connect = mptcp_connect, .shutdown = tcp_shutdown, + .destroy = mptcp_destroy, .sendmsg = mptcp_sendmsg, .recvmsg = mptcp_recvmsg, .hash = inet_hash,
@@ -275,6 +289,9 @@ static int __init mptcp_init(void) mptcp_prot.h.hashinfo = tcp_prot.h.hashinfo; +token_init (); +crypto_init (); + err =mptcp_subflow_init ();if (err) goto subflow_failed;
net/mptcp/subflow.c +29 -1
@@ -53,6 +53,28 @@ static int subflow_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,return tcp_recvmsg (sk, msg, len, nonblock, flags, addr_len); } +static int subflow_rebuild_header (struct sock *sk) +{ +struct subflow_sock *subflow =subflow_sk (sk); + +if (subflow->request_mptcp && !subflow->token) { +pr_debug ("subflow=%p" , sk); +token_new_connect (sk); + } + +return inet_sk_rebuild_header (sk); +} + +static void subflow_req_destructor (struct request_sock *req) +{ +struct subflow_request_sock *subflow_req =subflow_rsk (req); + +pr_debug ("subflow_req=%p" , subflow_req); + +token_destroy_request (subflow_req->token); + tcp_request_sock_ops.destructor (req); +} +static void subflow_v4_init_req (struct request_sock *req,const struct sock *sk_listener,struct sk_buff *skb)
@@ -82,6 +104,8 @@ static void subflow_v4_init_req(struct request_sock *req, listener->checksum) subflow_req->checksum =1 ; subflow_req->remote_key = rx_opt.mptcp.sndr_key; +pr_debug ("remote_key=%llu" , subflow_req->remote_key); +token_new_request (req, skb); }else { subflow_req->mp_capable =0 ; }
@@ -147,6 +171,9 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, subflow->fourth_ack =1 ; subflow->remote_key = subflow_req->remote_key; subflow->local_key = subflow_req->local_key; + subflow->token = subflow_req->token; +pr_debug ("token=%u" , subflow->token); +token_new_accept (child); }else { subflow->mp_capable =0 ; }
@@ -158,7 +185,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,const struct inet_connection_sock_af_ops subflow_specific = { .queue_xmit = ip_queue_xmit, .send_check = tcp_v4_send_check, - .rebuild_header = inet_sk_rebuild_header, + .rebuild_header = subflow_rebuild_header, .sk_rx_dst_set = subflow_finish_connect, .conn_request = subflow_conn_request, .syn_recv_sock = subflow_syn_recv_sock,
@@ -273,6 +300,7 @@ int mptcp_subflow_init(void) subflow_request_sock_ops = tcp_request_sock_ops; subflow_request_sock_ops.obj_size =sizeof (struct subflow_request_sock ), + subflow_request_sock_ops.destructor = subflow_req_destructor; subflow_request_sock_ipv4_ops = tcp_request_sock_ipv4_ops; subflow_request_sock_ipv4_ops.init_req = subflow_v4_init_req;
net/mptcp/token.c new file +221 -0
221 lines not on this page · raw message
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 10/16 mptcp: Add getname() socket operation
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
--- net/mptcp/protocol.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
net/mptcp/protocol.c +17 -1
@@ -218,6 +218,22 @@ int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,return err; } +int mptcp_getname (struct socket *sock,struct sockaddr *uaddr,int peer) +{ +struct mptcp_sock *msk =mptcp_sk (sock->sk); +struct socket *subflow; +int err = -EPERM ; + +if (msk->connection_list) + subflow = msk->connection_list; +else + subflow = msk->subflow; + + err =inet_getname (subflow, uaddr, peer); + +return err; +} +int mptcp_listen (struct socket *sock,int backlog) {struct mptcp_sock *msk =mptcp_sk (sock->sk);
@@ -254,7 +270,7 @@ const struct proto_ops mptcp_stream_ops = { .connect = mptcp_stream_connect, .socketpair = sock_no_socketpair, .accept = inet_accept, - .getname = inet_getname, + .getname = mptcp_getname, .poll = tcp_poll, .ioctl = inet_ioctl, .listen = mptcp_listen,
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 11/16 mptcp: Add shutdown() socket operation
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
--- net/mptcp/protocol.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
net/mptcp/protocol.c +21 -1
@@ -244,6 +244,26 @@ int mptcp_listen(struct socket *sock, int backlog)return inet_listen (subflow, backlog); } +int mptcp_stream_shutdown (struct socket *sock,int how) +{ +struct mptcp_sock *msk =mptcp_sk (sock->sk); +int ret =0 ; + +pr_debug ("sk=%p, how=%d" , msk, how); + +if (msk->subflow) { +pr_debug ("subflow=%p" , msk->subflow->sk); + ret =kernel_sock_shutdown (msk->subflow, how); + } +if (msk->connection_list) { +pr_debug ("conn_list->subflow=%p" , msk->connection_list->sk); + ret =kernel_sock_shutdown (msk->connection_list, how); + } +inet_shutdown (sock, how); + +return ret; +} +static struct proto mptcp_prot = { .name ="MPTCP" , .owner =THIS_MODULE ,
@@ -274,7 +294,7 @@ const struct proto_ops mptcp_stream_ops = { .poll = tcp_poll, .ioctl = inet_ioctl, .listen = mptcp_listen, - .shutdown = inet_shutdown, + .shutdown = mptcp_stream_shutdown, .setsockopt = sock_common_setsockopt, .getsockopt = sock_common_getsockopt, .sendmsg = inet_sendmsg,
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 12/16 mptcp: Implement setsockopt()/getsockopt()
In reply to Mat MartineauFrom: Peter Krystad <peter.krystad(a)intel.com>
--- net/mptcp/protocol.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ net/mptcp/subflow.c | 22 ++++++++++++++++++++++ 2 files changed, 70 insertions(+)
net/mptcp/protocol.c +48 -0
@@ -167,6 +167,52 @@ static void mptcp_destroy(struct sock *sk)token_destroy (msk->token); } +static int mptcp_setsockopt (struct sock *sk,int level,int optname, +char __user *uoptval,unsigned int optlen) +{ +struct mptcp_sock *msk =mptcp_sk (sk); +struct socket *subflow; +char __kernel *optval; + +pr_debug ("msk=%p" , msk); +if (msk->connection_list) { + subflow = msk->connection_list; +pr_debug ("conn_list->subflow=%p" , subflow->sk); + }else { + subflow = msk->subflow; +pr_debug ("subflow=%p" , subflow->sk); + } + +/* will be treated as __user in subflow_setsockopt */ + optval = (char __kernel __force *) uoptval; + +return kernel_setsockopt (subflow, level, optname, optval, optlen); +} + +static int mptcp_getsockopt (struct sock *sk,int level,int optname, +char __user *uoptval,int __user *uoption) +{ +struct mptcp_sock *msk =mptcp_sk (sk); +struct socket *subflow; +char __kernel *optval; +int __kernel *option; + +pr_debug ("msk=%p" , msk); +if (msk->connection_list) { + subflow = msk->connection_list; +pr_debug ("conn_list->subflow=%p" , subflow->sk); + }else { + subflow = msk->subflow; +pr_debug ("subflow=%p" , subflow->sk); + } + +/* will be treated as __user in subflow_getsockopt */ + optval = (char __kernel __force *) uoptval; + option = (int __kernel __force *) uoption; + +return kernel_getsockopt (subflow, level, optname, optval, option); +} +static int mptcp_get_port (struct sock *sk,unsigned short snum) {struct mptcp_sock *msk =mptcp_sk (sk);
@@ -273,6 +319,8 @@ static struct proto mptcp_prot = { .connect = mptcp_connect, .shutdown = tcp_shutdown, .destroy = mptcp_destroy, + .setsockopt = mptcp_setsockopt, + .getsockopt = mptcp_getsockopt, .sendmsg = mptcp_sendmsg, .recvmsg = mptcp_recvmsg, .hash = inet_hash,
net/mptcp/subflow.c +22 -0
@@ -248,6 +248,26 @@ static void subflow_destroy(struct sock *sk)tcp_v4_destroy_sock (sk); } +static int subflow_setsockopt (struct sock *sk,int level,int optname, +char __user *optval,unsigned int optlen) +{ +struct subflow_sock *subflow =subflow_sk (sk); + +pr_debug ("subflow=%p" , subflow); + +return tcp_setsockopt (sk, level, optname, optval, optlen); +} + +static int subflow_getsockopt (struct sock *sk,int level,int optname, +char __user *optval,int __user *option) +{ +struct subflow_sock *subflow =subflow_sk (sk); + +pr_debug ("subflow=%p" , subflow); + +return tcp_getsockopt (sk, level, optname, optval, option); +} +static struct proto subflow_prot = { .name ="SUBFLOW" , .owner =THIS_MODULE ,
@@ -259,6 +279,8 @@ static struct proto subflow_prot = { .init = subflow_init_sock, .destroy = subflow_destroy, .shutdown = tcp_shutdown, + .setsockopt = subflow_setsockopt, + .getsockopt = subflow_getsockopt, .keepalive = tcp_set_keepalive, .recvmsg = subflow_recvmsg, .sendmsg = subflow_sendmsg,
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 13/16 skbuff: Add shared control buffer
In reply to Mat MartineauThe sk_buff control buffer is of limited size, and cannot be enlarged without significant impact on systemwide memory use. However, additional per-packet state is needed for some protocols, like Multipath TCP.
An optional shared control buffer placed after the normal struct skb_shared_info can accomodate the necessary state without imposing extra memory usage or code changes on normal struct sk_buff users. __alloc_skb will now place a skb_shared_info_ext structure at skb->end when given the SKB_ALLOC_SHINFO_EXT flag. Most users of struct sk_buff continue to use the skb_shinfo() macro to access shared info. skb_shinfo(skb)->is_ext is set if the extended structure is available, and cleared if it is not.
pskb_expand_head will preserve the shared control buffer if it is present.
--- include/linux/skbuff.h | 24 ++++++++++++++++++++++- net/core/skbuff.c | 53 ++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 64 insertions(+), 13 deletions(-)
include/linux/skbuff.h +23 -1
@@ -491,7 +491,8 @@ int skb_zerocopy_iter_stream(struct sock *sk, struct sk_buff *skb,* the end of the header data, ie. at skb->end. */ struct skb_shared_info { -__u8 __unused; +__u8 is_ext:1 , + __unused:7 ;__u8 meta_len;__u8 nr_frags;__u8 tx_flags;
@@ -531,6 +532,24 @@ struct skb_shared_info {#define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) +/* This is an extended version of skb_shared_info, also invariant across +* clones and living at the end of the header data. +*/ +struct skb_shared_info_ext { +/* skb_shared_info must be the first member */ +struct skb_shared_info shinfo; + +/* This is the shared control buffer. It is similar to sk_buff's +* control buffer, but is shared across clones. It must not be +* modified when multiple sk_buffs are referencing this structure. +*/ +char shcb[48 ]; +}; + +#define SKB_SHINFO_EXT_OVERHEAD \ + (SKB_DATA_ALIGN(sizeof(struct skb_shared_info_ext)) - \ + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) +enum {SKB_FCLONE_UNAVAILABLE ,/* skb has no fclone (from head_cache) */ SKB_FCLONE_ORIG ,/* orig skb (from fclone_cache) */
@@ -857,6 +876,7 @@ struct sk_buff {#define SKB_ALLOC_FCLONE 0x01#define SKB_ALLOC_RX 0x02#define SKB_ALLOC_NAPI 0x04 +#define SKB_ALLOC_SHINFO_EXT 0x08/* Returns true if the skb was allocated from PFMEMALLOC reserves */ static inline bool skb_pfmemalloc (const struct sk_buff *skb)
@@ -1277,6 +1297,8 @@ static inline unsigned int skb_end_offset(const struct sk_buff *skb)/* Internal */ #define skb_shinfo (SKB ) ((struct skb_shared_info *)(skb_end_pointer(SKB))) +#define skb_shinfo_ext (SKB ) \ + ((struct skb_shared_info_ext *)(skb_end_pointer(SKB)))static inline struct skb_shared_hwtstamps *skb_hwtstamps (struct sk_buff *skb) {
net/core/skbuff.c +41 -12
113 lines not on this page · raw message
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 14/16 tcp: Export low-level TCP functions
In reply to Mat Martineau--- include/net/tcp.h | 4 ++++ net/ipv4/tcp.c | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-)
include/net/tcp.h +4 -0
@@ -330,6 +330,10 @@ int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset, size_t size, int flags);ssize_t do_tcp_sendpages (struct sock *sk,struct page *page,int offset,size_t size,int flags); +int tcp_send_mss (struct sock *sk,int *size_goal,int flags); +void tcp_skb_entail (struct sock *sk,struct sk_buff *skb); +void tcp_push (struct sock *sk,int flags,int mss_now,int nonagle, +int size_goal);void tcp_release_cb (struct sock *sk);void tcp_wfree (struct sk_buff *skb);void tcp_write_timer_handler (struct sock *sk);
net/ipv4/tcp.c +6 -6
@@ -649,7 +649,7 @@ static inline bool forced_push(const struct tcp_sock *tp)return after (tp->write_seq, tp->pushed_seq + (tp->max_window >>1 )); } -static void skb_entail (struct sock *sk,struct sk_buff *skb) +void tcp_skb_entail (struct sock *sk,struct sk_buff *skb) {struct tcp_sock *tp =tcp_sk (sk);struct tcp_skb_cb *tcb =TCP_SKB_CB (skb);
@@ -693,8 +693,8 @@ static bool tcp_should_autocork(struct sock *sk, struct sk_buff *skb,refcount_read (&sk->sk_wmem_alloc) > skb->truesize; } -static void tcp_push (struct sock *sk,int flags,int mss_now, -int nonagle,int size_goal) +void tcp_push (struct sock *sk,int flags,int mss_now, +int nonagle,int size_goal) {struct tcp_sock *tp =tcp_sk (sk);struct sk_buff *skb;
@@ -917,7 +917,7 @@ static unsigned int tcp_xmit_size_goal(struct sock *sk, u32 mss_now,return max (size_goal, mss_now); } -static int tcp_send_mss (struct sock *sk,int *size_goal,int flags) +int tcp_send_mss (struct sock *sk,int *size_goal,int flags) {int mss_now;
@@ -972,7 +972,7 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,if (!skb) goto wait_for_memory; -skb_entail (sk, skb); +tcp_skb_entail (sk, skb); copy = size_goal; }
@@ -1286,7 +1286,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) process_backlog = true; skb->ip_summed =CHECKSUM_PARTIAL ; -skb_entail (sk, skb); +tcp_skb_entail (sk, skb); copy = size_goal;/* All packets are restored as if they have
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 15/16 mptcp: More efficient byte order handling
In reply to Mat Martineaucrypto_key_sha1() was reordering bytes in words that were discarded, and the initial data sequence number (IDSN) was returned in a way that required additional byte swapping. Now only the token is returned with its bytes swapped, and the IDSN is returned in host order so it is ready for comparison and addition.
--- net/mptcp/crypto.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
net/mptcp/crypto.c +2 -6
@@ -106,7 +106,6 @@ void crypto_key_sha1(u64 key, u32 *token, u64 *idsn)u32 workspace[SHA_WORKSPACE_WORDS ];u32 mptcp_hashed_key[SHA_DIGEST_WORDS ];u8 input[64 ]; -int i;memset (workspace,0 ,sizeof (workspace));
@@ -121,13 +120,10 @@ void crypto_key_sha1(u64 key, u32 *token, u64 *idsn)sha_init (mptcp_hashed_key);sha_transform (mptcp_hashed_key, input, workspace); -for (i =0 ; i <5 ; i++) - mptcp_hashed_key[i] =cpu_to_be32 (mptcp_hashed_key[i]); -if (token) - *token = mptcp_hashed_key[0 ]; + *token =htonl (mptcp_hashed_key[0 ]);if (idsn) - *idsn = *((u64 *)&mptcp_hashed_key[3 ]); + *idsn = ((u64 )mptcp_hashed_key[3 ] <<32 ) + mptcp_hashed_key[4 ]; } void crypto_hmac_sha1(const u8 *key_1, const u8 *key_2, u32 *hash_out,
Signature · 1 line
2.16.3
Mat Martineau
RFC PATCH 16/16 mptcp: Write MPTCP DSS headers to outgoing data packets
In reply to Mat MartineauPer-packet metadata required to write the MPTCP DSS option is written to the skb shared control buffer. One write to the socket may contain more than one packet of data, in which case the DSS option in the first packet will have a mapping covering all of the data in that write. Packets after the first do not have a DSS option. This is complicated to handle under memory pressure, since the first packet (with the DSS mapping) is pushed to the TCP core before the remaining skbs are allocated.
The current implementation is limited. If a non-blocking write only succeeds in sending part of the data, the mapping that was in the first packet will cover data that was not sent and is not buffered within the kernel. There's no guarantee that the socket user will write the same (or any) data when the socket becomes writable again.
The MPTCP DSS checksum is not yet implemented.
--- include/net/mptcp.h | 30 +++++- net/ipv4/tcp_output.c | 144 +++++++++++++++++++++---- net/mptcp/protocol.c | 285 +++++++++++++++++++++++++++++++++++++++++++++++--- net/mptcp/token.c | 13 +-- 4 files changed, 432 insertions(+), 40 deletions(-)
include/net/mptcp.h +28 -2
@@ -39,6 +39,8 @@ struct mptcp_sock {struct inet_connection_sock sk;u64 local_key;u64 remote_key; +u64 write_seq; +u64 ack_seq;u32 token;struct socket *connection_list;/* @@ needs to be a list */ struct socket *subflow;/* outgoing connect, listener or !mp_capable */
@@ -49,13 +51,36 @@ static inline struct mptcp_sock *mptcp_sk(const struct sock *sk)return (struct mptcp_sock *)sk; } +/* MPTCP sk_buff extended control buffer */ +struct mptcp_skb_ext_cb { +u64 data_ack; +u64 data_seq; +u32 subflow_seq; +u16 data_level_len; +u16 checksum; +u8 use_ack:1 , + ack64:1 , + use_map:1 , + dsn64:1 , + use_checksum:1 , + data_fin:1 , + __unused:2 ; +}; + +static inline struct mptcp_skb_ext_cb *mptcp_skb_ecb (struct sk_buff *skb) +{ +return (struct mptcp_skb_ext_cb *)skb_shinfo_ext (skb)->shcb; +} +/* MPTCP subflow sock structure */ struct subflow_sock {/* tcp_sock must be the first member */ struct tcp_sock sk;u64 local_key; -u64 remote_key;u32 token; +u64 idsn; +u64 remote_key; +u32 rel_write_seq;bool request_mptcp;// send MP_CAPABLE bool checksum;bool version;
@@ -77,8 +102,9 @@ struct subflow_request_sock { backup :1 , version : 4;u64 local_key; -u64 remote_key;u32 token; +u64 idsn; +u64 remote_key; }; static inline
net/ipv4/tcp_output.c +124 -20
199 lines not on this page · raw message
net/mptcp/protocol.c +273 -12
319 lines not on this page · raw message
net/mptcp/token.c +7 -6
@@ -81,10 +81,11 @@ static void new_req_token(struct request_sock *req, ireq->ir_rmt_port);#endif } -pr_debug ("local_key=%llu:%llx" , local_key, local_key); subflow_req->local_key = local_key; -crypto_key_sha1 (subflow_req->local_key, &subflow_req->token,NULL ); -pr_debug ("token=%u" , subflow_req->token); +crypto_key_sha1 (subflow_req->local_key, &subflow_req->token, + &subflow_req->idsn); +pr_debug ("local_key=%llu, token=%u, idsn=%llu" , subflow_req->local_key, + subflow_req->token, subflow_req->idsn); }static void new_token (const struct sock *sk)
@@ -105,9 +106,9 @@ static void new_token(const struct sock *sk) isk->inet_dport);#endif } -pr_debug ("local_key=%llu:%llx" , subflow->local_key, subflow->local_key); -crypto_key_sha1 (subflow->local_key, &subflow->token,NULL ); -pr_debug ("token=%u" , subflow->token); +crypto_key_sha1 (subflow->local_key, &subflow->token, &subflow->idsn); +pr_debug ("local_key=%llu, token=%u, idsn=%llu" , subflow->local_key, + subflow->token, subflow->idsn); }static int insert_req_token (u32 token)
Signature · 1 line
2.16.3
Rao Shoaib
I have had a very cursory look at the implementation and I do not see how it eliminates the MPTCP code that is intruding TCP code, that is the main concern of Netdev folks right ?. It also mucks with skb, something which upstream may or may not agree with. It has also not eliminated function pointers in the MPTCP code. The patch at best is incomplete as it does not handle JOIN. I really do not see this any difference than what RDS does and RDS have different reasons. Can you explain in technical terms why this is a better approach and what can be done with this approach that is not possible with the current implementation or why this approach needs to be adopted know considering we already have a working implementation. Please do not mention setting options or exposing flows as fd's.
We need a discussion on the benefits of this approach, but first it needs to be complete and tested.
Shoaib
Quoted 112 lines · Mat Martineau
Hello everyone,
Peter and I have been working on this patch set to show how how MPTCP can fit in to the Linux networking stack while using these design ideas:
* Applications opt-in to MPTCP using
IPPROTO_MPTCP, regular TCP sockets are still the default. A socket created withsocket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP)will attempt to form a MPTCP connection.IPPROTO_MPTCP== 99 as a placeholder.* Subflows exist within the kernel as separate sockets, owned by a MPTCP connection-level socket that is visible to userspace.
* Adds an optional area to struct
sk_buffto store MPTCP metadata without increasing the size of normalsk_buffs.* Adds the
CONFIG_MPTCPoption toKconfig.The following patches can form an MPTCP connection with the multipath-tcp.org kernel (tested with v0.94), and send DSS mappings that are accepted for the initial data packet. It is an early implementation, and I don't represent it as being upstreamable as-is or being everyone's idea of what an eventual upstream implementation will necessarily look like. It has significant limitations:
* Only one subflow is supported, no joins, and only ipv4.
* Does not support DSS checksums. Checksums must be disabled on the remote stack (for multipath-tcp.org, 'sudo sysctl -w net.mptcp.mptcp_checksum=0')
* Lots of debug statements (although they use dynamic debug and are disabled by default) and TODOs.
* The connection falls back to TCP after the first data packet because there's no MPTCP option on the ack after the handshake completes and the first data is exchanged.
* It's only been tested sending small amounts of data, and will reject system calls attempting to write more data than can fit in one mapping.
I should have an additional patch soon that handles the receive path (getting the MPTCP option up to the connection level socket to parse and handle mappings) and adds the MPTCP option to ACK packets.
Hopefully there are are some interesting concepts to discuss, and this code helps us assess how workable the above design principles are. Thanks in advance for your feedback on the benefits or drawbacks of this code, how it might be improved, or how other approaches might compare.
The patch set applies to net-next (as of commit
5d22d47b9ed96eon 2018-03-27). I have also pushed it to:https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(mptcp-proposal branch)Mat Martineau (6):
tcp: Add MPTCP option number
tcp: DefineIPPROTO_MPTCP
skbuff: Add shared control buffer
tcp: Export low-level TCP functions
mptcp: More efficient byte order handling
mptcp: Write MPTCP DSS headers to outgoing data packetsPeter Krystad (10):
mptcp: Add MPTCP socket stubs
mptcp: Handle MPTCP TCP options
tcp: AddIPPROTO_SUBFLOW
tcp: expose tcp routines and structs for MPTCP
mptcp: Create SUBFLOW socket for outgoing connections
mptcp: Create SUBFLOW socket for incoming connections
mptcp: Add key generation and token tree
mptcp: Addgetname()socket operation
mptcp: Addshutdown()socket operation
mptcp: Implement setsockopt()/getsockopt()include/linux/skbuff.h | 24 +- include/linux/tcp.h | 14 + include/net/inet_common.h | 3 + include/net/mptcp.h | 177 ++++++++++++ include/net/tcp.h | 8 + include/uapi/linux/in.h | 4 + net/Kconfig | 1 + net/Makefile | 1 + net/core/skbuff.c | 53 +++- net/ipv4/af_inet.c | 2 +- net/ipv4/tcp.c | 12 +- net/ipv4/tcp_input.c | 15 ++ net/ipv4/tcp_ipv4.c | 4 +- net/ipv4/tcp_output.c | 184 ++++++++++++- net/mptcp/Kconfig | 10 + net/mptcp/Makefile | 3 + net/mptcp/crypto.c | 209 ++++++++++++++ net/mptcp/options.c | 177 ++++++++++++ net/mptcp/protocol.c | 673 ++++++++++++++++++++++++++++++++++++++++++++++ net/mptcp/subflow.c | 351 ++++++++++++++++++++++++ net/mptcp/token.c | 222 +++++++++++++++ 21 files changed, 2121 insertions(+), 26 deletions(-)create mode 100644
include/net/mptcp.h
create mode 100644net/mptcp/Kconfig
create mode 100644net/mptcp/Makefile
create mode 100644net/mptcp/crypto.c
create mode 100644net/mptcp/options.c
create mode 100644net/mptcp/protocol.c
create mode 100644net/mptcp/subflow.c
create mode 100644net/mptcp/token.c
Rao Shoaib
[MPTCP] Patch does not apply
In reply to Mat MartineauI am unable to apply the 6th patch.
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux.old(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 03_16] mptcp: Add MPTCP socket stubs - Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: mptcp: Add MPTCP socket stubs .git/rebase-apply/patch:87: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 06_16] tcp: expose tcp routines and structs for MPTCP - Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: tcp: expose tcp routines and structs for MPTCP
error: patch failed: include/net/inet_common.h:35
error: include/net/inet_common.h: patch does not apply
Patch failed at 0001 tcp: expose tcp routines and structs for MPTCP The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master|AM 1/1)$git remote -v origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git (fetch) origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git (push)
Shoaib
Mat Martineau
Re: [MPTCP] Patch does not apply
Hi Rao -
Quoted 23 lines · Rao Shoaib
I am unable to apply the 6th patch.
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux.old(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 03_16] mptcp: Add MPTCP socket stubs - Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: mptcp: Add MPTCP socket stubs .git/rebase-apply/patch:87: new blank line at EOF.
+
warning: 1 line adds whitespace errors.rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 06_16] tcp: expose tcp routines and structs for MPTCP - Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: tcp: expose tcp routines and structs for MPTCP
error: patch failed:include/net/inet_common.h:35
error:include/net/inet_common.h: patch does not apply
Patch failed at 0001 tcp: expose tcp routines and structs for MPTCP The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Quoted 5 lines
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master|AM 1/1)$git remote -v origin https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(fetch)
origin https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(push)
If you cloned my git.kernel.org repo (which appears to be the case from your 'git remote -v' output), you shouldn't need to apply the patches from email. Instead:
$ git checkout -t origin/mptcp-proposal
will get you the commits directly from the git server.
Just to be specific, to apply the patches from email instead of directly checking out, you would clone
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git and apply the patches to that repository. In addition, I'm not 100% sure 'git am' understands .eml files - the man page for the latest git release mentions maildir, mbox, mboxrd, stgit, stgit-series and hg as supported email formats.
Hope this helps!
--
Mat Martineau
Intel OTC
Rao Shoaib
Re: [MPTCP] Patch does not apply
Quoted 55 lines · Mat Martineau
Hi Rao -
Quoted 24 lines · Rao Shoaib
I am unable to apply the 6th patch.
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux.old(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 03_16] mptcp: Add MPTCP socket stubs - Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: mptcp: Add MPTCP socket stubs .git/rebase-apply/patch:87: new blank line at EOF.
+
warning: 1 line adds whitespace errors.rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 06_16] tcp: expose tcp routines and structs for MPTCP - Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: tcp: expose tcp routines and structs for MPTCP
error: patch failed:include/net/inet_common.h:35
error:include/net/inet_common.h: patch does not apply
Patch failed at 0001 tcp: expose tcp routines and structs for MPTCP The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".Quoted 8 lines
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master|AM 1/1)$git remote -v
origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(fetch)
origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(push)If you cloned my git.kernel.org repo (which appears to be the case from your 'git remote -v' output), you shouldn't need to apply the patches from email. Instead:
$ git checkout -t origin/mptcp-proposalwill get you the commits directly from the git server.
Just to be specific, to apply the patches from email instead of directly checking out, you would clone
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git and apply the patches to that repository. In addition, I'm not 100% sure 'git am' understands .eml files - the man page for the latest git release mentions maildir, mbox, mboxrd, stgit, stgit-series and hg as supported email formats.
Quoted 5 lines
Hope this helps!
Signature · 2 lines
Mat Martineau Intel OTC
Hi Mat,
For some reason that was not clear to me, anyways I just looked at the patches and I am sorry to say I do not see any thing special about the patch.
For example the patch uses
+ .conn_request = subflow_conn_request, + .syn_recv_sock = subflow_syn_recv_sock,
The original implementation used
.conn_request = mptcp_conn_request, .syn_recv_sock = tcp_v4_syn_recv_sock,
subflow_syn_recv_sock() calls tcp_v4_syn_recv_sock()
The patch handles options exactly the same way as they have always been handled. Old implementation had struct mptcp_request_sock the patch has struct subflow_request_sock.
The patch is incomplete as it can not exchange any data using MPTCP. I see no reason to use this approach, we have a working implementation and that should be used and improved upon.
Shoaib
Christoph Paasch
Re: [MPTCP] Patch does not apply
Quoted 75 lines · Rao Shoaib
Quoted 51 lines · Mat Martineau
Quoted 24 lines · Rao Shoaib
I am unable to apply the 6th patch.
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux.old(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 03_16] mptcp: Add MPTCP socket stubs
- Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: mptcp: Add MPTCP socket stubs .git/rebase-apply/patch:87: new blank line at EOF.
+
warning: 1 line adds whitespace errors.rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 06_16] tcp: expose tcp routines and structs for MPTCP - Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: tcp: expose tcp routines and structs for MPTCP
error: patch failed:include/net/inet_common.h:35
error:include/net/inet_common.h: patch does not apply
Patch failed at 0001 tcp: expose tcp routines and structs for MPTCP The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".Quoted 8 lines
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master|AM 1/1)$git remote -v
origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(fetch)
origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(push)If you cloned my git.kernel.org repo (which appears to be the case from your 'git remote -v' output), you shouldn't need to apply the patches from email. Instead:
$ git checkout -t origin/mptcp-proposalwill get you the commits directly from the git server.
Just to be specific, to apply the patches from email instead of directly checking out, you would clone
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git and apply the patches to that repository. In addition, I'm not 100% sure 'git am' understands .eml files - the man page for the latest git release mentions maildir, mbox, mboxrd, stgit, stgit-series and hg as supported email formats.Quoted 5 lines
Hope this helps!
Signature · 2 lines
Mat Martineau Intel OTCHi Mat,
For some reason that was not clear to me, anyways I just looked at the patches and I am sorry to say I do not see any thing special about the patch.
For example the patch uses
+ .conn_request =
subflow_conn_request, + .syn_recv_sock =subflow_syn_recv_sock,The original implementation used
.conn_request =
mptcp_conn_request, .syn_recv_sock =tcp_v4_syn_recv_sock,
subflow_syn_recv_sock()callstcp_v4_syn_recv_sock()
Quoted 7 lines
The patch handles options exactly the same way as they have always been handled. Old implementation had struct
mptcp_request_sockthe patch has structsubflow_request_sock.The patch is incomplete as it can not exchange any data using MPTCP. I see no reason to use this approach, we have a working implementation and that should be used and improved upon.
I think the intention with this patchset was to show how the struct prot and exposing MPTCP fully at the socket layer allows to simplify things.
Creation of a real struct socket for subflows is also going to help a lot, as that's the path forward to enable proper lock-separation. We can't take the meta-socket lock in the TCP-stack as I mentioned in my review to your patchset.
So, in that sense for the above two points, the patchset is very useful as it shows how MPTCP fits in such a model.
Christoph
Rao Shoaib
Re: [MPTCP] Patch does not apply
Quoted 79 lines · Christoph Paasch
Quoted 78 lines · Rao Shoaib
Quoted 50 lines · Mat Martineau
Quoted 24 lines · Rao Shoaib
I am unable to apply the 6th patch.
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux.old(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 03_16] mptcp: Add MPTCP socket stubs
- Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: mptcp: Add MPTCP socket stubs .git/rebase-apply/patch:87: new blank line at EOF.
+
warning: 1 line adds whitespace errors.rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 06_16] tcp: expose tcp routines and structs for MPTCP - Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: tcp: expose tcp routines and structs for MPTCP
error: patch failed:include/net/inet_common.h:35
error:include/net/inet_common.h: patch does not apply
Patch failed at 0001 tcp: expose tcp routines and structs for MPTCP The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".Quoted 8 lines
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master|AM 1/1)$git remote -v
origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(fetch)
origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(push)If you cloned my git.kernel.org repo (which appears to be the case from your 'git remote -v' output), you shouldn't need to apply the patches from email. Instead:
$ git checkout -t origin/mptcp-proposalwill get you the commits directly from the git server.
Just to be specific, to apply the patches from email instead of directly checking out, you would clone
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git and apply the patches to that repository. In addition, I'm not 100% sure 'git am' understands .eml files - the man page for the latest git release mentions maildir, mbox, mboxrd, stgit, stgit-series and hg as supported email formats.Quoted 5 lines
Hope this helps!
Signature · 2 lines
Mat Martineau Intel OTCHi Mat,
For some reason that was not clear to me, anyways I just looked at the patches and I am sorry to say I do not see any thing special about the patch.
For example the patch uses
+ .conn_request =
subflow_conn_request, + .syn_recv_sock =subflow_syn_recv_sock,The original implementation used
.conn_request =
mptcp_conn_request, .syn_recv_sock =tcp_v4_syn_recv_sock,
subflow_syn_recv_sock()callstcp_v4_syn_recv_sock()The patch handles options exactly the same way as they have always been handled. Old implementation had struct
mptcp_request_sockthe patch has structsubflow_request_sock.
Quoted 5 lines
Quoted 3 lines
The patch is incomplete as it can not exchange any data using MPTCP. I see no reason to use this approach, we have a working implementation and that should be used and improved upon.
I think the intention with this patchset was to show how the struct prot and exposing MPTCP fully at the socket layer allows to simplify things.
It does not, Look at my patch, compare and post.
Quoted 9 lines
Creation of a real struct socket for subflows is also going to help a lot, as that's the path forward to enable proper lock-separation. We can't take the meta-socket lock in the TCP-stack as I mentioned in my review to your patchset.
So, in that sense for the above two points, the patchset is very useful as it shows how MPTCP fits in such a model.
It does not show anything because it does nothing.
Rao.
Quoted 4 lines
Christoph
Krystad
Re: [MPTCP] Patch does not apply
Quoted 83 lines · Rao Shoaib
Quoted 81 lines · Christoph Paasch
Quoted 80 lines · Rao Shoaib
Quoted 51 lines · Mat Martineau
Quoted 24 lines · Rao Shoaib
I am unable to apply the 6th patch.
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux.old(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 03_16] mptcp: Add MPTCP socket stubs
- Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: mptcp: Add MPTCP socket stubs .git/rebase-apply/patch:87: new blank line at EOF.
+
warning: 1 line adds whitespace errors.rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master)$git am "/tmp/mails/[MPTCP] [RFC PATCH 06_16] tcp: expose tcp routines and structs for MPTCP - Mat Martineau <mathew.j.martineau(a)linux.intel.com> - 2018-03-28 1618.eml"
Applying: tcp: expose tcp routines and structs for MPTCP
error: patch failed:include/net/inet_common.h:35
error:include/net/inet_common.h: patch does not apply
Patch failed at 0001 tcp: expose tcp routines and structs for MPTCP The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".Quoted 8 lines
rshoaib(a)caduceus5:/home/mptcp/sock_mptcp/linux(master|AM 1/1)$git remote -v
origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(fetch)
origin
https://git.kernel.org/pub/scm/linux/kernel/git/martineau/linux.git
(push)If you cloned my git.kernel.org repo (which appears to be the case from your 'git remote -v' output), you shouldn't need to apply the patches from email. Instead:
$ git checkout -t origin/mptcp-proposalwill get you the commits directly from the git server.
Just to be specific, to apply the patches from email instead of directly checking out, you would clone
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git and apply the patches to that repository. In addition, I'm not 100% sure 'git am' understands .eml files - the man page for the latest git release mentions maildir, mbox, mboxrd, stgit, stgit-series and hg as supported email formats.Quoted 5 lines
Hope this helps!
Signature · 2 lines
Mat Martineau Intel OTCHi Mat,
For some reason that was not clear to me, anyways I just looked at the patches and I am sorry to say I do not see any thing special about the patch.
For example the patch uses
(quoted diff) +2
-0+ .conn_request = subflow_conn_request, + .syn_recv_sock = subflow_syn_recv_sock,The original implementation used
.conn_request =
mptcp_conn_request,
.syn_recv_sock =tcp_v4_syn_recv_sock,
subflow_syn_recv_sock()callstcp_v4_syn_recv_sock()The patch handles options exactly the same way as they have always been handled. Old implementation had struct
mptcp_request_sockthe patch has structsubflow_request_sock.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
The patch is incomplete as it can not exchange any data using MPTCP. I see no reason to use this approach, we have a working implementation and that should be used and improved upon.
I think the intention with this patchset was to show how the struct prot and exposing MPTCP fully at the socket layer allows to simplify things.
It does not, Look at my patch, compare and post.
I did look at your patchset. This one has ~200 lines of code change in net/ipv4/*.c, a very low impact, yours is >1000. While yours has more functionality this one is simpler, in the sense of having less obvious impact to TCP code.
Quoted 11 lines
Quoted 9 lines
Creation of a real struct socket for subflows is also going to help a lot, as that's the path forward to enable proper lock-separation. We can't take the meta-socket lock in the TCP-stack as I mentioned in my review to your patchset.
So, in that sense for the above two points, the patchset is very useful as it shows how MPTCP fits in such a model.
It does not show anything because it does nothing.
I beg to differ. The point of this patchset is to show, not do. We had direct feedback from the netdev maintainers that "something like KCM" would be of interest to them, this is an attempt at that.
Regards,
Peter.
Quoted 12 lines
Rao.
Quoted 4 lines
Christoph
_______________________________________________
mptcp mailing list
mptcp(a)lists.01.org
https://lists.01.org/mailman/listinfo/mptcp
Rao Shoaib
Re: [MPTCP] Patch does not apply
Quoted 8 lines · Peter
Quoted 4 lines
Quoted 3 lines
I think the intention with this patchset was to show how the struct prot and exposing MPTCP fully at the socket layer allows to simplify things.
It does not, Look at my patch, compare and post.
I did look at your patchset. This one has ~200 lines of code change in
net/ipv4/*.c, a very low impact, yours is >1000. While yours has more functionality this one is simpler, in the sense of having less obvious impact to TCP code.
Hi Peter,
No offense to you and Mat.
If I were to implement the same level of functionality I would make the same number of changes. I can take RDS code right now and create an MPTCP connection. That is all this patch does.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Creation of a real struct socket for subflows is also going to help a lot, as that's the path forward to enable proper lock-separation. We can't take the meta-socket lock in the TCP-stack as I mentioned in my review to your patchset.
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
So, in that sense for the above two points, the patchset is very useful as it shows how MPTCP fits in such a model.
It does not show anything because it does nothing.
I beg to differ. The point of this patchset is to show, not do. We had direct feedback from the netdev maintainers that "something like KCM" would be of interest to them, this is an attempt at that.
KCM, RDS do not change TCP, they use it, as it is. KCM uses eBPF instead of adding code to TCP. MPTCP requires mucking with TCP processing, there is a lot of difference. If you can use KCM than please use it, even better if eBPF can be used. I am not sure about direct input from upstream. I am aware that a statement was made "maybe we can use KCM" and the response was, that would be great, that is the obvious response because the proposal is to use an existing functionality and it is implied that no mucking with TCP will be done.
The code is not there. I looked at MPTCP specific processing and do not see any change compared to the default implementation. There is talk about creating an interface to push the arguments up, once you keep adding these small changes, we will be where we are. All the interfaces needed are already present and they are very clean. Just look at the Rx path, after my cleanup it literally has no MPTCP specific code. I can even narrow down the branch taken in tcp_v4_rcv.
This is getting personal and controversial so I am going to refrain from any other comment. If you can provide a detailed design doc that sites the issues and the resolution I will be happy to review it. It would also be good to compare the two approaches.
Regards,
Shoaib