Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3000888imu; Wed, 7 Nov 2018 03:21:32 -0800 (PST) X-Google-Smtp-Source: AJdET5dsRz0VXr2VfB88EN95vMfqUK6QL0Ll0k9bOe4cy3kXO2bCF8M9jfuB1z71JESrNjhQRd4v X-Received: by 2002:a62:7796:: with SMTP id s144-v6mr1431465pfc.159.1541589692700; Wed, 07 Nov 2018 03:21:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541589692; cv=none; d=google.com; s=arc-20160816; b=UBTAnttKL2oQc2kfJdGAEMWzz+opA4TCsmGpJ/gyHs1PdbJm8mrKUS8JpYB6+u6all RdzvQbKyFgqZox1pyKpLBvnm2pLQ5ZFM607szqsUSSO5EIRQ8iXRg7PHRnFRaPS6pX/w vDF0mV3Jw1OMHIpshWNpJwz3PHv9jWQjlwZoOyfCZqJnphJGc4YgiTIPoiZwmfUpypwP IRyZ11QWpCQoeHNt4kDNepYIHuTtq7+RRLYaGEWF7FJHER1U+KuQ4W4me49W+O6GCL01 yod2mM/CHzMgTyCjYS5tCFgGsf0BdVJ50qjVKZbUNOgKQaX9T0bqPLHpEjGeb7pOKnFj DzlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=s+/LY0Utln20yvP4ObufTh8Pnkckv99Fm/1BIKpKhyk=; b=nSLGxqCYGdqU8YC47KWNkEp1w8G76EN3jcsAMH0SGPAnZB1WZt3WdP24xb35Bzm8pV dLVcZM+mbvnVnbc0IThdPdvh9QcLPE70sgOIfe4Yw8mVJwy8NMEIeUDGEdgL7y5pKPU2 hVF2QqDXeE4w5Wwzr7OvgTcXF8JlpwiNvHGS5YlcHA638Xc7fCbbVJRMuD9TSV/Bj2s0 jeHNdt2UD/Vq1o683aMrAnzoULOdPTjItQc0eTUiaPJ+Od8CVR7WD8PXEDd9zjfKEwD2 AaJ64YPICzoD3LbLaXM0tYuqTF0E1gaaKQ7Bw9Fje3yNRMnmA6MakIWaaSGDj71oElkZ soXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iAklOp16; 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 2si288770pgy.35.2018.11.07.03.21.17; Wed, 07 Nov 2018 03:21:32 -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=@gmail.com header.s=20161025 header.b=iAklOp16; 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 S1730853AbeKGUuv (ORCPT + 99 others); Wed, 7 Nov 2018 15:50:51 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:38558 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726225AbeKGUuu (ORCPT ); Wed, 7 Nov 2018 15:50:50 -0500 Received: by mail-pf1-f195.google.com with SMTP id b11-v6so7586033pfi.5; Wed, 07 Nov 2018 03:20:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=s+/LY0Utln20yvP4ObufTh8Pnkckv99Fm/1BIKpKhyk=; b=iAklOp16v730+zBUPgMggKYxExGCnsDq1gUJZGHq0EK4iGA1Je1+rfrXk5a8NrmTX+ hA84qoxM1QL7m+JMuwe3frdRortXTT+6aRIDaF+yfvEDqxQNW7nKZsNHkmjAd4vszN1F Z3yXaFPNUll9TTqOb+cXDgjO9WMhT7MsAVoQQJyxlswj4iTscEzbdH1IaajnyHqnwFyZ Oe/DNPkP0q1afmT6m2UWvERM39p+s+VYHILne6EZ1z+KjWvtJeMP/1iF+hsc+o2oUqP6 QkaKTrJjLj2F6jWfyDzTbQXVkADJFD3hQxbrOGqcJL2y1ytF2m57Y55kbG/w0ZhF7nmL VAYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=s+/LY0Utln20yvP4ObufTh8Pnkckv99Fm/1BIKpKhyk=; b=JGE1bx3bxE4R+QTDXmDVqhql4+sr4i7x84x30Wzf+U9aoOX9xlWBEt/LGjf7wpWpvK GVoRYnxHabHvzjdlyXF/DWR8WlNHio2fFtEDCBNf2xXsgI5DkhLRNnSD8hQdPqllelK2 nbisrbZqx5BoSWBHw/BSVhF28zJosqEW8YXfO4ReAEOmrLAjNvz87B3uKIXqUgqKFhg2 +P8fd4WHgoDhLUoBszle3BtzWc0Ncj0xRML55v71Yr9ab6lv3RTt6fX0xlfukc+TW+vR 43rhmoBhTW7/mb2ylfrP57qJ8l8Zg8YH+MXVOZ7y+Q9D0KAiu/BbdVekhcN1x5amKhwA V9rg== X-Gm-Message-State: AGRZ1gLq3OcHeauQox6UvkwIxXgSFFaglSdimctW7AHLfZKTz2sPpMl3 tgDIhoY4LcXgISJM8BRTyEcKGFgh X-Received: by 2002:a62:5bc7:: with SMTP id p190-v6mr4000pfb.175.1541589653937; Wed, 07 Nov 2018 03:20:53 -0800 (PST) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id m129-v6sm452622pfm.78.2018.11.07.03.20.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 03:20:53 -0800 (PST) From: Yafang Shao To: davem@davemloft.net, edumazet@google.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao , Joe Perches Subject: [PATCH net-next] tcp: minor optimization in tcp ack fast path processing Date: Wed, 7 Nov 2018 19:20:17 +0800 Message-Id: <1541589617-1607-2-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1541589617-1607-1-git-send-email-laoar.shao@gmail.com> References: <1541589617-1607-1-git-send-email-laoar.shao@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bitwise operation is a little faster. So I replace after() with (flag & FLAG_SND_UNA_ADVANCED) as this flag is already set before. Cc: Joe Perches Signed-off-by: Yafang Shao --- 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 2868ef2..0167015 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -3610,7 +3610,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)) { /* Window is constant, pure forward advance. * No more checks are required. * Note, we use the fact that SND.UNA>=SND.WL2. -- 1.8.3.1