From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next v2] tcp: force cwnd at least 2 in tcp_cwnd_reduction Date: Wed, 27 Jun 2018 08:06:39 -0700 Message-ID: <45aaced5-a85f-56b4-6671-904a0899ce58@gmail.com> References: <20180627023403.3395818-1-brakmo@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Kernel Team , Blake Matheny , Alexei Starovoitov To: Lawrence Brakmo , netdev Return-path: Received: from mail-ot0-f194.google.com ([74.125.82.194]:35074 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752362AbeF0PGm (ORCPT ); Wed, 27 Jun 2018 11:06:42 -0400 Received: by mail-ot0-f194.google.com with SMTP id a6-v6so2562559otf.2 for ; Wed, 27 Jun 2018 08:06:42 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 06/27/2018 08:04 AM, Eric Dumazet wrote: > > > On 06/26/2018 07:34 PM, Lawrence Brakmo wrote: >> When using dctcp and doing RPCs, if the last packet of a request is >> ECN marked as having seen congestion (CE), the sender can decrease its >> cwnd to 1. As a result, it will only send one packet when a new request >> is sent. In some instances this results in high tail latencies. >> > >> } >> /* Force a fast retransmit upon entering fast recovery */ >> sndcnt = max(sndcnt, (tp->prr_out ? 0 : 1)); >> - tp->snd_cwnd = tcp_packets_in_flight(tp) + sndcnt; >> + tp->snd_cwnd = max((int)tcp_packets_in_flight(tp) + sndcnt, 2); > > Canonical way is to use min_t(), please respin (no need to explain this trivia in changelog) Well, max_t() here, obviously :)