From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuchung Cheng Subject: Re: [PATCH] net: tcp: add correct check for tcp_retransmit_skb() Date: Fri, 30 Nov 2018 10:41:33 -0800 Message-ID: References: <20181130182828.GA27508@svurukal-linux.qualcomm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: netdev , chinagar@codeaurora.org, kapandey@codeaurora.org, subashab@codeaurora.org To: Sharath Chandra Vurukala Return-path: Received: from mail-io1-f65.google.com ([209.85.166.65]:40036 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725817AbeLAFwV (ORCPT ); Sat, 1 Dec 2018 00:52:21 -0500 Received: by mail-io1-f65.google.com with SMTP id n9so5334652ioh.7 for ; Fri, 30 Nov 2018 10:42:10 -0800 (PST) In-Reply-To: <20181130182828.GA27508@svurukal-linux.qualcomm.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Nov 30, 2018 at 10:28 AM Sharath Chandra Vurukala wrote: > > when the tcp_retranmission_timer expires and tcp_retranmsit_skb is > called if the retranmsission fails due to local congestion, > backoff should not incremented. > > tcp_retransmit_skb() returns non-zero negative value in some cases of > failure but the caller tcp_retransmission_timer() has a check for > failure which checks if the return value is greater than zero. > The check is corrected to check for non-zero value. > > Signed-off-by: Sharath Chandra Vurukala Perhaps my previous comment was not clear: your bug-fix patch is incorrect. On local congestion, tcp_retransmit_skb returns positive values *only*. negative values do not indicate local congestion. > --- > net/ipv4/tcp_timer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c > index 091c5392..c19f371 100644 > --- a/net/ipv4/tcp_timer.c > +++ b/net/ipv4/tcp_timer.c > @@ -511,7 +511,7 @@ void tcp_retransmit_timer(struct sock *sk) > > tcp_enter_loss(sk); > > - if (tcp_retransmit_skb(sk, tcp_rtx_queue_head(sk), 1) > 0) { > + if (tcp_retransmit_skb(sk, tcp_rtx_queue_head(sk), 1) != 0) { > /* Retransmission failed because of local congestion, > * do not backoff. > */ > -- > 1.9.1 >