From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next] tcp: fix ABC in tcp_slow_start() Date: Fri, 20 Jul 2012 16:56:35 +0200 Message-ID: <1342796195.2626.7363.camel@edumazet-glaptop> References: <1342762841.2626.5633.camel@edumazet-glaptop> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: David Miller , netdev , Tom Herbert , Yuchung Cheng , Neal Cardwell , Nandita Dukkipati , Stephen Hemminger To: John Heffner Return-path: Received: from mail-bk0-f46.google.com ([209.85.214.46]:32779 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752507Ab2GTO4m (ORCPT ); Fri, 20 Jul 2012 10:56:42 -0400 Received: by bkwj10 with SMTP id j10so3462507bkw.19 for ; Fri, 20 Jul 2012 07:56:41 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 2012-07-20 at 10:41 -0400, John Heffner wrote: > It might be clearer to instead introduce a temporary variable to > calculate the snd_cwnd change in the while loop. That is: > > unsigned int snd_cwnd_delta = 0; > ... > tp->snd_cwnd_cnt += cnt; > while (tp->snd_cwnd_cnt >= tp->snd_cwnd) { > tp->snd_cwnd_cnt -= tp->snd_cwnd; > snd_cwnd_delta++; > } > tp->snd_cwnd = min(tp->snd_cwnd + snd_cwnd_delta, tp->snd_cwnd_clamp); > Good idea, thanks, I'll send a v2