[PATCH v2 mptcp-net 1/2] mptcp: fix delack timer

Paolo Abeni posted 2 patches 4 years, 3 months ago
Maintainers: "David S. Miller" <davem@davemloft.net>, Matthieu Baerts <matthieu.baerts@tessares.net>, Peter Krystad <peter.krystad@linux.intel.com>, Jakub Kicinski <kuba@kernel.org>, Florian Westphal <fw@strlen.de>, Mat Martineau <mathew.j.martineau@linux.intel.com>, Paolo Abeni <pabeni@redhat.com>
[PATCH v2 mptcp-net 1/2] mptcp: fix delack timer
Posted by Paolo Abeni 4 years, 3 months ago
From: Eric Dumazet <edumazet@google.com>

To compute the rtx timeout schedule_3rdack_retransmission() does multiple
things in the wrong way: srtt_us is measures in usec/8 and the timeout
itself is an absolute vale.

Fixes: ec3edaa7ca6ce02f ("mptcp: Add handling of outgoing MP_JOIN requests")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
commit message typos added by me
---
 net/mptcp/options.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 7c3420afb1a0..2ca077fdf10a 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -434,9 +434,10 @@ static void schedule_3rdack_retransmission(struct sock *sk)
 
 	/* reschedule with a timeout above RTT, as we must look only for drop */
 	if (tp->srtt_us)
-		timeout = tp->srtt_us << 1;
+		timeout = usecs_to_jiffies(tp->srtt_us >> (3-1));
 	else
 		timeout = TCP_TIMEOUT_INIT;
+	timeout += jiffies;
 
 	WARN_ON_ONCE(icsk->icsk_ack.pending & ICSK_ACK_TIMER);
 	icsk->icsk_ack.pending |= ICSK_ACK_SCHED | ICSK_ACK_TIMER;
-- 
2.26.3


Re: [PATCH v2 mptcp-net 1/2] mptcp: fix delack timer
Posted by Mat Martineau 4 years, 3 months ago
On Tue, 2 Nov 2021, Paolo Abeni wrote:

> From: Eric Dumazet <edumazet@google.com>
>
> To compute the rtx timeout schedule_3rdack_retransmission() does multiple
> things in the wrong way: srtt_us is measures in usec/8 and the timeout
> itself is an absolute vale.
>
> Fixes: ec3edaa7ca6ce02f ("mptcp: Add handling of outgoing MP_JOIN requests")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> commit message typos added by me

Thanks for the v2 Paolo (both patches). I think they're good for applying 
to the export branch, maybe Matthieu can s/measures/measured/ and 
s/vale/value/ above to restore Eric's spelling :)

Reviewed-by: Mat Martineau <mathew.j.martineau>@linux.intel.com>


> ---
> net/mptcp/options.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index 7c3420afb1a0..2ca077fdf10a 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
> @@ -434,9 +434,10 @@ static void schedule_3rdack_retransmission(struct sock *sk)
>
> 	/* reschedule with a timeout above RTT, as we must look only for drop */
> 	if (tp->srtt_us)
> -		timeout = tp->srtt_us << 1;
> +		timeout = usecs_to_jiffies(tp->srtt_us >> (3-1));
> 	else
> 		timeout = TCP_TIMEOUT_INIT;
> +	timeout += jiffies;
>
> 	WARN_ON_ONCE(icsk->icsk_ack.pending & ICSK_ACK_TIMER);
> 	icsk->icsk_ack.pending |= ICSK_ACK_SCHED | ICSK_ACK_TIMER;
> -- 
> 2.26.3
>
>
>

--
Mat Martineau
Intel