Forward-ports for mptcp-net-next
Subsystems (3)
Christoph Paasch
cover Forward-ports for mptcp-net-next
Hello,
here are some forward-ports for mptcp-net-next that come from mptcp_trunk.
Cheers,
Christoph
Christoph Paasch (3):
mptcp: Remove IPv6 duplicated address detection
mptcp: Always call sk_data_ready
mptcp: Correctly initialize IPv6 fields
Kostas Peletidis (2):
Export tcp_send_ack symbol to fix build issue with mptcp_fullmesh
module (mptcp_trunk). This commit should make it possible to revert 64a80850.
Revert "Fix building mptcp_fullmesh as module"
net/ipv4/tcp_input.c | 2 +- net/ipv4/tcp_output.c | 1 + net/mptcp/mptcp_ctrl.c | 30 ++++++++-------- net/mptcp/mptcp_fullmesh.c | 85 ++++++---------------------------------------- 4 files changed, 29 insertions(+), 89 deletions(-)
Signature · 1 line
2.16.2
Christoph Paasch
PATCH 1/5 Export tcp_send_ack symbol to fix build issue with mptcp_fullmesh module (mptcp_trunk). This commit should make it possible to revert 64a80850.
From: Kostas Peletidis <kostas(a)peletidis.net>
--- net/ipv4/tcp_output.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/tcp_output.c +1 -0
@@ -3709,6 +3709,7 @@ void tcp_send_ack(struct sock *sk) {__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); } +EXPORT_SYMBOL_GPL (tcp_send_ack);/* This routine sends a packet with an out of date sequence * number. It assumes the other end will try to ack it.
Signature · 1 line
2.16.2
Christoph Paasch
PATCH 2/5 Revert "Fix building mptcp_fullmesh as module"
In reply to Christoph PaaschFrom: Kostas Peletidis <kostas(a)peletidis.net>
This reverts commit 64a808507dc425759bed331742fdbb62f0061870.
--- net/mptcp/mptcp_fullmesh.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
net/mptcp/mptcp_fullmesh.c +10 -10
@@ -606,7 +606,7 @@ static void announce_remove_addr(u8 addr_id, struct sock *meta_sk) mpcb->addr_signal =1 ;if (sk) -__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); +tcp_send_ack (sk); } static void update_addr_bitfields(struct sock *meta_sk,
@@ -897,7 +897,7 @@ static void mptcp_address_worker(struct work_struct *work) sk =mptcp_select_ack_sock (meta_sk);if (sk) -__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); +tcp_send_ack (sk);full_mesh_create_subflows (meta_sk); }
@@ -980,7 +980,7 @@ static void mptcp_address_worker(struct work_struct *work) tp->mptcp->send_mp_prio =1 ; tp->mptcp->low_prio = event->low_prio; -__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); +tcp_send_ack (sk); } }
@@ -991,7 +991,7 @@ static void mptcp_address_worker(struct work_struct *work) tp->mptcp->send_mp_prio =1 ; tp->mptcp->low_prio = event->low_prio; -__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); +tcp_send_ack (sk); } } }
@@ -1399,10 +1399,10 @@ static void full_mesh_new_session(const struct sock *meta_sk) fmp->announced_addrs_v6 |= (1 << index);for (i = fmp->add_addr; i && fmp->add_addr; i--) -__tcp_send_ack (mpcb->master_sk,tcp_sk (mpcb->master_sk)->rcv_nxt); +tcp_send_ack (mpcb->master_sk);if (master_tp->mptcp->send_mp_prio) -__tcp_send_ack (mpcb->master_sk,tcp_sk (mpcb->master_sk)->rcv_nxt); +tcp_send_ack (mpcb->master_sk);return ;
@@ -1492,7 +1492,7 @@ static void full_mesh_release_sock(struct sock *meta_sk) tp->mptcp->send_mp_prio =1 ; tp->mptcp->low_prio = mptcp_local->locaddr4[i].low_prio; -__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); +tcp_send_ack (sk); } }
@@ -1504,7 +1504,7 @@ static void full_mesh_release_sock(struct sock *meta_sk) sk =mptcp_select_ack_sock (meta_sk);if (sk) -__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); +tcp_send_ack (sk);full_mesh_create_subflows (meta_sk); } }
@@ -1536,7 +1536,7 @@ static void full_mesh_release_sock(struct sock *meta_sk) tp->mptcp->send_mp_prio =1 ; tp->mptcp->low_prio = mptcp_local->locaddr6[i].low_prio; -__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); +tcp_send_ack (sk); } }
@@ -1548,7 +1548,7 @@ static void full_mesh_release_sock(struct sock *meta_sk) sk =mptcp_select_ack_sock (meta_sk);if (sk) -__tcp_send_ack (sk,tcp_sk (sk)->rcv_nxt); +tcp_send_ack (sk);full_mesh_create_subflows (meta_sk); } }
Signature · 1 line
2.16.2
Christoph Paasch
PATCH 3/5 mptcp: Remove IPv6 duplicated address detection
In reply to Christoph PaaschIt causes us to take a refcnt on the address and actually periodically schedule a timer until eventually the address gets either marked as confirmed or removed.
It causes regressions in the Android test-suite.
This patch simply removes the duplicate address detection. That way, when we get an IPv6-address we use it right away. Also, if the address turns out to be duplicate on the link (which is really a cornercase scenario), it will be removed and our subflow will be destroyed. I don't think that's a big deal.
I don't suggest to backport this patch as it's more of a design-change than a bugfix.
Github-issue: https://github.com/multipath-tcp/mptcp/issues/293
--- net/mptcp/mptcp_fullmesh.c | 65 +--------------------------------------------- 1 file changed, 1 insertion(+), 64 deletions(-)
net/mptcp/mptcp_fullmesh.c +1 -64
@@ -1122,69 +1122,9 @@ static struct notifier_block mptcp_pm_inetaddr_notifier = {#if IS_ENABLED (CONFIG_IPV6 ) -/* IPV6-related address/interface watchers */ -struct mptcp_dad_data { -struct timer_list timer; -struct inet6_ifaddr *ifa; -}; - -static void dad_callback (struct timer_list *t);static int inet6_addr_event (struct notifier_block *this,unsigned long event,void *ptr); -static bool ipv6_dad_finished (const struct inet6_ifaddr *ifa) -{ -return !(ifa->flags &IFA_F_TENTATIVE ) || - ifa->state >INET6_IFADDR_STATE_DAD ; -} - -static void dad_init_timer (struct mptcp_dad_data *data, -struct inet6_ifaddr *ifa) -{ - data->ifa = ifa; -if (ifa->idev->cnf.rtr_solicit_delay) - data->timer.expires = jiffies + ifa->idev->cnf.rtr_solicit_delay; -else - data->timer.expires = jiffies + (HZ /10 ); -} - -static void dad_callback (struct timer_list *t) -{ -struct mptcp_dad_data *data =from_timer (data, t, timer); - -/* DAD failed or IP brought down? */ -if (data->ifa->state ==INET6_IFADDR_STATE_ERRDAD || - data->ifa->state ==INET6_IFADDR_STATE_DEAD ) - goto exit; - -if (!ipv6_dad_finished (data->ifa)) { -dad_init_timer (data, data->ifa); -add_timer (&data->timer); -return ; - } - -inet6_addr_event (NULL ,NETDEV_UP , data->ifa); - -exit: -in6_ifa_put (data->ifa); -kfree (data); -} - -static inline void dad_setup_timer (struct inet6_ifaddr *ifa) -{ -struct mptcp_dad_data *data; - - data =kmalloc (sizeof (*data),GFP_ATOMIC ); - -if (!data) -return ; - -timer_setup (&data->timer, dad_callback,0 ); -dad_init_timer (data, ifa); -add_timer (&data->timer); -in6_ifa_hold (ifa); -} -static void addr6_event_handler (const struct inet6_ifaddr *ifa,unsigned long event,struct net *net) {
@@ -1233,10 +1173,7 @@ static int inet6_addr_event(struct notifier_block *this, unsigned long event, event == NETDEV_CHANGE))return NOTIFY_DONE ; -if (!ipv6_dad_finished (ifa6)) -dad_setup_timer (ifa6); -else -addr6_event_handler (ifa6, event, net); +addr6_event_handler (ifa6, event, net);return NOTIFY_DONE ; }
Signature · 1 line
2.16.2
Christoph Paasch
PATCH 4/5 mptcp: Always call sk_data_ready
In reply to Christoph PaaschSince commit 03f45c883c6f ("tcp: avoid extra wakeups for SO_RCVLOWAT users"), tcp_data_queue checks for available bytes in the subflow's receive-queue before waking up the "app". However, with MPTCP we might have zero-length data-fins in the queue. Thus, we still need to wakeup the MPTCP-layer in case of a subflow.
--- net/ipv4/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_input.c +1 -1
@@ -4741,7 +4741,7 @@ void tcp_data_ready(struct sock *sk)const struct tcp_sock *tp =tcp_sk (sk);int avail = tp->rcv_nxt - tp->copied_seq; -if (avail < sk->sk_rcvlowat && !sock_flag (sk,SOCK_DONE )) +if (avail < sk->sk_rcvlowat && !sock_flag (sk,SOCK_DONE ) && !mptcp (tp))return ; sk->sk_data_ready (sk);
Signature · 1 line
2.16.2
Christoph Paasch
PATCH 5/5 mptcp: Correctly initialize IPv6 fields
In reply to Christoph PaaschWe are not correctly initializing all the IPv6 fields when creating an IPv6 socket in mptcp_alloc_mpcb.
This creates problems when IPv6 extensions are being used.
Github-issue: https://github.com/multipath-tcp/mptcp/issues/266
--- net/mptcp/mptcp_ctrl.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-)
net/mptcp/mptcp_ctrl.c +16 -14
@@ -1159,32 +1159,34 @@ static int mptcp_alloc_mpcb(struct sock *meta_sk, __u64 remote_key,#if IS_ENABLED (CONFIG_IPV6 )if (meta_icsk->icsk_af_ops == &mptcp_v6_mapped) { +struct tcp6_sock *master_tp6 = (struct tcp6_sock *)master_sk;struct ipv6_pinfo *newnp, *np =inet6_sk (meta_sk); -inet_sk (master_sk)->pinet6 = &((struct tcp6_sock *)master_sk)->inet6; +inet_sk (master_sk)->pinet6 = &master_tp6->inet6; newnp =inet6_sk (master_sk);memcpy (newnp, np,sizeof (struct ipv6_pinfo )); - - newnp->ipv6_mc_list =NULL ; - newnp->ipv6_ac_list =NULL ; - newnp->ipv6_fl_list =NULL ; - newnp->opt =NULL ; - newnp->pktoptions =NULL ; - (void )xchg (&newnp->rxpmtu,NULL ); }else if (meta_sk->sk_family ==AF_INET6 ) { +struct tcp6_sock *master_tp6 = (struct tcp6_sock *)master_sk;struct ipv6_pinfo *newnp, *np =inet6_sk (meta_sk); +struct ipv6_txoptions *opt; -inet_sk (master_sk)->pinet6 = &((struct tcp6_sock *)master_sk)->inet6; +inet_sk (master_sk)->pinet6 = &master_tp6->inet6; +/* The following heavily inspired from tcp_v6_syn_recv_sock() */ newnp =inet6_sk (master_sk);memcpy (newnp, np,sizeof (struct ipv6_pinfo )); - newnp->hop_limit =-1 ; - newnp->mcast_hops =IPV6_DEFAULT_MCASTHOPS ; - newnp->mc_loop =1 ; - newnp->pmtudisc =IPV6_PMTUDISC_WANT ; - master_sk->sk_ipv6only =sock_net (master_sk)->ipv6.sysctl.bindv6only; + opt =rcu_dereference (np->opt); +if (opt) { + opt =ipv6_dup_options (master_sk, opt); +RCU_INIT_POINTER (newnp->opt, opt); + } +inet_csk (master_sk)->icsk_ext_hdr_len =0 ; +if (opt) +inet_csk (master_sk)->icsk_ext_hdr_len = opt->opt_nflen + + opt->opt_flen; + }#endif
Signature · 1 line
2.16.2
Mat Martineau
Quoted 5 lines · Christoph Paasch
Hello,
here are some forward-ports for mptcp-net-next that come from
mptcp_trunk.
Thanks Christoph. I merged net-next and applied your patches. mptcp_net-next has the updates.
Mat
Quoted 12 lines
Christoph Paasch (3):
mptcp: Remove IPv6 duplicated address detection
mptcp: Always callsk_data_ready
mptcp: Correctly initialize IPv6 fieldsKostas Peletidis (2):
Exporttcp_send_acksymbol to fix build issue withmptcp_fullmesh
module (mptcp_trunk). This commit should make it possible to revert64a80850.
Revert "Fix buildingmptcp_fullmeshas module"
Quoted 10 lines
net/ipv4/tcp_input.c | 2 +- net/ipv4/tcp_output.c | 1 + net/mptcp/mptcp_ctrl.c | 30 ++++++++-------- net/mptcp/mptcp_fullmesh.c | 85 ++++++---------------------------------------- 4 files changed, 29 insertions(+), 89 deletions(-)Signature · 1 line
2.16.2
--
Mat Martineau
Intel OTC