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/pm.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/pm.c')
-rw-r--r-- | net/mptcp/pm.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 639271e09604..9ff17c5205ce 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -308,6 +308,23 @@ int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc) return mptcp_pm_nl_get_local_id(msk, skc); } +void mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk) +{ + struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk); + u32 rcv_tstamp = READ_ONCE(tcp_sk(ssk)->rcv_tstamp); + + /* keep track of rtx periods with no progress */ + if (!subflow->stale_count) { + subflow->stale_rcv_tstamp = rcv_tstamp; + subflow->stale_count++; + } else if (subflow->stale_rcv_tstamp == rcv_tstamp) { + if (subflow->stale_count < U8_MAX) + subflow->stale_count++; + } else { + subflow->stale_count = 0; + } +} + void mptcp_pm_data_init(struct mptcp_sock *msk) { msk->pm.add_addr_signaled = 0; |