diff options
author | Paolo Abeni <pabeni@redhat.com> | 2021-08-14 01:15:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-08-14 13:37:25 +0300 |
commit | 71b7dec27f340c4ab90ef39ae096d8bb2e1c851c (patch) | |
tree | e0261e6240435e71bdae81139820adf14089bc3b /net/mptcp/protocol.c | |
parent | 33d41c9cd74c56643a710810703b6bce6eb25efa (diff) | |
download | linux-71b7dec27f340c4ab90ef39ae096d8bb2e1c851c.tar.xz |
mptcp: less aggressive retransmission strategy
The current mptcp re-inject strategy is very aggressive,
we have mptcp-level retransmissions even on single subflow
connection, if the link in-use is lossy.
Let's be a little more conservative: we do retransmit
only if at least a subflow has write and rtx queue empty.
Additionally use the backup subflows only if the active
subflows are stale - no progresses in at least an rtx period
and ignore stale subflows for rtx timeout update
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/207
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/protocol.c')
-rw-r--r-- | net/mptcp/protocol.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 08fa2c73a7e5..decbb4295ae1 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -420,7 +420,8 @@ static long mptcp_timeout_from_subflow(const struct mptcp_subflow_context *subfl { const struct sock *ssk = mptcp_subflow_tcp_sock(subflow); - return inet_csk(ssk)->icsk_pending ? inet_csk(ssk)->icsk_timeout - jiffies : 0; + return inet_csk(ssk)->icsk_pending && !subflow->stale_count ? + inet_csk(ssk)->icsk_timeout - jiffies : 0; } static void mptcp_set_timeout(struct sock *sk) @@ -2100,8 +2101,9 @@ static void mptcp_timeout_timer(struct timer_list *t) */ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk) { + struct sock *backup = NULL, *pick = NULL; struct mptcp_subflow_context *subflow; - struct sock *backup = NULL; + int min_stale_count = INT_MAX; sock_owned_by_me((const struct sock *)msk); @@ -2114,11 +2116,11 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk) if (!mptcp_subflow_active(subflow)) continue; - /* still data outstanding at TCP level? Don't retransmit. */ - if (!tcp_write_queue_empty(ssk)) { - if (inet_csk(ssk)->icsk_ca_state >= TCP_CA_Loss) - continue; - return NULL; + /* still data outstanding at TCP level? skip this */ + if (!tcp_rtx_and_write_queues_empty(ssk)) { + mptcp_pm_subflow_chk_stale(msk, ssk); + min_stale_count = min_t(int, min_stale_count, subflow->stale_count); + continue; } if (subflow->backup) { @@ -2127,10 +2129,15 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk) continue; } - return ssk; + if (!pick) + pick = ssk; } - return backup; + if (pick) + return pick; + + /* use backup only if there are no progresses anywhere */ + return min_stale_count > 1 ? backup : NULL; } static void mptcp_dispose_initial_subflow(struct mptcp_sock *msk) |