Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9108202ybl; Fri, 17 Jan 2020 06:30:08 -0800 (PST) X-Google-Smtp-Source: APXvYqzYfJ/la0YxjVSX8BlfiAMtYe+pbvHlpV6v1YCNDVGiLr1ScuPaxhLFkVj9jT1muAG1ihlH X-Received: by 2002:a9d:2264:: with SMTP id o91mr6327697ota.328.1579271408009; Fri, 17 Jan 2020 06:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579271408; cv=none; d=google.com; s=arc-20160816; b=TghAf7gjOQKu/w5JgCKfRtGCAccuOcRQP68MqGDnZJUFwFb5ZDVOsu61Yu0MM4whKo d5M6/6jR/ls1zNyRWPVQjY460VyfjMVlPVvaFN+7RAvjJblB46j2nrRo/aCOUYtX64MK OWhhRRjODau9LFjmW9BrP19mMzsRKstjVog1MJ4TyggaF+M+hrEZIGplgVQgB5RfpMQ6 G1ubcARU7H5eKfeaIMitjj1fi4FQ8nN4koys+Z48UhSHlxnGeZ+xZLHpW9Sy0lCAMXEU Wyz3liQogwEaC7FXUhcIBxvfa25F7dGb7l22c1k41kFtOlzJxjCzyuACAx2lARHePfuW ye6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wx4YHHjEIs92WXguLwylQ65bmTpEJbutpC1Q71wXrBE=; b=pXiqDqnzx7JrVfL0nUllRLbX5Wt6ww6OtTiVB4bHx8mcdDioahOBaPKjbQONpLfAcW lK5fmsMWZGEh6NgQE4RQLf+lz+wBylWvl3p8V5sKIlwFTjPPvafjBP3pLAf02zkS4WXu FUnicNNm1+nC7x3HChHiV/nKnpVgiKfvBVN/Sq0f52JtP+Xl32Uw1Av5DVevC/3fdVrZ E/503XFU11u3gW4bM9l5P6P6gmaj/asUruZwdl4e020Pz6i53Zwq3el+R/DX3lmXevjq HA2/pfP3omu08emNbxsgyYSmKTswQbbkBlB1jswWN9+hZcxMlwGKXn9Hvyxi54eW/L5E BowA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=p06gb2hX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y65si14175787oia.162.2020.01.17.06.29.55; Fri, 17 Jan 2020 06:30:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=p06gb2hX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728799AbgAQO27 (ORCPT + 99 others); Fri, 17 Jan 2020 09:28:59 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:46020 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726951AbgAQO27 (ORCPT ); Fri, 17 Jan 2020 09:28:59 -0500 Received: by mail-oi1-f193.google.com with SMTP id n16so22313437oie.12 for ; Fri, 17 Jan 2020 06:28:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wx4YHHjEIs92WXguLwylQ65bmTpEJbutpC1Q71wXrBE=; b=p06gb2hXYIMEDQpGF7mdZEZrZWYjtpQ1BEfPre6zr33CM9N+acDO34sBaYwzGDByue wPLnKvVOpaIJ/A87KPmeFsERTpl/aCaUzbx+6Sy6TDbj8uzqbWocREvhCtUjbiAkgfCY WE8fbNUggQFye5KHjGGeNsM7MF415Of+515a+sBJDRDb037aeNwoSPd5PXItviYFlVB/ Hmg9Ii+VK8RyJVix4RB2JKlhQfOA5/TNL4izlQlGPFwArX7KAiNSPMoHbr6aPR7HEnnN UgpUooHsPlCXKGw+Y/D+zLI5qDzFsiNANBh3dp4xs3tgmlyFQGe2rH2mEuNyAWhly0G5 f3bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wx4YHHjEIs92WXguLwylQ65bmTpEJbutpC1Q71wXrBE=; b=WHDr610l5hCHayiGBd6miaRo/U9SYpdNk38rnsP4Yujx3i48kJxXei5oMVI1xH4oKX /ADCo3bcTGO23PHrK4Z/Vcmjl/RS88V/vpWv5YOwiHqMc6jbvVfpqpShamgQlQGFwNEo uN4wIlVGzEvcVm4/A07PwH4pEe7gsFhnZAcWjOmQa7UMKa7WvgN1jtcSyjKlg3nEDgvu 1SWWXWVD5EJq2O2W4HzDw6TNvGsktOqd1zjZtSqz/bg7v4wdnJ9UNfRVz2fyg0KM1Sqg QMk0Aq62yNbblgL7NdhF/QOuFf798X94uSK7y9gP15xqx1ZH282idpmiK/5Q09LMf9dS 5J3Q== X-Gm-Message-State: APjAAAVP9gdzTgoxF01s25OD3wDfIDej4x0rfNH+Pgq0vtKHFf9KwGq3 Sr6vgAkX7ocEUApX7MXFF5oGcnsc2NOdkm2uWnkw3A== X-Received: by 2002:a05:6808:2c4:: with SMTP id a4mr3493809oid.22.1579271338082; Fri, 17 Jan 2020 06:28:58 -0800 (PST) MIME-Version: 1.0 References: <1579255425-29273-1-git-send-email-yangpc@wangsu.com> In-Reply-To: <1579255425-29273-1-git-send-email-yangpc@wangsu.com> From: Neal Cardwell Date: Fri, 17 Jan 2020 09:28:41 -0500 Message-ID: Subject: Re: [PATCH] tcp: Use REXMIT_NEW instead of 2 To: Pengcheng Yang Cc: Eric Dumazet , David Miller , Alexey Kuznetsov , Hideaki YOSHIFUJI , Netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 17, 2020 at 5:04 AM Pengcheng Yang wrote: > > Use REXMIT_NEW instead of the confusing 2 in tcp_xmit_recovery() > > Signed-off-by: Pengcheng Yang > --- > net/ipv4/tcp_input.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > index 5347ab2..de07439 100644 > --- a/net/ipv4/tcp_input.c > +++ b/net/ipv4/tcp_input.c > @@ -3554,7 +3554,7 @@ static void tcp_xmit_recovery(struct sock *sk, int rexmit) > if (rexmit == REXMIT_NONE || sk->sk_state == TCP_SYN_SENT) > return; > > - if (unlikely(rexmit == 2)) { > + if (unlikely(rexmit == REXMIT_NEW)) { > __tcp_push_pending_frames(sk, tcp_current_mss(sk), > TCP_NAGLE_OFF); > if (after(tp->snd_nxt, tp->high_seq)) > -- This change was already made recently in the net-next branch (see below). To avoid duplicate work like this, please submit improvement patches like this as patches against the very latest net-next branch (or net branch, for bug fixes). thanks, neal -- commit d0e8bcafc8aff5553beffe55046795f9bab9fe7b Author: Mao Wenan Date: Thu Jan 2 22:02:27 2020 +0800 tcp: use REXMIT_NEW instead of magic number REXMIT_NEW is a macro for "FRTO-style transmit of unsent/new packets", this patch makes it more readable. Signed-off-by: Mao Wenan Acked-by: Neal Cardwell Signed-off-by: David S. Miller diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 88b987ca9ebb..1d1e3493965f 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -3550,7 +3550,7 @@ static void tcp_xmit_recovery(struct sock *sk, int rexmit) if (rexmit == REXMIT_NONE || sk->sk_state == TCP_SYN_SENT) return; - if (unlikely(rexmit == 2)) { + if (unlikely(rexmit == REXMIT_NEW)) { __tcp_push_pending_frames(sk, tcp_current_mss(sk), TCP_NAGLE_OFF); if (after(tp->snd_nxt, tp->high_seq))