Code-removal out of mptcp-net-next
Subsystems (4)
Christoph Paasch
v3 cover Code-removal out of mptcp-net-next
Series removing a lot of code out of mptcp-net-next.
Before:
$ git diff --shortstat 1464193107da..mptcp-net-next/master 54 files changed, 14663 insertions(+), 375 deletions(-)
$ git diff --shortstat 1464193107da..HEAD 50 files changed, 12217 insertions(+), 349 deletions(-)
v3: Minor left-over removals that were missing - identified by Matthieu
v2: Some minor fixes - see notes in the sub-patches 4/12 and 12/12
Christoph Paasch (12):
mptcp: Remove support for DSS-checksums
mptcp: Remove some left-over cruft
mptcp: Remove RPS-recording for flow-steering in MPTCP
mptcp: Remove support for subflow-priorities (aka backup)
mptcp: Remove support for sendpage()
mptcp: Remove reinjection of data across subflows
mptcp: Remove support for TCP SYN-cookies
mptcp: Remove support for TCP Fast Open
mptcp: Remove MPTCP-code out of do_ip_setsockopt
mptcp: Remove scheduler-selection support
mptcp: Remove ndiffports path manager
mptcp: Make path-management no more a module nor selectable through
socketops
include/linux/tcp.h | 15 +- include/net/mptcp.h | 250 +++++++--------------- include/net/netns/mptcp.h | 8 +- include/net/tcp.h | 13 +- include/uapi/linux/if.h | 1 - include/uapi/linux/tcp.h | 1 - net/core/dev.c | 2 +- net/ipv4/Kconfig | 19 -- net/ipv4/af_inet.c | 6 - net/ipv4/ip_sockglue.c | 14 -- net/ipv4/syncookies.c | 47 +---- net/ipv4/tcp.c | 155 +------------- net/ipv4/tcp_fastopen.c | 16 +- net/ipv4/tcp_input.c | 29 +-- net/ipv4/tcp_minisocks.c | 2 +- net/ipv4/tcp_output.c | 3 +- net/ipv6/syncookies.c | 32 +-- net/mptcp/Kconfig | 81 ------- net/mptcp/Makefile | 5 +- net/mptcp/mptcp_ctrl.c | 261 +---------------------- net/mptcp/mptcp_fullmesh.c | 488 ++++++++----------------------------------- net/mptcp/mptcp_input.c | 343 ++---------------------------- net/mptcp/mptcp_ipv4.c | 34 +-- net/mptcp/mptcp_ipv6.c | 34 +-- net/mptcp/mptcp_ndiffports.c | 169 --------------- net/mptcp/mptcp_output.c | 472 ++--------------------------------------- net/mptcp/mptcp_pm.c | 226 -------------------- net/mptcp/mptcp_sched.c | 280 +++---------------------- 28 files changed, 293 insertions(+), 2713 deletions(-) delete mode 100644 net/mptcp/mptcp_ndiffports.c delete mode 100644 net/mptcp/mptcp_pm.c
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 1/12 mptcp: Remove support for DSS-checksums
To reduce the code-size and complexity, we remove support for DSS-checksums. If we receive a MP_CAPABLE with a DSS-checksum we simply fallback to regular TCP.
--- include/linux/tcp.h | 3 +- include/net/mptcp.h | 31 ++------ net/mptcp/mptcp_ctrl.c | 16 ----- net/mptcp/mptcp_input.c | 184 ++--------------------------------------------- net/mptcp/mptcp_output.c | 69 ++---------------- 5 files changed, 17 insertions(+), 286 deletions(-)
include/linux/tcp.h +1 -2
@@ -94,8 +94,7 @@ struct tcp_out_options {struct tcp_fastopen_cookie *fastopen_cookie;/* Fast open cookie */ #ifdef CONFIG_MPTCP u16 mptcp_options;/* bit field of MPTCP related OPTION_* */ - u8 dss_csum:1, /* dss-checksum required? */ - add_addr_v4:1, + u8 add_addr_v4:1, add_addr_v6:1, mptcp_ver:4;
include/net/mptcp.h +6 -25
@@ -102,8 +102,7 @@ struct mptcp_request_sock {u8 loc_id;u8 rem_id;/* Address-id in the MP_JOIN */ - u8 dss_csum:1, - is_sub:1, /* Is this a new subflow? */ + u8 is_sub:1, /* Is this a new subflow? */ low_prio:1, /* Interface set to low-prio? */ rcv_low_prio:1, mptcp_ver:4;
@@ -111,7 +110,6 @@ struct mptcp_request_sock {struct mptcp_options_received {u16 saw_mpc:1 , - dss_csum:1 , drop_me:1 , is_mp_join:1,
@@ -168,7 +166,6 @@ struct mptcp_tcp_sock { fully_established:1, second_packet:1, attached:1, - send_mp_fail:1, include_mpc:1, mapping_present:1, map_data_fin:1,
@@ -269,7 +266,6 @@ struct mptcp_cb { in_time_wait:1, list_rcvd:1, /* XXX TO REMOVE */ addr_signal:1, /* Path-manager wants us to call addr_signal */ - dss_csum:1, server_side:1, infinite_mapping_rcv:1, infinite_mapping_snd:1,
@@ -288,7 +284,6 @@ struct mptcp_cb {* accessed. Thus, the whole data-path is on a single cache-line. */ -u64 csum_cutoff_seq;u64 infinite_rcv_seq;/***** Start of fields, used for connection closure */
@@ -364,11 +359,9 @@ struct mptcp_cb {* To get the total length, just add the different options together. */ #define MPTCP_SUB_LEN_SEQ 10 -#define MPTCP_SUB_LEN_SEQ_CSUM 12#define MPTCP_SUB_LEN_SEQ_ALIGN 12#define MPTCP_SUB_LEN_SEQ_64 14 -#define MPTCP_SUB_LEN_SEQ_CSUM_64 16#define MPTCP_SUB_LEN_SEQ_64_ALIGN 16#define MPTCP_SUB_LEN_ACK 4
@@ -434,10 +427,9 @@ extern bool mptcp_init_failed;#define OPTION_DATA_ACK (1 << 4)#define OPTION_ADD_ADDR (1 << 5)#define OPTION_MP_JOIN (1 << 6) -#define OPTION_MP_FAIL (1 << 7) -#define OPTION_MP_FCLOSE (1 << 8) -#define OPTION_REMOVE_ADDR (1 << 9) -#define OPTION_MP_PRIO (1 << 10) +#define OPTION_MP_FCLOSE (1 << 7) +#define OPTION_REMOVE_ADDR (1 << 8) +#define OPTION_MP_PRIO (1 << 9)/* MPTCP flags: both TX and RX */ #define MPTCPHDR_SEQ 0x01/* DSS.M option is present */
@@ -447,7 +439,6 @@ extern bool mptcp_init_failed;#define MPTCPHDR_ACK 0x08#define MPTCPHDR_SEQ64_SET 0x10/* Did we received a 64-bit seq number? */ #define MPTCPHDR_SEQ64_OFO 0x20/* Is it not in our circular array? */ -#define MPTCPHDR_DSS_CSUM 0x40/* MPTCP flags: TX only */ #define MPTCPHDR_INF 0x08#define MPTCP_REINJECT 0x10/* Did we reinject this segment? */
@@ -640,16 +631,15 @@ struct mp_prio {__u8 addr_id; } __attribute__((__packed__)); -static inline int mptcp_sub_len_dss (const struct mp_dss *m,const int csum) +static inline int mptcp_sub_len_dss (const struct mp_dss *m) { -return 4 + m->A * (4 + m->a *4 ) + m->M * (10 + m->m *4 + csum *2 ); +return 4 + m->A * (4 + m->a *4 ) + m->M * (10 + m->m *4 ); }#define MPTCP_SYSCTL 1extern int sysctl_mptcp_enabled;extern int sysctl_mptcp_version; -extern int sysctl_mptcp_checksum;extern int sysctl_mptcp_debug;extern int sysctl_mptcp_syn_retries;
@@ -693,10 +683,8 @@ enumMPTCP_MIB_MPCAPABLEPASSIVEFALLBACK ,/* Server-side fallback during 3-way handshake */ MPTCP_MIB_MPCAPABLEACTIVEFALLBACK ,/* Client-side fallback during 3-way handshake */ MPTCP_MIB_MPCAPABLERETRANSFALLBACK ,/* Client-side stopped sending MP_CAPABLE after too many SYN-retransmissions */ -MPTCP_MIB_CSUMENABLED ,/* Created MPTCP-connection with DSS-checksum enabled */ MPTCP_MIB_RETRANSSEGS ,/* Segments retransmitted at the MPTCP-level */ MPTCP_MIB_MPFAILRX ,/* Received an MP_FAIL */ -MPTCP_MIB_CSUMFAIL ,/* Received segment with invalid checksum */ MPTCP_MIB_FASTCLOSERX ,/* Recevied a FAST_CLOSE */ MPTCP_MIB_FASTCLOSETX ,/* Sent a FAST_CLOSE */ MPTCP_MIB_FBACKSUB, /* Fallback upon ack without data-ack on new subflow */
@@ -921,9 +909,6 @@ static inline bool mptcp_can_sendpage(struct sock *sk) {struct mptcp_tcp_sock *mptcp; -if (tcp_sk (sk)->mpcb->dss_csum) -return false; -mptcp_for_each_sub (tcp_sk (sk)->mpcb, mptcp) {struct sock *sk_it =mptcp_to_sock (mptcp);
@@ -1058,7 +1043,6 @@ static inline int is_master_tp(const struct tcp_sock *tp)static inline void mptcp_init_mp_opt (struct mptcp_options_received *mopt) { mopt->saw_mpc =0 ; - mopt->dss_csum =0 ; mopt->drop_me =0 ; mopt->is_mp_join =0 ;
@@ -1153,9 +1137,6 @@ static inline bool mptcp_can_sg(const struct sock *meta_sk) {struct mptcp_tcp_sock *mptcp; -if (tcp_sk (meta_sk)->mpcb->dss_csum) -return false; -mptcp_for_each_sub (tcp_sk (meta_sk)->mpcb, mptcp) {struct sock *sk =mptcp_to_sock (mptcp);
net/mptcp/mptcp_ctrl.c +0 -16
@@ -30,7 +30,6 @@#include <net/inet_common.h> #include <net/inet6_hashtables.h> #include <net/ipv6.h> -#include <net/ip6_checksum.h> #include <net/mptcp.h> #include <net/mptcp_v4.h> #if IS_ENABLED (CONFIG_IPV6 )
@@ -67,7 +66,6 @@ int sysctl_mptcp_enabled __read_mostly = 1;int sysctl_mptcp_version__read_mostly =0 ;static int min_mptcp_version;static int max_mptcp_version =1 ; -int sysctl_mptcp_checksum__read_mostly =1 ;int sysctl_mptcp_debug__read_mostly ;EXPORT_SYMBOL (sysctl_mptcp_debug);int sysctl_mptcp_syn_retries__read_mostly =3 ;
@@ -132,13 +130,6 @@ static struct ctl_table mptcp_table[] = { .extra1 = &min_mptcp_version, .extra2 = &max_mptcp_version, }, - { - .procname = "mptcp_checksum", - .data = &sysctl_mptcp_checksum, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = &proc_dointvec - }, { .procname = "mptcp_debug", .data = &sysctl_mptcp_debug,
@@ -2078,7 +2069,6 @@ static int __mptcp_check_req_master(struct sock *child, child_tp->mptcp->snt_isn =tcp_rsk (req)->snt_isn; child_tp->mptcp->rcv_isn =tcp_rsk (req)->rcv_isn; - mpcb->dss_csum = mtreq->dss_csum; mpcb->server_side =1 ;/* Needs to be done here additionally, because when accepting a
@@ -2457,13 +2447,10 @@ void mptcp_reqsk_init(struct request_sock *req, const struct sock *sk, const struct sk_buff *skb, bool want_cookie) {struct mptcp_options_received mopt; -struct mptcp_request_sock *mtreq =mptcp_rsk (req);mptcp_init_mp_opt (&mopt);tcp_parse_mptcp_options (skb, &mopt); - mtreq->dss_csum = mopt.dss_csum; -if (want_cookie) {if (!mptcp_reqsk_new_cookie (req, sk, &mopt, skb))/* No key available - back to regular TCP */
@@ -2500,7 +2487,6 @@ void mptcp_cookies_reqsk_init(struct request_sock *req,inet_rsk (req)->saw_mpc =1 ; mtreq->is_sub =0 ;inet_rsk (req)->mptcp_rqsk =1 ; - mtreq->dss_csum = mopt->dss_csum; out:spin_unlock (&mptcp_tk_hashlock);
@@ -2771,10 +2757,8 @@ static const struct snmp_mib mptcp_snmp_list[] = {SNMP_MIB_ITEM ("MPCapableFallbackACK" ,MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK ),SNMP_MIB_ITEM ("MPCapableFallbackSYNACK" ,MPTCP_MIB_MPCAPABLEACTIVEFALLBACK ),SNMP_MIB_ITEM ("MPCapableRetransFallback" ,MPTCP_MIB_MPCAPABLERETRANSFALLBACK ), -SNMP_MIB_ITEM ("MPTCPCsumEnabled" ,MPTCP_MIB_CSUMENABLED ),SNMP_MIB_ITEM ("MPTCPRetrans" ,MPTCP_MIB_RETRANSSEGS ),SNMP_MIB_ITEM ("MPFailRX" ,MPTCP_MIB_MPFAILRX ), -SNMP_MIB_ITEM ("MPCsumFail" ,MPTCP_MIB_CSUMFAIL ),SNMP_MIB_ITEM ("MPFastcloseRX" ,MPTCP_MIB_FASTCLOSERX ),SNMP_MIB_ITEM ("MPFastcloseTX" ,MPTCP_MIB_FASTCLOSETX ), SNMP_MIB_ITEM("MPFallbackAckSub", MPTCP_MIB_FBACKSUB),
net/mptcp/mptcp_input.c +5 -179
244 lines not on this page · raw message
net/mptcp/mptcp_output.c +5 -64
147 lines not on this page · raw message
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 2/12 mptcp: Remove some left-over cruft
In reply to Christoph PaaschThe MPTCP-congestion controls have been removed. This here is a left-over.
--- net/ipv4/Kconfig | 19 ------------------- 1 file changed, 19 deletions(-)
net/ipv4/Kconfig +0 -19
@@ -717,21 +717,6 @@ choice config DEFAULT_BBR bool "BBR" if TCP_CONG_BBR=y - config DEFAULT_LIA - bool "Lia" if TCP_CONG_LIA=y - - config DEFAULT_OLIA - bool "Olia" if TCP_CONG_OLIA=y - - config DEFAULT_WVEGAS - bool "Wvegas" if TCP_CONG_WVEGAS=y - - config DEFAULT_BALIA - bool "Balia" if TCP_CONG_BALIA=y - - config DEFAULT_MCTCPDESYNC - bool "Mctcpdesync (EXPERIMENTAL)" if TCP_CONG_MCTCPDESYNC=y - config DEFAULT_RENO bool "Reno" endchoice
@@ -752,10 +737,6 @@ config DEFAULT_TCP_CONG default "vegas" if DEFAULT_VEGAS default "westwood" if DEFAULT_WESTWOOD default "veno" if DEFAULT_VENO - default "lia" if DEFAULT_LIA - default "olia" if DEFAULT_OLIA - default "wvegas" if DEFAULT_WVEGAS - default "balia" if DEFAULT_BALIA default "reno" if DEFAULT_RENO default "dctcp" if DEFAULT_DCTCP default "cdg" if DEFAULT_CDG
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 3/12 mptcp: Remove RPS-recording for flow-steering in MPTCP
In reply to Christoph PaaschIt's an optimization. We don't need it!
--- net/ipv4/af_inet.c | 6 ------ net/ipv4/tcp.c | 34 ---------------------------------- 2 files changed, 40 deletions(-)
net/ipv4/af_inet.c +0 -6
@@ -744,12 +744,6 @@ int inet_accept(struct socket *sock, struct socket *newsock, int flags,sock_rps_record_flow (sk2);if (sk2->sk_protocol ==IPPROTO_TCP &&mptcp (tcp_sk (sk2))) { -struct mptcp_tcp_sock *mptcp; - -mptcp_for_each_sub (tcp_sk (sk2)->mpcb, mptcp) { -sock_rps_record_flow (mptcp_to_sock (mptcp)); - } -if (tcp_sk (sk2)->mpcb->master_sk) {struct sock *sk_it =tcp_sk (sk2)->mpcb->master_sk;
net/ipv4/tcp.c +0 -34
@@ -821,16 +821,6 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,lock_sock (sk); -#ifdef CONFIG_MPTCP -if (mptcp (tcp_sk (sk))) { -struct mptcp_tcp_sock *mptcp; - -mptcp_for_each_sub (tcp_sk (sk)->mpcb, mptcp) { -sock_rps_record_flow (mptcp_to_sock (mptcp)); - } - } -#endif - timeo =sock_rcvtimeo (sk, sock->file->f_flags &O_NONBLOCK );while (tss.len) { ret =__tcp_splice_read (sk, &tss);
@@ -995,8 +985,6 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, }if (mptcp (tp)) { -struct mptcp_tcp_sock *mptcp; -/* We must check this with socket-lock hold because we iterate * over the subflows. */
@@ -1009,10 +997,6 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,lock_sock (sk);return ret; } - -mptcp_for_each_sub (tp->mpcb, mptcp) { -sock_rps_record_flow (mptcp_to_sock (mptcp)); - } }sk_clear_bit (SOCKWQ_ASYNC_NOSPACE , sk);
@@ -1290,14 +1274,6 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) goto do_error; } -if (mptcp (tp)) { -struct mptcp_tcp_sock *mptcp; - -mptcp_for_each_sub (tp->mpcb, mptcp) { -sock_rps_record_flow (mptcp_to_sock (mptcp)); - } - } -if (unlikely (tp->repair)) {if (tp->repair_queue ==TCP_RECV_QUEUE ) { copied =tcp_send_rcvq (sk, msg, size);
@@ -2022,16 +1998,6 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,lock_sock (sk); -#ifdef CONFIG_MPTCP -if (mptcp (tp)) { -struct mptcp_tcp_sock *mptcp; - -mptcp_for_each_sub (tp->mpcb, mptcp) { -sock_rps_record_flow (mptcp_to_sock (mptcp)); - } - } -#endif - err = -ENOTCONN ;if (sk->sk_state ==TCP_LISTEN ) goto out;
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 4/12 mptcp: Remove support for subflow-priorities (aka backup)
In reply to Christoph Paasch---
Notes:
v2: * Make sure that we detect NETDEV_CHANGE events unsetting the IFF_NOMULTIPATH flag
include/linux/tcp.h | 1 - include/net/mptcp.h | 43 +----------- include/uapi/linux/if.h | 1 - net/core/dev.c | 2 +- net/mptcp/mptcp_ctrl.c | 6 -- net/mptcp/mptcp_fullmesh.c | 154 +++++++++++-------------------------------- net/mptcp/mptcp_input.c | 36 ---------- net/mptcp/mptcp_ipv4.c | 5 +- net/mptcp/mptcp_ipv6.c | 5 +- net/mptcp/mptcp_ndiffports.c | 4 +- net/mptcp/mptcp_output.c | 27 +------- net/mptcp/mptcp_pm.c | 2 +- net/mptcp/mptcp_sched.c | 29 +------- 13 files changed, 49 insertions(+), 266 deletions(-)
include/linux/tcp.h +0 -1
@@ -109,7 +109,6 @@ struct tcp_out_options {__u32 sender_nonce;/* random number of the sender */ __u32 token;/* token for mptcp */ - u8 low_prio:1; } mp_join_syns; };
include/net/mptcp.h +1 -42
117 lines not on this page · raw message
include/uapi/linux/if.h +0 -1
@@ -133,7 +133,6 @@ enum net_device_flags {#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ #define IFF_NOMULTIPATH 0x80000/* Disable for MPTCP */ -#define IFF_MPBACKUP 0x100000/* Use as backup path for MPTCP */ #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\ IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
net/core/dev.c +1 -1
@@ -7487,7 +7487,7 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags) dev->flags = (flags & (IFF_DEBUG |IFF_NOTRAILERS |IFF_NOARP |IFF_DYNAMIC |IFF_MULTICAST |IFF_PORTSEL | -IFF_AUTOMEDIA |IFF_NOMULTIPATH |IFF_MPBACKUP )) | +IFF_AUTOMEDIA |IFF_NOMULTIPATH )) | (dev->flags & (IFF_UP |IFF_VOLATILE |IFF_PROMISC |IFF_ALLMULTI ));
net/mptcp/mptcp_ctrl.c +0 -6
@@ -2217,11 +2217,6 @@ struct sock *mptcp_check_req_child(struct sock *meta_sk, goto teardown; } -/* The child is a clone of the meta socket, we must now reset -* some of the fields -*/ - child_tp->mptcp->rcv_low_prio = mtreq->rcv_low_prio; -/* We should allow proper increase of the snd/rcv-buffers. Thus, we * use the original values instead of the bloated up ones from the * clone.
@@ -2437,7 +2432,6 @@ void mptcp_join_reqsk_init(const struct mptcp_cb *mpcb, mtreq->mptcp_hash_tmac = *(u64 *)mptcp_hash_mac; mtreq->rem_id = mopt.rem_id; - mtreq->rcv_low_prio = mopt.low_prio;inet_rsk (req)->saw_mpc =1 ;MPTCP_INC_STATS (sock_net (mpcb->meta_sk),MPTCP_MIB_JOINSYNRX );
net/mptcp/mptcp_fullmesh.c +38 -116
325 lines not on this page · raw message
net/mptcp/mptcp_input.c +0 -36
@@ -1503,14 +1503,12 @@ void mptcp_parse_options(const uint8_t *ptr, int opsize,case MPTCP_SUB_LEN_JOIN_SYN : mopt->is_mp_join =1 ; mopt->saw_mpc =1 ; - mopt->low_prio = mpjoin->b; mopt->rem_id = mpjoin->addr_id; mopt->mptcp_rem_token = mpjoin->u.syn.token; mopt->mptcp_recv_nonce = mpjoin->u.syn.nonce;break ;case MPTCP_SUB_LEN_JOIN_SYNACK : mopt->saw_mpc =1 ; - mopt->low_prio = mpjoin->b; mopt->rem_id = mpjoin->addr_id; mopt->mptcp_recv_tmac = mpjoin->u.synack.mac; mopt->mptcp_recv_nonce = mpjoin->u.synack.nonce;
@@ -1613,26 +1611,6 @@ void mptcp_parse_options(const uint8_t *ptr, int opsize, mopt->saw_rem_addr =1 ; mopt->rem_addr_ptr = ptr;break ; -case MPTCP_SUB_PRIO : - { -const struct mp_prio *mpprio = (struct mp_prio *)ptr; - -if (opsize !=MPTCP_SUB_LEN_PRIO && - opsize !=MPTCP_SUB_LEN_PRIO_ADDR ) { -mptcp_debug ("%s: mp_prio: bad option size %d\n" , - __func__, opsize); -break ; - } - - mopt->saw_low_prio =1 ; - mopt->low_prio = mpprio->b; - -if (opsize ==MPTCP_SUB_LEN_PRIO_ADDR ) { - mopt->saw_low_prio =2 ; - mopt->prio_addr_id = mpprio->addr_id; - } -break ; - }case MPTCP_SUB_FAIL :if (opsize !=MPTCP_SUB_LEN_FAIL ) { mptcp_debug("%s: mp_fail: bad option size %d\n",
@@ -1963,19 +1941,6 @@ bool mptcp_handle_options(struct sock *sk, const struct tcphdr *th, mopt->more_rem_addr =0 ; mopt->saw_rem_addr =0 ; } -if (mopt->saw_low_prio) { -if (mopt->saw_low_prio ==1 ) { - tp->mptcp->rcv_low_prio = mopt->low_prio; - }else { -struct mptcp_tcp_sock *mptcp; - -mptcp_for_each_sub (tp->mpcb, mptcp) { -if (mptcp->rem_id == mopt->prio_addr_id) - mptcp->rcv_low_prio = mopt->low_prio; - } - } - mopt->saw_low_prio =0 ; - }mptcp_data_ack (sk, skb);
@@ -2077,7 +2042,6 @@ int mptcp_rcv_synsent_state_process(struct sock *sk, struct sock **skptr,* until the 4th ack arrives. */ tp->mptcp->pre_established =1 ; - tp->mptcp->rcv_low_prio = tp->mptcp->rx_opt.low_prio; mptcp_hmac_sha1((u8 *)&mpcb->mptcp_loc_key, (u8 *)&mpcb->mptcp_rem_key,
net/mptcp/mptcp_ipv4.c +1 -4
@@ -104,7 +104,6 @@ static int mptcp_v4_join_init_req(struct request_sock *req, const struct sock *mconst struct mptcp_cb *mpcb =tcp_sk (meta_sk)->mpcb;union inet_addr addr;int loc_id; -bool low_prio = false;/* We need to do this as early as possible. Because, if we fail later * (e.g., get_local_id), then reqsk_free tries to remove the
@@ -120,11 +119,10 @@ static int mptcp_v4_join_init_req(struct request_sock *req, const struct sock *mtcp_hdr (skb)->source, tcp_hdr(skb)->dest); addr.ip =inet_rsk (req)->ir_loc_addr; - loc_id = mpcb->pm_ops->get_local_id (AF_INET , &addr,sock_net (meta_sk), &low_prio); + loc_id = mpcb->pm_ops->get_local_id (AF_INET , &addr,sock_net (meta_sk));if (loc_id ==-1 )return -1 ; mtreq->loc_id = loc_id; - mtreq->low_prio = low_prio;mptcp_join_reqsk_init (mpcb, req, skb);
@@ -292,7 +290,6 @@ int mptcp_init4_subsockets(struct sock *meta_sk, const struct mptcp_loc4 *loc, } tp->mptcp->slave_sk =1 ; - tp->mptcp->low_prio = loc->low_prio;/* Initializing the timer for an MPTCP subflow */ timer_setup (&tp->mptcp->mptcp_ack_timer, mptcp_ack_handler,0 );
net/mptcp/mptcp_ipv6.c +1 -4
@@ -133,7 +133,6 @@ static int mptcp_v6_join_init_req(struct request_sock *req, const struct sock *mconst struct mptcp_cb *mpcb =tcp_sk (meta_sk)->mpcb;union inet_addr addr;int loc_id; -bool low_prio = false;/* We need to do this as early as possible. Because, if we fail later * (e.g., get_local_id), then reqsk_free tries to remove the
@@ -149,11 +148,10 @@ static int mptcp_v6_join_init_req(struct request_sock *req, const struct sock *mtcp_hdr (skb)->source, tcp_hdr(skb)->dest); addr.in6 =inet_rsk (req)->ir_v6_loc_addr; - loc_id = mpcb->pm_ops->get_local_id (AF_INET6 , &addr,sock_net (meta_sk), &low_prio); + loc_id = mpcb->pm_ops->get_local_id (AF_INET6 , &addr,sock_net (meta_sk));if (loc_id ==-1 )return -1 ; mtreq->loc_id = loc_id; - mtreq->low_prio = low_prio;mptcp_join_reqsk_init (mpcb, req, skb);
@@ -319,7 +317,6 @@ int mptcp_init6_subsockets(struct sock *meta_sk, const struct mptcp_loc6 *loc, } tp->mptcp->slave_sk =1 ; - tp->mptcp->low_prio = loc->low_prio;/* Initializing the timer for an MPTCP subflow */ timer_setup (&tp->mptcp->mptcp_ack_timer, mptcp_ack_handler,0 );
net/mptcp/mptcp_ndiffports.c +1 -3
@@ -61,7 +61,6 @@ static void create_subflow_worker(struct work_struct *work) loc.addr.s_addr =inet_sk (meta_sk)->inet_saddr; loc.loc4_id =0 ; - loc.low_prio =0 ;if (mpcb->master_sk) loc.if_idx = mpcb->master_sk->sk_bound_dev_if;else
@@ -79,7 +78,6 @@ static void create_subflow_worker(struct work_struct *work) loc.addr =inet6_sk (meta_sk)->saddr; loc.loc6_id =0 ; - loc.low_prio =0 ;if (mpcb->master_sk) loc.if_idx = mpcb->master_sk->sk_bound_dev_if;else
@@ -128,7 +126,7 @@ static void ndiffports_create_subflows(struct sock *meta_sk) }static int ndiffports_get_local_id (sa_family_t family,union inet_addr *addr, -struct net *net,bool *low_prio) +struct net *net) {return 0 ; }
net/mptcp/mptcp_output.c +2 -25
@@ -960,7 +960,6 @@ void mptcp_syn_options(const struct sock *sk, struct tcp_out_options *opts, opts->mptcp_options |=OPTION_MP_JOIN |OPTION_TYPE_SYN ; *remaining -=MPTCP_SUB_LEN_JOIN_SYN_ALIGN ; opts->mp_join_syns.token = mpcb->mptcp_rem_token; - opts->mp_join_syns.low_prio = tp->mptcp->low_prio; opts->addr_id = tp->mptcp->loc_id; opts->mp_join_syns.sender_nonce = tp->mptcp->mptcp_loc_nonce; }
@@ -984,7 +983,6 @@ void mptcp_synack_options(struct request_sock *req, opts->mp_join_syns.sender_truncated_mac = mtreq->mptcp_hash_tmac; opts->mp_join_syns.sender_nonce = mtreq->mptcp_loc_nonce; - opts->mp_join_syns.low_prio = mtreq->low_prio; opts->addr_id = mtreq->loc_id; *remaining -=MPTCP_SUB_LEN_JOIN_SYNACK_ALIGN ; }
@@ -1085,15 +1083,6 @@ void mptcp_established_options(struct sock *sk, struct sk_buff *skb, mpcb->mptcp_ver < MPTCP_VERSION_1) mpcb->pm_ops->addr_signal (sk, size, opts, skb); -if (unlikely (tp->mptcp->send_mp_prio) && -MAX_TCP_OPTION_SPACE - *size >=MPTCP_SUB_LEN_PRIO_ALIGN ) { - opts->options |=OPTION_MPTCP ; - opts->mptcp_options |=OPTION_MP_PRIO ; -if (skb) - tp->mptcp->send_mp_prio =0 ; - *size +=MPTCP_SUB_LEN_PRIO_ALIGN ; - } -return ; }
@@ -1149,7 +1138,7 @@ void mptcp_options_write(__be32 *ptr, struct tcp_sock *tp, mpj->len =MPTCP_SUB_LEN_JOIN_SYN ; mpj->u.syn.token = opts->mp_join_syns.token; mpj->u.syn.nonce = opts->mp_join_syns.sender_nonce; - mpj->b = opts->mp_join_syns.low_prio; + mpj->b =0 ; mpj->addr_id = opts->addr_id; ptr +=MPTCP_SUB_LEN_JOIN_SYN_ALIGN >>2 ; }else if (OPTION_TYPE_SYNACK & opts->mptcp_options) {
@@ -1157,7 +1146,7 @@ void mptcp_options_write(__be32 *ptr, struct tcp_sock *tp, mpj->u.synack.mac = opts->mp_join_syns.sender_truncated_mac; mpj->u.synack.nonce = opts->mp_join_syns.sender_nonce; - mpj->b = opts->mp_join_syns.low_prio; + mpj->b =0 ; mpj->addr_id = opts->addr_id; ptr +=MPTCP_SUB_LEN_JOIN_SYNACK_ALIGN >>2 ; }else if (OPTION_TYPE_ACK & opts->mptcp_options) {
@@ -1252,18 +1241,6 @@ void mptcp_options_write(__be32 *ptr, struct tcp_sock *tp,else ptr +=mptcp_write_dss_data_seq (tp, skb, ptr); } -if (unlikely (OPTION_MP_PRIO & opts->mptcp_options)) { -struct mp_prio *mpprio = (struct mp_prio *)ptr; - - mpprio->kind =TCPOPT_MPTCP ; - mpprio->len =MPTCP_SUB_LEN_PRIO ; - mpprio->sub =MPTCP_SUB_PRIO ; - mpprio->rsv =0 ; - mpprio->b = tp->mptcp->low_prio; - mpprio->addr_id =TCPOPT_NOP ; - - ptr +=MPTCP_SUB_LEN_PRIO_ALIGN >>2 ; - } }/* Sends the datafin */
net/mptcp/mptcp_pm.c +1 -1
@@ -35,7 +35,7 @@ static DEFINE_SPINLOCK(mptcp_pm_list_lock);static LIST_HEAD (mptcp_pm_list);static int mptcp_default_id (sa_family_t family,union inet_addr *addr, -struct net *net,bool *low_prio) +struct net *net) {return 0 ; }
net/mptcp/mptcp_sched.c +3 -26
@@ -113,22 +113,11 @@ static int mptcp_dont_reinject_skb(const struct tcp_sock *tp, const struct sk_bumptcp_pi_to_flag (tp->mptcp->path_index) &TCP_SKB_CB (skb)->path_mask; } -static bool subflow_is_backup (const struct tcp_sock *tp) -{ -return tp->mptcp->rcv_low_prio || tp->mptcp->low_prio; -} - -static bool subflow_is_active (const struct tcp_sock *tp) -{ -return !tp->mptcp->rcv_low_prio && !tp->mptcp->low_prio; -} -/* Generic function to iterate over used and unused subflows and to select the * best one */ static struct sock *get_subflow_from_selectors (struct mptcp_cb *mpcb,struct sk_buff *skb, -bool (*selector)(const struct tcp_sock *),bool zero_wnd_test,bool *force) {struct sock *bestsk =NULL ;
@@ -142,10 +131,6 @@ static struct sockstruct tcp_sock *tp =tcp_sk (sk);bool unused = false; -/* First, we choose only the wanted sks */ -if (!(*selector)(tp)) -continue ; -if (!mptcp_dont_reinject_skb (tp, skb)) unused = true;else if (found_unused)
@@ -206,8 +191,6 @@ static struct sock* a given MSS. If all subflows are found to be busy, NULL is returned * The flow is selected based on the shortest RTT. * If all paths have full cong windows, we simply return NULL. -* -* Additionally, this function is aware of the backup-subflows. */ static struct sock *get_available_subflow(struct sock *meta_sk, struct sk_buff *skb,
@@ -233,22 +216,16 @@ static struct sock *get_available_subflow(struct sock *meta_sk,/* Find the best subflow */ restart: - sk =get_subflow_from_selectors (mpcb, skb, &subflow_is_active, - zero_wnd_test, &force); + sk =get_subflow_from_selectors (mpcb, skb, zero_wnd_test, &force);if (force)/* one unused active sk or one NULL sk when there is at least * one temporally unavailable unused active sk */ return sk; - sk =get_subflow_from_selectors (mpcb, skb, &subflow_is_backup, - zero_wnd_test, &force);if (!force && skb) { -/* one used backup sk or one NULL sk where there is no one -* temporally unavailable unused backup sk -* -* the skb passed through all the available active and backups -* sks, so clean the path mask +/* the skb passed through all the available subflows, so clean +* the path mask. */ TCP_SKB_CB (skb)->path_mask =0 ;
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 5/12 mptcp: Remove support for sendpage()
In reply to Christoph Paasch--- include/net/mptcp.h | 18 ------------------ net/ipv4/tcp.c | 21 ++------------------- 2 files changed, 2 insertions(+), 37 deletions(-)
include/net/mptcp.h +0 -18
@@ -868,20 +868,6 @@ struct request_sock *rev_mptcp_rsk(const struct mptcp_request_sock *req)return (struct request_sock *)req; } -static inline bool mptcp_can_sendpage (struct sock *sk) -{ -struct mptcp_tcp_sock *mptcp; - -mptcp_for_each_sub (tcp_sk (sk)->mpcb, mptcp) { -struct sock *sk_it =mptcp_to_sock (mptcp); - -if (!(sk_it->sk_route_caps &NETIF_F_SG )) -return false; - } - -return true; -} -static inline void mptcp_push_pending_frames (struct sock *meta_sk) {/* We check packets out and send-head here. TCP only checks the
@@ -1366,10 +1352,6 @@ static inline int mptcp_rcv_synsent_state_process(struct sock *sk, {return 0 ; } -static inline bool mptcp_can_sendpage (struct sock *sk) -{ -return false; -}static inline int mptcp_init_tw_sock (struct sock *sk,struct tcp_timewait_sock *tw) {
net/ipv4/tcp.c +2 -19
@@ -977,28 +977,12 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,* is fully established. */ if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED |TCPF_CLOSE_WAIT )) && - !tcp_passive_fastopen (mptcp (tp) && tp->mpcb->master_sk ? - tp->mpcb->master_sk : sk)) { + !tcp_passive_fastopen (sk)) { err =sk_stream_wait_connect (sk, &timeo);if (err !=0 ) goto out_err; } -if (mptcp (tp)) { -/* We must check this with socket-lock hold because we iterate -* over the subflows. -*/ -if (!mptcp_can_sendpage (sk)) { -ssize_t ret; - -release_sock (sk); - ret =sock_no_sendpage (sk->sk_socket, page, offset, - size, flags); -lock_sock (sk); -return ret; - } - } -sk_clear_bit (SOCKWQ_ASYNC_NOSPACE , sk); mss_now =tcp_send_mss (sk, &size_goal, flags);
@@ -1117,8 +1101,7 @@ EXPORT_SYMBOL_GPL(do_tcp_sendpages);int tcp_sendpage_locked (struct sock *sk,struct page *page,int offset,size_t size,int flags) { -/* If MPTCP is enabled, we check it later after establishment */ -if (!mptcp (tcp_sk (sk)) && !(sk->sk_route_caps &NETIF_F_SG )) +if (!(sk->sk_route_caps &NETIF_F_SG ) ||mptcp (tcp_sk (sk)))return sock_no_sendpage_locked (sk, page, offset, size, flags);tcp_rate_check_app_limited (sk);/* is sending application-limited? */
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 6/12 mptcp: Remove reinjection of data across subflows
In reply to Christoph PaaschIt's an "optimisation" that we don't need in net-next.
--- include/linux/tcp.h | 3 - include/net/mptcp.h | 9 -- net/mptcp/mptcp_ctrl.c | 10 +- net/mptcp/mptcp_fullmesh.c | 12 -- net/mptcp/mptcp_input.c | 20 +-- net/mptcp/mptcp_output.c | 358 +-------------------------------------------- net/mptcp/mptcp_sched.c | 32 ++-- 7 files changed, 21 insertions(+), 423 deletions(-)
include/linux/tcp.h +0 -3
@@ -470,9 +470,6 @@ struct tcp_sock { request_mptcp:1, /* Did we send out an MP_CAPABLE? * (this speeds up mptcp_doit() in tcp_recvmsg) */ - pf:1, /* Potentially Failed state: when this flag is set, we - * stop using the subflow - */ mp_killed:1, /* Killed with a tcp_done in mptcp? */ was_meta_sk:1, /* This was a meta sk (in case of reuse) */ is_master_sk:1,
include/net/mptcp.h +0 -9
@@ -265,12 +265,6 @@ struct mptcp_cb {u8 mptcp_sched[MPTCP_SCHED_DATA_SIZE ]__aligned(8) ;struct mptcp_sched_ops *sched_ops; -struct sk_buff_head reinject_queue; -/* First cache-line boundary is here minus 8 bytes. But from the -* reinject-queue only the next and prev pointers are regularly -* accessed. Thus, the whole data-path is on a single cache-line. -*/ -u64 infinite_rcv_seq;/***** Start of fields, used for connection closure */
@@ -421,7 +415,6 @@ extern bool mptcp_init_failed;#define MPTCPHDR_SEQ64_OFO 0x20/* Is it not in our circular array? */ /* MPTCP flags: TX only */ #define MPTCPHDR_INF 0x08 -#define MPTCP_REINJECT 0x10/* Did we reinject this segment? */ struct mptcp_option {__u8 kind;
@@ -719,7 +712,6 @@ int mptcp_add_sock(struct sock *meta_sk, struct sock *sk, u8 loc_id, u8 rem_id, gfp_t flags);void mptcp_del_sock (struct sock *sk);void mptcp_update_metasocket (const struct sock *meta_sk); -void mptcp_reinject_data (struct sock *orig_sk,int clone_it);void mptcp_update_sndbuf (const struct tcp_sock *tp);void mptcp_send_fin (struct sock *meta_sk);void mptcp_send_active_reset (struct sock *meta_sk,gfp_t priority);
@@ -1256,7 +1248,6 @@ static inline int is_master_tp(const struct tcp_sock *tp) }static inline void mptcp_del_sock (const struct sock *sk) {}static inline void mptcp_update_metasocket (const struct sock *meta_sk) {} -static inline void mptcp_reinject_data (struct sock *orig_sk,int clone_it) {}static inline void mptcp_update_sndbuf (const struct tcp_sock *tp) {}static inline void mptcp_clean_rtx_infinite (const struct sk_buff *skb,const struct sock *sk) {}
net/mptcp/mptcp_ctrl.c +1 -9
@@ -561,7 +561,7 @@ struct sock *mptcp_select_ack_sock(const struct sock *meta_sk)struct tcp_sock *tp =tcp_sk (sk);u32 elapsed; -if (!mptcp_sk_can_send_ack (sk) || tp->pf) +if (!mptcp_sk_can_send_ack (sk) ||inet_csk (sk)->icsk_ca_state == TCP_CA_Loss)continue ; elapsed =keepalive_time_elapsed (tp);
@@ -693,8 +693,6 @@ void mptcp_destroy_sock(struct sock *sk)struct mptcp_tcp_sock *mptcp;struct hlist_node *tmp; -__skb_queue_purge (&tcp_sk (sk)->mpcb->reinject_queue); -/* We have to close all remaining subflows. Normally, they * should all be about to get closed. But, if the kernel is * forcing a closure (e.g., tcp_write_err), the subflows might
@@ -1230,7 +1228,6 @@ static int mptcp_alloc_mpcb(struct sock *meta_sk, __u64 remote_key, meta_tp->was_meta_sk =0 ;/* Initialize the queues */ -skb_queue_head_init (&mpcb->reinject_queue); master_tp->out_of_order_queue =RB_ROOT ; master_sk->tcp_rtx_queue =RB_ROOT ;INIT_LIST_HEAD (&master_tp->tsq_node);
@@ -1461,9 +1458,6 @@ void mptcp_del_sock(struct sock *sk) tp->mptcp->attached =0 ; mpcb->path_index_bits &= ~(1 << tp->mptcp->path_index); -if (!tcp_write_queue_empty (sk) || !tcp_rtx_queue_empty (sk)) -mptcp_reinject_data (sk,0 ); -if (is_master_tp (tp)) {struct sock *meta_sk =mptcp_meta_sk (sk);struct tcp_sock *meta_tp =tcp_sk (meta_sk);
@@ -1921,8 +1915,6 @@ void mptcp_disconnect(struct sock *sk)struct tcp_sock *tp =tcp_sk (sk);struct hlist_node *tmp; -__skb_queue_purge (&tp->mpcb->reinject_queue); -if (tp->inside_tk_table)mptcp_hash_remove_bh (tp);
net/mptcp/mptcp_fullmesh.c +0 -12
@@ -923,12 +923,6 @@ static void mptcp_address_worker(struct work_struct *work) !ipv6_addr_equal(&inet6_sk(sk)->saddr, &event->addr.in6)) continue; -/* Reinject, so that pf = 1 and so we -* won't select this one as the -* ack-sock. -*/ -mptcp_reinject_data (sk,0 ); -/* We announce the removal of this id */ announce_remove_addr (tcp_sk (sk)->mptcp->loc_id, meta_sk);
@@ -1440,12 +1434,6 @@ static void full_mesh_release_sock(struct sock *meta_sk) }if (shall_remove) { -/* Reinject, so that pf = 1 and so we -* won't select this one as the -* ack-sock. -*/ -mptcp_reinject_data (sk,0 ); -announce_remove_addr (tcp_sk (sk)->mptcp->loc_id, meta_sk);
net/mptcp/mptcp_input.c +1 -19
@@ -92,7 +92,7 @@ static inline int mptcp_tso_acked_reinject(const struct sock *meta_sk,/* Cleans the meta-socket retransmission queue and the reinject-queue. */ static void mptcp_clean_rtx_queue (struct sock *meta_sk,u32 prior_snd_una) { -struct sk_buff *skb, *tmp, *next; +struct sk_buff *skb, *next;struct tcp_sock *meta_tp =tcp_sk (meta_sk);struct mptcp_cb *mpcb = meta_tp->mpcb;bool acked = false;
@@ -149,20 +149,6 @@ static void mptcp_clean_rtx_queue(struct sock *meta_sk, u32 prior_snd_una) }sk_wmem_free_skb (meta_sk, skb); } -/* Remove acknowledged data from the reinject queue */ - skb_queue_walk_safe(&mpcb->reinject_queue, skb, tmp) { -if (before (meta_tp->snd_una,TCP_SKB_CB (skb)->end_seq)) { -if (tcp_skb_pcount (skb) ==1 || - !after (meta_tp->snd_una,TCP_SKB_CB (skb)->seq)) -break ; - -mptcp_tso_acked_reinject (meta_sk, skb); -break ; - } - -__skb_unlink (skb, &mpcb->reinject_queue); -__kfree_skb (skb); - }if (likely (between (meta_tp->snd_up, prior_snd_una, meta_tp->snd_una))) meta_tp->snd_up = meta_tp->snd_una;
@@ -1242,9 +1228,6 @@ static void mptcp_data_ack(struct sock *sk, const struct sk_buff *skb)u32 nwin, data_ack, data_seq;u16 data_len =0 ; -/* A valid packet came in - subflow is operational again */ - tp->pf =0 ; -/* Even if there is no data-ack, we stop retransmitting. * Except if this is a SYN/ACK. Then it is just a retransmission */
@@ -1400,7 +1383,6 @@ static void mptcp_send_reset_rem_id(const struct mptcp_cb *mpcb, u8 rem_id)struct sock *sk_it =mptcp_to_sock (mptcp);if (tcp_sk (sk_it)->mptcp->rem_id == rem_id) { -mptcp_reinject_data (sk_it,0 );mptcp_send_reset (sk_it); } }
net/mptcp/mptcp_output.c +6 -352
413 lines not on this page · raw message
net/mptcp/mptcp_sched.c +13 -19
@@ -29,7 +29,7 @@ static bool mptcp_is_def_unavailable(struct sock *sk)if (tp->mptcp->pre_established)return true; -if (tp->pf) +if (inet_csk (sk)->icsk_ca_state == TCP_CA_Loss)return true;return false;
@@ -333,25 +333,19 @@ static struct sk_buff *__mptcp_next_segment(struct sock *meta_sk, int *reinject)if (mpcb->infinite_mapping_snd || mpcb->send_infinite_mapping)return tcp_send_head (meta_sk); - skb =skb_peek (&mpcb->reinject_queue); + skb =tcp_send_head (meta_sk); -if (skb) { - *reinject =1 ; - }else { - skb =tcp_send_head (meta_sk); - -if (!skb && meta_sk->sk_socket && -test_bit (SOCK_NOSPACE , &meta_sk->sk_socket->flags) && -sk_stream_wspace (meta_sk) <sk_stream_min_wspace (meta_sk)) { -struct sock *subsk =get_available_subflow (meta_sk,NULL , - false); -if (!subsk) -return NULL ; - - skb =mptcp_rcv_buf_optimization (subsk,0 ); -if (skb) - *reinject =-1 ; - } +if (!skb && meta_sk->sk_socket && +test_bit (SOCK_NOSPACE , &meta_sk->sk_socket->flags) && +sk_stream_wspace (meta_sk) <sk_stream_min_wspace (meta_sk)) { +struct sock *subsk =get_available_subflow (meta_sk,NULL , + false); +if (!subsk) +return NULL ; + + skb =mptcp_rcv_buf_optimization (subsk,0 ); +if (skb) + *reinject =-1 ; }return skb; }
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 7/12 mptcp: Remove support for TCP SYN-cookies
In reply to Christoph Paasch---
Notes:
v3: * More cleanup removing further cookie-things
include/net/mptcp.h | 14 ++------ include/net/tcp.h | 13 +++---- net/ipv4/syncookies.c | 47 ++++--------------------- net/ipv4/tcp_input.c | 2 +- net/ipv4/tcp_minisocks.c | 2 +- net/ipv6/syncookies.c | 32 ++++------------- net/mptcp/mptcp_ctrl.c | 92 +++--------------------------------------------- net/mptcp/mptcp_ipv4.c | 29 ++++----------- net/mptcp/mptcp_ipv6.c | 29 ++++----------- 9 files changed, 40 insertions(+), 220 deletions(-)
include/net/mptcp.h +3 -11
@@ -739,8 +739,7 @@ int mptcp_create_master_sk(struct sock *meta_sk, __u64 remote_key, __u8 mptcp_ver, u32 window);int mptcp_check_req_fastopen (struct sock *child,struct request_sock *req);int mptcp_check_req_master (struct sock *sk,struct sock *child, -struct request_sock *req,const struct sk_buff *skb, -int drop); +struct request_sock *req,const struct sk_buff *skb); struct sock *mptcp_check_req_child(struct sock *meta_sk, struct sock *child, struct request_sock *req,
@@ -802,14 +801,11 @@ void mptcp_join_reqsk_init(const struct mptcp_cb *mpcb,const struct request_sock *req, struct sk_buff *skb);void mptcp_reqsk_init (struct request_sock *req,const struct sock *sk, -const struct sk_buff *skb,bool want_cookie); +const struct sk_buff *skb);int mptcp_conn_request (struct sock *sk,struct sk_buff *skb);void mptcp_enable_sock (struct sock *sk);void mptcp_disable_sock (struct sock *sk);void mptcp_disable_static_key (void ); -void mptcp_cookies_reqsk_init (struct request_sock *req, -struct mptcp_options_received *mopt, -struct sk_buff *skb);void mptcp_sock_destruct (struct sock *sk);int mptcp_finish_handshake (struct sock *child,struct sk_buff *skb);int mptcp_get_info (const struct sock *meta_sk,char __user *optval,int optlen);
@@ -1285,8 +1281,7 @@ static inline int mptcp_check_req_fastopen(struct sock *child,static inline int mptcp_check_req_master (const struct sock *sk,const struct sock *child,const struct request_sock *req, -const struct sk_buff *skb, -int drop) +const struct sk_buff *skb) {return 1 ; }
@@ -1357,9 +1352,6 @@ static inline void mptcp_remove_shortcuts(const struct mptcp_cb *mpcb, const struct sk_buff *skb) {}static inline void mptcp_init_tcp_sock (struct sock *sk) {}static inline void mptcp_disable_static_key (void ) {} -static inline void mptcp_cookies_reqsk_init (struct request_sock *req, -struct mptcp_options_received *mopt, -struct sk_buff *skb) {}static inline void mptcp_fin (struct sock *meta_sk) {}static inline bool mptcp_can_new_subflow (const struct sock *meta_sk) {
include/net/tcp.h +5 -8
@@ -644,8 +644,7 @@ static inline u32 tcp_cookie_time(void)u32 __cookie_v4_init_sequence (const struct iphdr *iph,const struct tcphdr *th,u16 *mssp); -__u32 cookie_v4_init_sequence (struct request_sock *req,const struct sock *sk, -const struct sk_buff *skb,__u16 *mss); +__u32 cookie_v4_init_sequence (const struct sk_buff *skb,__u16 *mss);u64 cookie_init_timestamp (struct request_sock *req);bool cookie_timestamp_decode (const struct net *net,struct tcp_options_received *opt);
@@ -659,8 +658,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);u32 __cookie_v6_init_sequence (const struct ipv6hdr *iph,const struct tcphdr *th,u16 *mssp); -__u32 cookie_v6_init_sequence (struct request_sock *req,const struct sock *sk, -const struct sk_buff *skb,__u16 *mss); +__u32 cookie_v6_init_sequence (const struct sk_buff *skb,__u16 *mss);#endif /* tcp_output.c */
@@ -2086,8 +2084,8 @@ struct tcp_request_sock_ops {struct sk_buff *skb, bool want_cookie);#ifdef CONFIG_SYN_COOKIES -__u32 (*cookie_init_seq)(struct request_sock *req,const struct sock *sk, -const struct sk_buff *skb,__u16 *mss); +__u32 (*cookie_init_seq)(const struct sk_buff *skb, +__u16 *mss);#endif struct dst_entry *(*route_req)(const struct sock *sk,struct flowi *fl,const struct request_sock *req);
@@ -2101,13 +2099,12 @@ struct tcp_request_sock_ops {#ifdef CONFIG_SYN_COOKIES static inline __u32 cookie_init_sequence (const struct tcp_request_sock_ops *ops, -struct request_sock *req,const struct sock *sk,struct sk_buff *skb,__u16 *mss) {tcp_synq_overflow (sk);__NET_INC_STATS (sock_net (sk),LINUX_MIB_SYNCOOKIESSENT ); -return ops->cookie_init_seq (req, sk, skb, mss); +return ops->cookie_init_seq (skb, mss); }#else static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops,
net/ipv4/syncookies.c +7 -40
104 lines not on this page · raw message
net/ipv4/tcp_input.c +1 -1
@@ -6674,7 +6674,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,tcp_ecn_create_request (req, skb, sk, dst);if (want_cookie) { - isn =cookie_init_sequence (af_ops, req, sk, skb, &req->mss); + isn =cookie_init_sequence (af_ops, sk, skb, &req->mss); req->cookie_ts = tmp_opt.tstamp_ok;if (!tmp_opt.tstamp_ok)inet_rsk (req)->ecn_ok =0 ;
net/ipv4/tcp_minisocks.c +1 -1
@@ -838,7 +838,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, goto listen_overflow;if (own_req && !is_meta_sk (sk)) { -int ret =mptcp_check_req_master (sk, child, req, skb,1 ); +int ret =mptcp_check_req_master (sk, child, req, skb);if (ret <0 ) goto listen_overflow;
net/ipv6/syncookies.c +7 -25
@@ -20,8 +20,6 @@#include <linux/kernel.h> #include <net/secure_seq.h> #include <net/ipv6.h> -#include <net/mptcp.h> -#include <net/mptcp_v6.h> #include <net/tcp.h> #define COOKIEBITS 24/* Upper bits store count */
@@ -113,8 +111,7 @@ u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, }EXPORT_SYMBOL_GPL (__cookie_v6_init_sequence); -__u32 cookie_v6_init_sequence (struct request_sock *req,const struct sock *sk, -const struct sk_buff *skb,__u16 *mssp) +__u32 cookie_v6_init_sequence (const struct sk_buff *skb,__u16 *mssp) {const struct ipv6hdr *iph =ipv6_hdr (skb);const struct tcphdr *th =tcp_hdr (skb);
@@ -136,7 +133,6 @@ EXPORT_SYMBOL_GPL(__cookie_v6_check);struct sock *cookie_v6_check (struct sock *sk,struct sk_buff *skb) {struct tcp_options_received tcp_opt; -struct mptcp_options_received mopt;struct inet_request_sock *ireq;struct tcp_request_sock *treq;struct ipv6_pinfo *np =inet6_sk (sk);
@@ -166,8 +162,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)/* check for timestamp cookie support */ memset (&tcp_opt,0 ,sizeof (tcp_opt)); -mptcp_init_mp_opt (&mopt); -tcp_parse_options (sock_net (sk), skb, &tcp_opt, &mopt,0 ,NULL ,NULL ); +tcp_parse_options (sock_net (sk), skb, &tcp_opt,NULL ,0 ,NULL ,NULL );if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) { tsoff = secure_tcpv6_ts_off(sock_net(sk),
@@ -180,27 +175,14 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) goto out; ret =NULL ; -#ifdef CONFIG_MPTCP -if (mopt.saw_mpc) - req =inet_reqsk_alloc (&mptcp6_request_sock_ops, sk, false); - else -#endif - req =inet_reqsk_alloc (&tcp6_request_sock_ops, sk, false); + req =inet_reqsk_alloc (&tcp6_request_sock_ops, sk, false);if (!req) goto out; ireq =inet_rsk (req); - ireq->mptcp_rqsk =0 ; - ireq->saw_mpc =0 ; treq =tcp_rsk (req); treq->tfo_listener = false; -/* Must be done before anything else, as it initializes -* hash_entry of the MPTCP request-sock. -*/ -if (mopt.saw_mpc) -mptcp_cookies_reqsk_init (req, &mopt, skb); -if (security_inet_conn_request (sk, skb, req)) goto out_free;
@@ -264,10 +246,10 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) } req->rsk_window_clamp = tp->window_clamp ? :dst_metric (dst,RTAX_WINDOW ); - tp->ops->select_initial_window (sk,tcp_full_space (sk), req->mss, - &req->rsk_rcv_wnd, &req->rsk_window_clamp, - ireq->wscale_ok, &rcv_wscale, -dst_metric (dst,RTAX_INITRWND )); +tcp_select_initial_window (sk,tcp_full_space (sk), req->mss, + &req->rsk_rcv_wnd, &req->rsk_window_clamp, + ireq->wscale_ok, &rcv_wscale, +dst_metric (dst,RTAX_INITRWND )); ireq->rcv_wscale = rcv_wscale; ireq->ecn_ok =cookie_ecn_ok (&tcp_opt,sock_net (sk), dst);
net/mptcp/mptcp_ctrl.c +4 -88
125 lines not on this page · raw message
net/mptcp/mptcp_ipv4.c +6 -23
@@ -71,31 +71,17 @@ static int mptcp_v4_init_req(struct request_sock *req, const struct sock *sk,mptcp_rsk (req)->hash_entry.pprev =NULL ;mptcp_rsk (req)->is_sub =0 ; -inet_rsk (req)->mptcp_rqsk =1 ; +inet_rsk (req)->mptcp_rqsk =0 ; -/* In case of SYN-cookies, we wait for the isn to be generated - it is -* input to the key-generation. -*/ -if (!want_cookie) -mptcp_reqsk_init (req, sk, skb, false); +/* SYN-cookies are not supported */ +if (!want_cookie) { +inet_rsk (req)->mptcp_rqsk =1 ; +mptcp_reqsk_init (req, sk, skb); + }return 0 ; } -#ifdef CONFIG_SYN_COOKIES -static u32 mptcp_v4_cookie_init_seq (struct request_sock *req,const struct sock *sk, -const struct sk_buff *skb,__u16 *mssp) -{ -__u32 isn =cookie_v4_init_sequence (req, sk, skb, mssp); - -tcp_rsk (req)->snt_isn = isn; - -mptcp_reqsk_init (req, sk, skb, true); - -return isn; -} -#endif -/* May be called without holding the meta-level lock */ static int mptcp_v4_join_init_req (struct request_sock *req,const struct sock *meta_sk,struct sk_buff *skb,bool want_cookie)
@@ -381,9 +367,6 @@ int mptcp_pm_v4_init(void) mptcp_request_sock_ipv4_ops = tcp_request_sock_ipv4_ops; mptcp_request_sock_ipv4_ops.init_req = mptcp_v4_init_req; -#ifdef CONFIG_SYN_COOKIES - mptcp_request_sock_ipv4_ops.cookie_init_seq = mptcp_v4_cookie_init_seq; -#endif mptcp_join_request_sock_ipv4_ops = tcp_request_sock_ipv4_ops; mptcp_join_request_sock_ipv4_ops.init_req = mptcp_v4_join_init_req;
net/mptcp/mptcp_ipv6.c +6 -23
@@ -100,31 +100,17 @@ static int mptcp_v6_init_req(struct request_sock *req, const struct sock *sk,mptcp_rsk (req)->hash_entry.pprev =NULL ;mptcp_rsk (req)->is_sub =0 ; -inet_rsk (req)->mptcp_rqsk =1 ; +inet_rsk (req)->mptcp_rqsk =0 ; -/* In case of SYN-cookies, we wait for the isn to be generated - it is -* input to the key-generation. -*/ -if (!want_cookie) -mptcp_reqsk_init (req, sk, skb, false); +/* SYN-cookies are not supported */ +if (!want_cookie) { +inet_rsk (req)->mptcp_rqsk =1 ; +mptcp_reqsk_init (req, sk, skb); + }return 0 ; } -#ifdef CONFIG_SYN_COOKIES -static u32 mptcp_v6_cookie_init_seq (struct request_sock *req,const struct sock *sk, -const struct sk_buff *skb,__u16 *mssp) -{ -__u32 isn =cookie_v6_init_sequence (req, sk, skb, mssp); - -tcp_rsk (req)->snt_isn = isn; - -mptcp_reqsk_init (req, sk, skb, true); - -return isn; -} -#endif -/* May be called without holding the meta-level lock */ static int mptcp_v6_join_init_req (struct request_sock *req,const struct sock *meta_sk,struct sk_buff *skb,bool want_cookie)
@@ -427,9 +413,6 @@ int mptcp_pm_v6_init(void) mptcp_request_sock_ipv6_ops = tcp_request_sock_ipv6_ops; mptcp_request_sock_ipv6_ops.init_req = mptcp_v6_init_req; -#ifdef CONFIG_SYN_COOKIES - mptcp_request_sock_ipv6_ops.cookie_init_seq = mptcp_v6_cookie_init_seq; -#endif mptcp_join_request_sock_ipv6_ops = tcp_request_sock_ipv6_ops; mptcp_join_request_sock_ipv6_ops.init_req = mptcp_v6_join_init_req;
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 8/12 mptcp: Remove support for TCP Fast Open
In reply to Christoph Paasch--- include/linux/tcp.h | 2 +- include/net/mptcp.h | 9 +----- net/ipv4/tcp.c | 7 ++--- net/ipv4/tcp_fastopen.c | 16 +++-------- net/ipv4/tcp_input.c | 23 ++-------------- net/mptcp/mptcp_ctrl.c | 53 ------------------------------------ net/mptcp/mptcp_input.c | 71 ------------------------------------------------ net/mptcp/mptcp_output.c | 5 +--- 8 files changed, 13 insertions(+), 173 deletions(-)
include/linux/tcp.h +1 -1
@@ -58,7 +58,7 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb)/* TCP Fast Open */ #define TCP_FASTOPEN_COOKIE_MIN 4/* Min Fast Open Cookie size in bytes */ #define TCP_FASTOPEN_COOKIE_MAX 16/* Max Fast Open Cookie size in bytes */ -#define TCP_FASTOPEN_COOKIE_SIZE 4/* the size employed by this impl. */ +#define TCP_FASTOPEN_COOKIE_SIZE 8/* the size employed by this impl. */ /* TCP Fast Open Cookie as stored in memory */ struct tcp_fastopen_cookie {
include/net/mptcp.h +1 -8
@@ -737,7 +737,6 @@ void mptcp_close(struct sock *meta_sk, long timeout);bool mptcp_doit (struct sock *sk);int mptcp_create_master_sk (struct sock *meta_sk,__u64 remote_key,__u8 mptcp_ver,u32 window); -int mptcp_check_req_fastopen (struct sock *child,struct request_sock *req);int mptcp_check_req_master (struct sock *sk,struct sock *child,struct request_sock *req,const struct sk_buff *skb); struct sock *mptcp_check_req_child(struct sock *meta_sk,
@@ -1049,8 +1048,7 @@ static inline void mptcp_check_rcvseq_wrap(struct tcp_sock *meta_tp,static inline int mptcp_sk_can_send (const struct sock *sk) { -return tcp_passive_fastopen (sk) || - ((1 << sk->sk_state) & (TCPF_ESTABLISHED |TCPF_CLOSE_WAIT ) && +return ((1 << sk->sk_state) & (TCPF_ESTABLISHED |TCPF_CLOSE_WAIT ) && !tcp_sk (sk)->mptcp->pre_established); }
@@ -1273,11 +1271,6 @@ static inline bool mptcp_doit(struct sock *sk) {return false; } -static inline int mptcp_check_req_fastopen (struct sock *child, -struct request_sock *req) -{ -return 1 ; -} static inline int mptcp_check_req_master(const struct sock *sk, const struct sock *child, const struct request_sock *req,
net/ipv4/tcp.c +3 -4
@@ -1233,7 +1233,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) }if (unlikely (flags &MSG_FASTOPEN ||inet_sk (sk)->defer_connect) && - !tp->repair) { + !tp->repair && !sock_flag (sk,SOCK_MPTCP )) { err =tcp_sendmsg_fastopen (sk, msg, &copied_syn, size);if (err == -EINPROGRESS && copied_syn >0 ) goto out;
@@ -1250,8 +1250,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)* is fully established. */ if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED |TCPF_CLOSE_WAIT )) && - !tcp_passive_fastopen (mptcp (tp) && tp->mpcb->master_sk ? - tp->mpcb->master_sk : sk)) { + !tcp_passive_fastopen (sk)) { err =sk_stream_wait_connect (sk, &timeo);if (err !=0 ) goto do_error;
@@ -3098,7 +3097,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level,case TCP_FASTOPEN :if (val >=0 && ((1 << sk->sk_state) & (TCPF_CLOSE | -TCPF_LISTEN ))) { +TCPF_LISTEN )) && !sock_flag (sk,SOCK_MPTCP )) {tcp_fastopen_init_key_once (net);fastopen_queue_tune (sk, val);
net/ipv4/tcp_fastopen.c +4 -12
@@ -9,7 +9,6 @@#include <linux/rculist.h> #include <net/inetpeer.h> #include <net/tcp.h> -#include <net/mptcp.h> void tcp_fastopen_init_key_once (struct net *net) {
@@ -219,7 +218,7 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk, {struct tcp_sock *tp;struct request_sock_queue *queue = &inet_csk (sk)->icsk_accept_queue; -struct sock *child, *meta_sk; +struct sock *child;bool own_req; req->num_retrans =0 ;
@@ -259,22 +258,15 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk,refcount_set (&req->rsk_refcnt,2 ); +/* Now finish processing the fastopen child socket. */ +tcp_init_transfer (child,BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB ); + tp->rcv_nxt =TCP_SKB_CB (skb)->seq +1 ;tcp_fastopen_add_skb (child, skb);tcp_rsk (req)->rcv_nxt = tp->rcv_nxt; tp->rcv_wup = tp->rcv_nxt; - - meta_sk = child; -if (!mptcp_check_req_fastopen (meta_sk, req)) { - child =tcp_sk (meta_sk)->mpcb->master_sk; - tp =tcp_sk (child); - } - -/* Now finish processing the fastopen child socket. */ -tcp_init_transfer (child,BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB ); -/* tcp_conn_request() is sending the SYNACK, * and queues the child into listener accept queue. */
net/ipv4/tcp_input.c +3 -20
@@ -5784,17 +5784,10 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, struct tcp_fastopen_cookie *cookie) {struct tcp_sock *tp =tcp_sk (sk); -struct sk_buff *data =NULL ; +struct sk_buff *data = tp->syn_data ?tcp_rtx_queue_head (sk) :NULL ;u16 mss = tp->rx_opt.mss_clamp, try_exp =0 ;bool syn_drop = false; -if (tp->syn_data) { -if (mptcp (tp)) - data =tcp_write_queue_head (mptcp_meta_sk (sk)); -else - data =tcp_rtx_queue_head (sk); - } -if (mss == tp->rx_opt.user_mss) {struct tcp_options_received opt;
@@ -5825,11 +5818,7 @@ static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack,tcp_fastopen_cache_set (sk, mss, cookie, syn_drop, try_exp); -/* In mptcp case, we do not rely on "retransmit", but instead on -* "transmit", because if fastopen data is not acked, the retransmission -* becomes the first MPTCP data (see mptcp_rcv_synsent_fastopen). -*/ -if (data && !mptcp (tp)) {/* Retransmit unacked data in SYN */ +if (data) {/* Retransmit unacked data in SYN */ skb_rbtree_walk_from (data) {if (__tcp_retransmit_skb (sk, data,1 ))break ;
@@ -6689,18 +6678,12 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, fastopen_sk =tcp_try_fastopen (sk, skb, req, &foc, dst); }if (fastopen_sk) { -struct sock *meta_sk = fastopen_sk; - -if (mptcp (tcp_sk (fastopen_sk))) - meta_sk =mptcp_meta_sk (fastopen_sk); af_ops->send_synack (fastopen_sk, dst, &fl, req, &foc,TCP_SYNACK_FASTOPEN );/* Add the child socket directly into the accept queue */ -inet_csk_reqsk_queue_add (sk, req, meta_sk); +inet_csk_reqsk_queue_add (sk, req, fastopen_sk); sk->sk_data_ready (sk);bh_unlock_sock (fastopen_sk); -if (meta_sk != fastopen_sk) -bh_unlock_sock (meta_sk);sock_put (fastopen_sk); }else {tcp_rsk (req)->tfo_listener = false;
net/mptcp/mptcp_ctrl.c +0 -53
59 lines not on this page · raw message
net/mptcp/mptcp_input.c +0 -71
89 lines not on this page · raw message
net/mptcp/mptcp_output.c +1 -4
@@ -1292,12 +1292,9 @@ void mptcp_meta_retransmit_timer(struct sock *meta_sk)void mptcp_sub_retransmit_timer (struct sock *sk) { -struct tcp_sock *tp =tcp_sk (sk); -tcp_retransmit_timer (sk); -if (!tp->fastopen_rsk) -mptcp_set_rto (sk); +mptcp_set_rto (sk); }/* Modify values to an mptcp-level for the initial window of new subflows */
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 9/12 mptcp: Remove MPTCP-code out of do_ip_setsockopt
In reply to Christoph Paasch--- net/ipv4/ip_sockglue.c | 14 -------------- 1 file changed, 14 deletions(-)
net/ipv4/ip_sockglue.c +0 -14
@@ -753,20 +753,6 @@ static int do_ip_setsockopt(struct sock *sk, int level, inet->tos = val; sk->sk_priority =rt_tos2priority (val);sk_dst_reset (sk); -/* Update TOS on mptcp subflow */ -if (is_meta_sk (sk)) { -struct mptcp_tcp_sock *mptcp; - -mptcp_for_each_sub (tcp_sk (sk)->mpcb, mptcp) { -struct sock *sk_it =mptcp_to_sock (mptcp); - -if (inet_sk (sk_it)->tos !=inet_sk (sk)->tos) { -inet_sk (sk_it)->tos =inet_sk (sk)->tos; - sk_it->sk_priority = sk->sk_priority; -sk_dst_reset (sk_it); - } - } - } }break ;case IP_TTL :
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 10/12 mptcp: Remove scheduler-selection support
In reply to Christoph Paasch--- include/linux/tcp.h | 3 - include/net/mptcp.h | 41 ++------- include/uapi/linux/tcp.h | 1 - net/ipv4/tcp.c | 46 ---------- net/mptcp/Kconfig | 32 ------- net/mptcp/mptcp_ctrl.c | 35 +------- net/mptcp/mptcp_output.c | 7 +- net/mptcp/mptcp_sched.c | 223 ++++------------------------------------------- 8 files changed, 28 insertions(+), 360 deletions(-)
include/linux/tcp.h +0 -3
@@ -476,17 +476,14 @@ struct tcp_sock { close_it:1, /* Must close socket in mptcp_data_ready? */ closing:1, mptcp_ver:4, - mptcp_sched_setsockopt:1, mptcp_pm_setsockopt:1, record_master_info:1;struct mptcp_tcp_sock *mptcp;#ifdef CONFIG_MPTCP -#define MPTCP_SCHED_NAME_MAX 16#define MPTCP_PM_NAME_MAX 16struct hlist_nulls_node tk_table;u32 mptcp_loc_token;u64 mptcp_loc_key; -char mptcp_sched_name[MPTCP_SCHED_NAME_MAX ];char mptcp_pm_name[MPTCP_PM_NAME_MAX ];#endif /* CONFIG_MPTCP */ };
include/net/mptcp.h +9 -32
69 lines not on this page · raw message
include/uapi/linux/tcp.h +0 -1
@@ -134,7 +134,6 @@ enum {#define TCP_CM_INQ TCP_INQ#define MPTCP_ENABLED 42 -#define MPTCP_SCHEDULER 43#define MPTCP_PATH_MANAGER 44#define MPTCP_INFO 45
net/ipv4/tcp.c +0 -46
58 lines not on this page · raw message
net/mptcp/Kconfig +0 -32
@@ -57,35 +57,3 @@ config DEFAULT_MPTCP_PM default "ndiffports" if DEFAULT_NDIFFPORTS default "default" -menuconfig MPTCP_SCHED_ADVANCED - bool "MPTCP: advanced scheduler control" - depends on MPTCP=y - ---help--- - Support for selection of different schedulers. You should choose 'Y' here, - if you want to choose a different scheduler than the default one. - -if MPTCP_SCHED_ADVANCED - -choice - prompt "Default MPTCP Scheduler" - default DEFAULT - help - Select the Scheduler of your choice - - config DEFAULT_SCHEDULER - bool "Default" - ---help--- - This is the default scheduler, sending first on the subflow - with the lowest RTT. - -endchoice -endif - -config DEFAULT_MPTCP_SCHED - string - depends on (MPTCP=y) - default "default" if DEFAULT_SCHEDULER - default "roundrobin" if DEFAULT_ROUNDROBIN - default "redundant" if DEFAULT_REDUNDANT - default "default" -
net/mptcp/mptcp_ctrl.c +1 -34
@@ -94,25 +94,6 @@ static int proc_mptcp_path_manager(struct ctl_table *ctl, int write,return ret; } -static int proc_mptcp_scheduler (struct ctl_table *ctl,int write, -void __user *buffer,size_t *lenp, -loff_t *ppos) -{ -char val[MPTCP_SCHED_NAME_MAX ]; -struct ctl_table tbl = { - .data = val, - .maxlen =MPTCP_SCHED_NAME_MAX , - }; -int ret; - -mptcp_get_default_scheduler (val); - - ret =proc_dostring (&tbl, write, buffer, lenp, ppos); -if (write && ret ==0 ) - ret =mptcp_set_default_scheduler (val); -return ret; -} -static struct ctl_table mptcp_table[] = { { .procname ="mptcp_enabled" ,
@@ -150,12 +131,6 @@ static struct ctl_table mptcp_table[] = { .maxlen = MPTCP_PM_NAME_MAX, .proc_handler = proc_mptcp_path_manager, }, - { - .procname = "mptcp_scheduler", - .mode = 0644, - .maxlen = MPTCP_SCHED_NAME_MAX, - .proc_handler = proc_mptcp_scheduler, - }, { } };
@@ -604,7 +579,6 @@ static void mptcp_mpcb_put(struct mptcp_cb *mpcb) {if (refcount_dec_and_test (&mpcb->mpcb_refcnt)) {mptcp_cleanup_path_manager (mpcb); -mptcp_cleanup_scheduler (mpcb);kfree (mpcb->master_info);kmem_cache_free (mptcp_cb_cache, mpcb); }
@@ -1276,7 +1250,6 @@ static int mptcp_alloc_mpcb(struct sock *meta_sk, __u64 remote_key,refcount_set (&mpcb->mpcb_refcnt,1 );mptcp_init_path_manager (mpcb); -mptcp_init_scheduler (mpcb);if (!try_module_get (inet_csk (master_sk)->icsk_ca_ops->owner))tcp_assign_congestion_control (master_sk);
@@ -1344,8 +1317,7 @@ int mptcp_add_sock(struct sock *meta_sk, struct sock *sk, u8 loc_id, u8 rem_id, tp->mptcp->loc_id = loc_id; tp->mptcp->rem_id = rem_id; -if (mpcb->sched_ops->init) - mpcb->sched_ops->init (sk); +mptcp_sched_init (sk);/* The corresponding sock_put is in mptcp_sock_destruct(). It cannot be * included in mptcp_del_sock(), because the mpcb must remain alive
@@ -2825,17 +2797,12 @@ void __init mptcp_init(void)if (mptcp_register_path_manager (&mptcp_pm_default)) goto register_pm_failed; -if (mptcp_register_scheduler (&mptcp_sched_default)) - goto register_sched_failed; -pr_info ("MPTCP: Unstable branch" ); mptcp_init_failed = false;return ; -register_sched_failed: -mptcp_unregister_path_manager (&mptcp_pm_default); register_pm_failed:unregister_net_sysctl_table (mptcp_sysctl); register_sysctl_failed:
net/mptcp/mptcp_output.c +3 -4
@@ -306,7 +306,7 @@ int mptcp_write_wakeup(struct sock *meta_sk, int mib) before(TCP_SKB_CB(skb)->seq, tcp_wnd_end(meta_tp))) {unsigned int mss;unsigned int seg_size =tcp_wnd_end (meta_tp) -TCP_SKB_CB (skb)->seq; -struct sock *subsk = meta_tp->mpcb->sched_ops->get_subflow (meta_sk, skb, true); +struct sock *subsk =mptcp_get_available_subflow (meta_sk, skb, true);struct tcp_sock *subtp;WARN_ON (TCP_SKB_CB (skb)->sacked);
@@ -395,8 +395,7 @@ bool mptcp_write_xmit(struct sock *meta_sk, unsigned int mss_now, int nonagle,tcp_mstamp_refresh (meta_tp); -while ((skb = mpcb->sched_ops->next_segment (meta_sk, &reinject, &subsk, - &sublimit))) { +while ((skb =mptcp_next_segment (meta_sk, &reinject, &subsk, &sublimit))) {enum tcp_queue tcp_queue =TCP_FRAG_IN_WRITE_QUEUE ;unsigned int limit;
@@ -1111,7 +1110,7 @@ int mptcp_retransmit_skb(struct sock *meta_sk, struct sk_buff *skb)/* We need to make sure that the retransmitted segment can be sent on a * subflow right now. If it is too big, it needs to be fragmented. */ - subsk = meta_tp->mpcb->sched_ops->get_subflow (meta_sk, skb, false); + subsk =mptcp_get_available_subflow (meta_sk, skb, false);if (!subsk) {/* We want to increase icsk_retransmits, thus return 0, so that * mptcp_meta_retransmit_timer enters the desired branch.
net/mptcp/mptcp_sched.c +15 -208
279 lines not on this page · raw message
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 11/12 mptcp: Remove ndiffports path manager
In reply to Christoph Paasch--- net/mptcp/Kconfig | 12 ---- net/mptcp/Makefile | 1 - net/mptcp/mptcp_ndiffports.c | 167 ------------------------------------------- 3 files changed, 180 deletions(-) delete mode 100644 net/mptcp/mptcp_ndiffports.c
net/mptcp/Kconfig +0 -12
@@ -23,14 +23,6 @@ config MPTCP_FULLMESH ---help--- This path-management module will create a full-mesh among all IP-addresses. -config MPTCP_NDIFFPORTS - tristate "MPTCP ndiff-ports" - depends on MPTCP=y - ---help--- - This path-management module will create multiple subflows between the same - pair of IP-addresses, modifying the source-port. You can set the number - of subflows via the mptcp_ndiffports-sysctl. - choice prompt "Default MPTCP Path-Manager" default DEFAULT
@@ -40,9 +32,6 @@ choice config DEFAULT_FULLMESH bool "Full mesh" if MPTCP_FULLMESH=y - config DEFAULT_NDIFFPORTS - bool "ndiff-ports" if MPTCP_NDIFFPORTS=y - config DEFAULT_DUMMY bool "Default"
@@ -54,6 +43,5 @@ config DEFAULT_MPTCP_PM string default "default" if DEFAULT_DUMMY default "fullmesh" if DEFAULT_FULLMESH - default "ndiffports" if DEFAULT_NDIFFPORTS default "default"
net/mptcp/Makefile +0 -1
@@ -9,7 +9,6 @@ mptcp-y := mptcp_ctrl.o mptcp_ipv4.o mptcp_pm.o \ mptcp_output.o mptcp_input.o mptcp_sched.o obj-$(CONFIG_MPTCP_FULLMESH) += mptcp_fullmesh.o -obj-$(CONFIG_MPTCP_NDIFFPORTS) += mptcp_ndiffports.o mptcp-$(subst m,y,$(CONFIG_IPV6)) += mptcp_ipv6.o
net/mptcp/mptcp_ndiffports.c deleted +0 -167
167 lines not on this page · raw message
Signature · 1 line
2.16.2
Christoph Paasch
PATCH v3 12/12 mptcp: Make path-management no more a module nor selectable through socketops
In reply to Christoph Paasch---
Notes:
v2:
* Added fullmesh_initialized flag to indicate that we went through _new_session() and it's all setup. Necessary because the removal got rid of the function-pointers which were guarding that implicitly.
* Fixed some oversights in the removal of mptcp_become_fully_estab().
include/linux/tcp.h | 3 - include/net/mptcp.h | 93 ++++++++----- include/net/netns/mptcp.h | 8 +- net/ipv4/tcp.c | 47 ------- net/ipv4/tcp_input.c | 4 +- net/ipv4/tcp_output.c | 3 +- net/mptcp/Kconfig | 37 ----- net/mptcp/Makefile | 4 +- net/mptcp/mptcp_ctrl.c | 49 +------ net/mptcp/mptcp_fullmesh.c | 326 +++++++-------------------------------------- net/mptcp/mptcp_input.c | 32 ++--- net/mptcp/mptcp_ipv4.c | 2 +- net/mptcp/mptcp_ipv6.c | 2 +- net/mptcp/mptcp_output.c | 8 +- net/mptcp/mptcp_pm.c | 226 ------------------------------- 15 files changed, 136 insertions(+), 708 deletions(-) delete mode 100644 net/mptcp/mptcp_pm.c
include/linux/tcp.h +0 -3
@@ -476,15 +476,12 @@ struct tcp_sock { close_it:1, /* Must close socket in mptcp_data_ready? */ closing:1, mptcp_ver:4, - mptcp_pm_setsockopt:1, record_master_info:1;struct mptcp_tcp_sock *mptcp;#ifdef CONFIG_MPTCP -#define MPTCP_PM_NAME_MAX 16struct hlist_nulls_node tk_table;u32 mptcp_loc_token;u64 mptcp_loc_key; -char mptcp_pm_name[MPTCP_PM_NAME_MAX ];#endif /* CONFIG_MPTCP */ };
include/net/mptcp.h +58 -35
130 lines not on this page · raw message
include/net/netns/mptcp.h +2 -6
@@ -32,12 +32,8 @@#include <linux/compiler.h> -enum { -MPTCP_PM_FULLMESH =0 , -MPTCP_PM_MAX -}; -struct mptcp_mib ; +struct mptcp_fm_ns ;struct netns_mptcp { DEFINE_SNMP_STAT(struct mptcp_mib, mptcp_statistics);
@@ -46,7 +42,7 @@ struct netns_mptcp {struct proc_dir_entry *proc_net_mptcp;#endif - void *path_managers[MPTCP_PM_MAX]; + struct mptcp_fm_ns *fm_ns; };#endif /* __NETNS_MPTCP_H__ */
net/ipv4/tcp.c +0 -47
59 lines not on this page · raw message
net/ipv4/tcp_input.c +2 -2
@@ -6177,7 +6177,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)* addresses, which can only be done after the third ack * of the 3-way handshake. */ -mptcp_update_metasocket (tp->meta_sk); +full_mesh_new_session (tp->meta_sk); }if (queued >=0 )return queued;
@@ -6280,7 +6280,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)*/ if (mptcp (tp)) {if (is_master_tp (tp)) -mptcp_update_metasocket (mptcp_meta_sk (sk)); +full_mesh_new_session (mptcp_meta_sk (sk));else tcp_send_ack (sk); }
net/ipv4/tcp_output.c +1 -2
@@ -921,8 +921,7 @@ void tcp_release_cb(struct sock *sk)__sock_put (sk); }if (flags &TCPF_PATH_MANAGER_DEFERRED ) { -if (tcp_sk (sk)->mpcb->pm_ops->release_sock) -tcp_sk (sk)->mpcb->pm_ops->release_sock (sk); +full_mesh_release_sock (sk);__sock_put (sk); }if (flags &TCPF_SUB_DEFERRED )
net/mptcp/Kconfig +0 -37
@@ -8,40 +8,3 @@ config MPTCP This replaces the normal TCP stack with a Multipath TCP stack, able to use several paths at once. -menuconfig MPTCP_PM_ADVANCED - bool "MPTCP: advanced path-manager control" - depends on MPTCP=y - ---help--- - Support for selection of different path-managers. You should choose 'Y' here, - because otherwise you will not actively create new MPTCP-subflows. - -if MPTCP_PM_ADVANCED - -config MPTCP_FULLMESH - tristate "MPTCP Full-Mesh Path-Manager" - depends on MPTCP=y - ---help--- - This path-management module will create a full-mesh among all IP-addresses. - -choice - prompt "Default MPTCP Path-Manager" - default DEFAULT - help - Select the Path-Manager of your choice - - config DEFAULT_FULLMESH - bool "Full mesh" if MPTCP_FULLMESH=y - - config DEFAULT_DUMMY - bool "Default" - -endchoice - -endif - -config DEFAULT_MPTCP_PM - string - default "default" if DEFAULT_DUMMY - default "fullmesh" if DEFAULT_FULLMESH - default "default" -
net/mptcp/Makefile +1 -3
@@ -5,10 +5,8 @@ obj-$(CONFIG_MPTCP) += mptcp.o -mptcp-y := mptcp_ctrl.o mptcp_ipv4.o mptcp_pm.o \ +mptcp-y := mptcp_ctrl.o mptcp_ipv4.o mptcp_fullmesh.o \ mptcp_output.o mptcp_input.o mptcp_sched.o -obj-$(CONFIG_MPTCP_FULLMESH) += mptcp_fullmesh.o - mptcp-$(subst m,y,$(CONFIG_IPV6)) += mptcp_ipv6.o
net/mptcp/mptcp_ctrl.c +3 -46
103 lines not on this page · raw message
net/mptcp/mptcp_fullmesh.c +50 -276
531 lines not on this page · raw message
net/mptcp/mptcp_input.c +13 -19
@@ -44,15 +44,6 @@ static inline bool before64(const u64 seq1, const u64 seq2)/* is seq1 > seq2 ? */ #define after64 (seq1, seq2) before64(seq2, seq1) -static inline void mptcp_become_fully_estab (struct sock *sk) -{ -tcp_sk (sk)->mptcp->fully_established =1 ; - -if (is_master_tp (tcp_sk (sk)) && -tcp_sk (sk)->mpcb->pm_ops->fully_established) -tcp_sk (sk)->mpcb->pm_ops->fully_established (mptcp_meta_sk (sk)); -} -/* Similar to tcp_tso_acked without any memory accounting */ static inline int mptcp_tso_acked_reinject (const struct sock *meta_sk,struct sk_buff *skb)
@@ -436,8 +427,11 @@ static int mptcp_prevalidate_skb(struct sock *sk, struct sk_buff *skb)*/ if (!tp->mptcp->fully_established) { tp->mptcp->init_rcv_wnd -= skb->len; -if (tp->mptcp->init_rcv_wnd <0 ) -mptcp_become_fully_estab (sk); +if (tp->mptcp->init_rcv_wnd <0 ) { + tp->mptcp->fully_established =1 ; +if (is_master_tp (tp)) +full_mesh_create_subflows (tp->meta_sk); + } }return 0 ;
@@ -1243,11 +1237,14 @@ static void mptcp_data_ack(struct sock *sk, const struct sk_buff *skb)return ;if (unlikely (!tp->mptcp->fully_established) && - tp->mptcp->snt_isn +1 !=TCP_SKB_CB (skb)->ack_seq) + tp->mptcp->snt_isn +1 !=TCP_SKB_CB (skb)->ack_seq) {/* As soon as a subflow-data-ack (not acking syn, thus snt_isn + 1) * includes a data-ack, we are fully established */ -mptcp_become_fully_estab (sk); + tp->mptcp->fully_established =1 ; +if (is_master_tp (tp)) +full_mesh_create_subflows (meta_sk); + }/* After we did the subflow-only processing (stopping timer and marking * subflow as established), check if we can proceed with MPTCP-level
@@ -1757,8 +1754,7 @@ static void mptcp_handle_add_addr(const unsigned char *ptr, struct sock *sk)return ; } -if (mpcb->pm_ops->add_raddr) - mpcb->pm_ops->add_raddr (mpcb, &addr, family, port, mpadd->addr_id); +full_mesh_add_raddr (mpcb, &addr, family, port, mpadd->addr_id);MPTCP_INC_STATS (sock_net (sk),MPTCP_MIB_ADDADDRRX ); }
@@ -1773,8 +1769,7 @@ static void mptcp_handle_rem_addr(const unsigned char *ptr, struct sock *sk)for (i =0 ; i <= mprem->len -MPTCP_SUB_LEN_REMOVE_ADDR ; i++) { rem_id = (&mprem->addrs_id)[i]; -if (mpcb->pm_ops->rem_raddr) - mpcb->pm_ops->rem_raddr (mpcb, rem_id); +full_mesh_rem_raddr (mpcb, rem_id);mptcp_send_reset_rem_id (mpcb, rem_id);MPTCP_INC_STATS (sock_net (sk),MPTCP_MIB_REMADDRSUB );
@@ -1877,8 +1872,7 @@ static inline void mptcp_path_array_check(struct sock *meta_sk)if (unlikely (mpcb->list_rcvd)) { mpcb->list_rcvd =0 ; -if (mpcb->pm_ops->new_remote_address) - mpcb->pm_ops->new_remote_address (meta_sk); +full_mesh_create_subflows (meta_sk); } }
net/mptcp/mptcp_ipv4.c +1 -1
@@ -105,7 +105,7 @@ static int mptcp_v4_join_init_req(struct request_sock *req, const struct sock *mtcp_hdr (skb)->source, tcp_hdr(skb)->dest); addr.ip =inet_rsk (req)->ir_loc_addr; - loc_id = mpcb->pm_ops->get_local_id (AF_INET , &addr,sock_net (meta_sk)); + loc_id =full_mesh_get_local_id (AF_INET , &addr,sock_net (meta_sk));if (loc_id ==-1 )return -1 ; mtreq->loc_id = loc_id;
net/mptcp/mptcp_ipv6.c +1 -1
@@ -134,7 +134,7 @@ static int mptcp_v6_join_init_req(struct request_sock *req, const struct sock *mtcp_hdr (skb)->source, tcp_hdr(skb)->dest); addr.in6 =inet_rsk (req)->ir_v6_loc_addr; - loc_id = mpcb->pm_ops->get_local_id (AF_INET6 , &addr,sock_net (meta_sk)); + loc_id =full_mesh_get_local_id (AF_INET6 , &addr,sock_net (meta_sk));if (loc_id ==-1 )return -1 ; mtreq->loc_id = loc_id;
net/mptcp/mptcp_output.c +4 -4
@@ -709,9 +709,9 @@ void mptcp_established_options(struct sock *sk, struct sk_buff *skb, *size +=MPTCP_SUB_LEN_JOIN_ACK_ALIGN ; } -if (unlikely (mpcb->addr_signal) && mpcb->pm_ops->addr_signal && +if (unlikely (mpcb->addr_signal) && mpcb->mptcp_ver >=MPTCP_VERSION_1 && skb && !mptcp_is_data_seq (skb)) { - mpcb->pm_ops->addr_signal (sk, size, opts, skb); +full_mesh_addr_signal (sk, size, opts, skb);if (opts->add_addr_v6)/* Skip subsequent options */
@@ -734,9 +734,9 @@ void mptcp_established_options(struct sock *sk, struct sk_buff *skb, *size +=MPTCP_SUB_LEN_DSS_ALIGN ; } -if (unlikely (mpcb->addr_signal) && mpcb->pm_ops->addr_signal && +if (unlikely (mpcb->addr_signal) && mpcb->mptcp_ver <MPTCP_VERSION_1 ) - mpcb->pm_ops->addr_signal (sk, size, opts, skb); +full_mesh_addr_signal (sk, size, opts, skb);return ; }
net/mptcp/mptcp_pm.c deleted +0 -226
226 lines not on this page · raw message
Signature · 1 line
2.16.2
Matthieu Baerts
Hello,
Thanks Christoph for the v3!
For those who are interested by doing this review in Gerrit, I just sent this v3:
I also forgot to mention that I did the review for the v2 in Gerrit too.
Cheers,
Matthieu
Quoted 64 lines · Christoph Paasch
Series removing a lot of code out of mptcp-net-next.
Before:
$ git diff --shortstat 1464193107da..mptcp-net-next/master 54 files changed, 14663 insertions(+), 375 deletions(-)$ git diff --shortstat 1464193107da..HEAD 50 files changed, 12217 insertions(+), 349 deletions(-)v3: Minor left-over removals that were missing - identified by Matthieu
v2: Some minor fixes - see notes in the sub-patches 4/12 and 12/12Christoph Paasch (12):
mptcp: Remove support for DSS-checksums
mptcp: Remove some left-over cruft
mptcp: Remove RPS-recording for flow-steering in MPTCP
mptcp: Remove support for subflow-priorities (aka backup)
mptcp: Remove support forsendpage()
mptcp: Remove reinjection of data across subflows
mptcp: Remove support for TCP SYN-cookies
mptcp: Remove support for TCP Fast Open
mptcp: Remove MPTCP-code out ofdo_ip_setsockopt
mptcp: Remove scheduler-selection support
mptcp: Remove ndiffports path manager
mptcp: Make path-management no more a module nor selectable through
socketopsinclude/linux/tcp.h | 15 +- include/net/mptcp.h | 250 +++++++--------------- include/net/netns/mptcp.h | 8 +- include/net/tcp.h | 13 +- include/uapi/linux/if.h | 1 - include/uapi/linux/tcp.h | 1 - net/core/dev.c | 2 +- net/ipv4/Kconfig | 19 -- net/ipv4/af_inet.c | 6 - net/ipv4/ip_sockglue.c | 14 -- net/ipv4/syncookies.c | 47 +---- net/ipv4/tcp.c | 155 +------------- net/ipv4/tcp_fastopen.c | 16 +- net/ipv4/tcp_input.c | 29 +-- net/ipv4/tcp_minisocks.c | 2 +- net/ipv4/tcp_output.c | 3 +- net/ipv6/syncookies.c | 32 +-- net/mptcp/Kconfig | 81 ------- net/mptcp/Makefile | 5 +- net/mptcp/mptcp_ctrl.c | 261 +---------------------- net/mptcp/mptcp_fullmesh.c | 488 ++++++++----------------------------------- net/mptcp/mptcp_input.c | 343 ++---------------------------- net/mptcp/mptcp_ipv4.c | 34 +-- net/mptcp/mptcp_ipv6.c | 34 +-- net/mptcp/mptcp_ndiffports.c | 169 --------------- net/mptcp/mptcp_output.c | 472 ++--------------------------------------- net/mptcp/mptcp_pm.c | 226 -------------------- net/mptcp/mptcp_sched.c | 280 +++---------------------- 28 files changed, 293 insertions(+), 2713 deletions(-) delete mode 100644 net/mptcp/mptcp_ndiffports.c delete mode 100644 net/mptcp/mptcp_pm.c--
2.16.2
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