From: Eric Dumazet Subject: Re: [PATCH v2 net-next 2/4] tcp: take care of compressed acks in tcp_add_reno_sack() Date: Tue, 27 Nov 2018 13:54:31 -0800 Message-ID: <967f7674-a0b2-8e25-8eea-d823d2c3353c@gmail.com> References: <20181127155738.73068-1-edumazet@google.com> <20181127155738.73068-3-edumazet@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: David Miller , Netdev , jean-louis@dupond.be, Yuchung Cheng , Eric Dumazet To: Neal Cardwell , Eric Dumazet Return-path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:43577 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbeK1Ixv (ORCPT ); Wed, 28 Nov 2018 03:53:51 -0500 Received: by mail-pf1-f196.google.com with SMTP id w73so9048475pfk.10 for ; Tue, 27 Nov 2018 13:54:33 -0800 (PST) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/27/2018 01:19 PM, Neal Cardwell wrote: > On Tue, Nov 27, 2018 at 10:57 AM Eric Dumazet wrote: >> >> Neal pointed out that non sack flows might suffer from ACK compression >> added in the following patch ("tcp: implement coalescing on backlog queue") >> >> Instead of tweaking tcp_add_backlog() we can take into >> account how many ACK were coalesced, this information >> will be available in skb_shinfo(skb)->gso_segs >> >> Signed-off-by: Eric Dumazet >> --- > ... >> @@ -2679,8 +2683,8 @@ static void tcp_process_loss(struct sock *sk, int flag, bool is_dupack, >> /* A Reno DUPACK means new data in F-RTO step 2.b above are >> * delivered. Lower inflight to clock out (re)tranmissions. >> */ >> - if (after(tp->snd_nxt, tp->high_seq) && is_dupack) >> - tcp_add_reno_sack(sk); >> + if (after(tp->snd_nxt, tp->high_seq)) >> + tcp_add_reno_sack(sk, num_dupack); >> else if (flag & FLAG_SND_UNA_ADVANCED) >> tcp_reset_reno_sack(tp); >> } > > I think this probably should be checking num_dupack, something like: > > + if (after(tp->snd_nxt, tp->high_seq) && num_dupack) > + tcp_add_reno_sack(sk, num_dupack); > > If we don't check num_dupack, that seems to mean that after FRTO sends > the two new data packets (making snd_nxt after high_seq), the patch > would have a particular non-SACK FRTO loss recovery always go into the > "if" branch where we tcp_add_reno_sack() function, and we would never > have a chance to get to the "else" branch where we check if > FLAG_SND_UNA_ADVANCED and zero out the reno SACKs. > > Otherwise the patch looks great to me. Thanks for doing this! > Oh right, I missed the else clause, I thought that tcp_add_reno_sack() checking the num_dupack was enough. Thanks.