Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1114524imd; Sat, 3 Nov 2018 18:30:03 -0700 (PDT) X-Google-Smtp-Source: AJdET5fXKbWryhoRlpcDT7oXTgxus9dpeuTO/iCW3nmmQVvoVmeVThjyWKuL5d3YWm4DvGxMM8SS X-Received: by 2002:a17:902:2468:: with SMTP id m37-v6mr17304519plg.154.1541295003086; Sat, 03 Nov 2018 18:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541295003; cv=none; d=google.com; s=arc-20160816; b=RauY4spx26o0hJR5TUFd0izjeNdU65XjqV2gU/wi/45iuo7gk3XXBSes3e/rSYdQx5 6omUYTX/7NvxyrqBuyts/iLvfOttmbfgGoOEWKGsn8PKqDN0m8SaR3d5OrvDca7joZ6J sZYlZp7i6dr4MtRIZI4bElxFqrgLardhA0jXAs/xBBTat3ynRk4rEqnImEk/S6A7jldf MKoD9Zff/5pPqOJp2w6VPQ1QzToWIxxZj/NOewe/w18cisStyDyZ2DkQJx3PaUoiicJT auUQkNrNw0z+9nBvd8d5OpPCVxzShKnhIRln2P3B7po90ijEOKwWfFz60soHSj5hXGDI Vg9w== 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=W0IDGKvVfVf9V0yuQdQ3MQoGoM2oWH/WQ8URjpCdwWU=; b=nr4ZkStcWdYwLsUUMscf5cjpVZ4xv44TmzxJllghLdgoxTUgUPZR2kI1pban3HBNiK T2gxj2iHr6fNMqG23d9PzmA1br5Nv6PHi3rvFo0z6XPOHnuwWaBlg+fMpxFr1m5V+3CL q0RsxffzJ9Vw4/AA6h++btGl7aqRzVTaK2Pdm96X5gnYquq0nag3wObgaLLFU5vqfsdJ YAyBQ7wpTRhibb5UIORvbyZP4HGJhAH1AB5RK6U0c+1axz5on5d0tL2u3KwKDVqfMwZ4 bL3f94sSPfUi8mm0qdngKNErLfl4410wtoraqBRVE209feU3+jGjoXnrO5Y+mY5BukJS CnTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WmCL8Evz; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si2535776pgk.49.2018.11.03.18.29.48; Sat, 03 Nov 2018 18:30:03 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=WmCL8Evz; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728912AbeKDKlQ (ORCPT + 99 others); Sun, 4 Nov 2018 05:41:16 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:52516 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727157AbeKDKlP (ORCPT ); Sun, 4 Nov 2018 05:41:15 -0500 Received: by mail-it1-f196.google.com with SMTP id t190-v6so2429713itb.2; Sat, 03 Nov 2018 18:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W0IDGKvVfVf9V0yuQdQ3MQoGoM2oWH/WQ8URjpCdwWU=; b=WmCL8Evzo/u08fxhWcyHiSI5OxwFrRilw/ymuoodwFuamIlOcMaRuF0/LblI0/Xc5t 9pFK8toGyB/VML5IfGPgLadjI339C8EOampizIibMVtmKzmZxfKVfdpG4vazOYcVkarC tQ498tQc741Ynrx6nvkno+AG+HEhOpEps1GTiG53r/JRMoTnUCThvsBpY5ZOGE28WQMD QmfLIz6QUl2lGX+BdsbarP8AZ8RDRTnFNSKlgt3msqAoutOUt7t8DLWJT3SEhtWI0/jD ehgl9MV9AfaEr1rOJDP6vksLlevtGBrdl+lez8GV6yWrNsO8gjgJDux7NgE9M/ikjDmZ iO5Q== 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=W0IDGKvVfVf9V0yuQdQ3MQoGoM2oWH/WQ8URjpCdwWU=; b=r9On9rAwGnorz8m0YM/U+WnXD4YyeZyfe6n0Vt0lwoz9BDcPHEkmrssaTvRQ5geW4m yk2Ce7mNjg0PSgv9dk5KK5kXIlbUkWq3zc7ZEqWE6+XprpXRfvlIredWGdJhv84ul1wx rsuzOSjWKYfswRsCwKoa/FCT3rtJWoustwwXwAu/9D+KacEWdN1rtoqX16/TAUhFTiUj zqEUwt7W/QSfxa4W8ZY5TsJ1wGJfVp7NHBulRKOhnU0kQI4LtnmT0Ll3WvRMgXN/NIPv yyG3qFupYknxWRb8SZgP101KK5hREGO2nEadm+B7cYWdZSSDV6395x3FwVIBJBuanpcU XGVw== X-Gm-Message-State: AGRZ1gLAE18+1IInL7KbCU/B+FB/o3rtTwzn2vPjSMOxD5tGYMfG1MKZ raCsWrCB6d6DaE+DNUfFkmsqGXQaca6A28zwBK148MHL X-Received: by 2002:a24:41db:: with SMTP id b88-v6mr2425119itd.97.1541294891559; Sat, 03 Nov 2018 18:28:11 -0700 (PDT) MIME-Version: 1.0 References: <1541264071-9905-1-git-send-email-laoar.shao@gmail.com> <945a90d62aa45c4b53349ba0a104574759d40efe.camel@perches.com> In-Reply-To: <945a90d62aa45c4b53349ba0a104574759d40efe.camel@perches.com> From: Yafang Shao Date: Sun, 4 Nov 2018 09:27:34 +0800 Message-ID: Subject: Re: [PATCH] tcp: do not update snd_una if it is same with ack_seq To: joe@perches.com Cc: David Miller , Eric Dumazet , 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 Sun, Nov 4, 2018 at 1:04 AM Joe Perches wrote: > > On Sun, 2018-11-04 at 00:54 +0800, Yafang Shao wrote: > > In the slow path, TCP_SKB_SB(skb)->ack_seq may be same with tp->snd_una, > > and under this condition we don't need to update the snd_una. > > > > Furthermore, tcp_ack_update_window() is only called in slow path, > > so introducing this check won't affect the fast path processing. > [] > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > [] > > @@ -3610,7 +3611,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) > > if (flag & FLAG_UPDATE_TS_RECENT) > > tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); > > > > - if (!(flag & FLAG_SLOWPATH) && after(ack, prior_snd_una)) { > > + if (!(flag & FLAG_SLOWPATH) && flag & FLAG_SND_UNA_ADVANCED) { > > stylistic nit: > > While the precedence is correct in any case, > perhaps adding parentheses around > flag & FLAG_SND_UNA_ADVANCED > would make it more obvious. > Sure. will change it. Thanks Yafang