From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuchung Cheng Subject: [PATH net 3/4] tcp: fix off-by-one bug in RACK Date: Thu, 7 Dec 2017 11:33:32 -0800 Message-ID: <20171207193333.59039-4-ycheng@google.com> References: <20171207193333.59039-1-ycheng@google.com> Cc: netdev@vger.kernel.org, edumazet@google.com, ncardwell@google.com, priyarjha@google.com, Yuchung Cheng To: davem@davemloft.net Return-path: Received: from mail-it0-f67.google.com ([209.85.214.67]:39813 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751288AbdLGTdv (ORCPT ); Thu, 7 Dec 2017 14:33:51 -0500 Received: by mail-it0-f67.google.com with SMTP id 68so16977972ite.4 for ; Thu, 07 Dec 2017 11:33:51 -0800 (PST) In-Reply-To: <20171207193333.59039-1-ycheng@google.com> Sender: netdev-owner@vger.kernel.org List-ID: RACK should mark a packet lost when remaining wait time is zero. Signed-off-by: Yuchung Cheng Reviewed-by: Neal Cardwell Reviewed-by: Priyaranjan Jha Reviewed-by: Eric Dumazet --- net/ipv4/tcp_recovery.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv4/tcp_recovery.c b/net/ipv4/tcp_recovery.c index 3143664902e9..0c182303e62e 100644 --- a/net/ipv4/tcp_recovery.c +++ b/net/ipv4/tcp_recovery.c @@ -80,12 +80,12 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout) */ remaining = tp->rack.rtt_us + reo_wnd - tcp_stamp_us_delta(tp->tcp_mstamp, skb->skb_mstamp); - if (remaining < 0) { + if (remaining <= 0) { tcp_rack_mark_skb_lost(sk, skb); list_del_init(&skb->tcp_tsorted_anchor); } else { - /* Record maximum wait time (+1 to avoid 0) */ - *reo_timeout = max_t(u32, *reo_timeout, 1 + remaining); + /* Record maximum wait time */ + *reo_timeout = max_t(u32, *reo_timeout, remaining); } } } -- 2.15.1.424.g9478a66081-goog