Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2467394imm; Mon, 28 May 2018 08:37:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZosqBIY6XADaWTQveLhJHMpl6IZhpmBwgjWqLiH0KnjmAxnweJ3OC2vlnZcotf4CMbC+kuu X-Received: by 2002:a17:902:683:: with SMTP id 3-v6mr14186532plh.291.1527521868727; Mon, 28 May 2018 08:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527521868; cv=none; d=google.com; s=arc-20160816; b=Xu4YUOgqI4Bnv0Mo37zNB3IAUxn67JzL9NNbWCi9jW9DUkCaq9heYSfzhQd4mE97IE rtFGz7t4ORl9vuiGD2Yya93Ny6Ysd5F9I50haZ5hs/c/2X8NaX1etB+gI0iFu1bIoCR0 9agGI9wyp49TSNS9KaOGjEvuNENc7v0gNMLXS4snhGRcmkTFNiKAX3UtnusFs/VJYj6G 6pKupn4JofslaTJfDYvKAkO8/v+33f8rJNK3YefFBgxmAIt6nUx91p2tYPfOjNCUmK3n o4hW4etVy4XA6L/m+J2hocnwo4EzTNs85PtDBGdMviPv2pVGP61xzlJjxhmF2BgfIlHb dcrQ== 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:arc-authentication-results; bh=RYgnsgGDH2DZGlCutnwcznc4ECzEmCQZwkM3Ku89Vn8=; b=hH5XTUr6lgRn7q3PKq9MNstqeG3D0jXlFB+LElS3BX5sJWW5YgMyTPfx8ADUa4/JJv 6rOgofhVCCi2NzApRXyzzDM2Ukf6SCbiYJvURhA2ZTQuttLt38RClBAlxR5ed3JO9lHK SABnqq9kKh0rFiqfSLCb9SBRgbti81iECMSJqSbkBRdQueyNcKGSG0C9biI+Ff1P/8Mt 2cbl7n2DaN7YZoQ5aTQ+S+BQ0wTdUM5cWeHcRVIbDpsHCXMaPb/wRePbokR/Eb0puD+U qhuiET0j71rtjDJcfclMc72y0Rn5lN6V9DWkMdO4R3FaELe6woHumzOfoePepnzgQwwf fKpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NAmtqIXq; 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 z6-v6si13087129pgp.102.2018.05.28.08.37.34; Mon, 28 May 2018 08:37:48 -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=NAmtqIXq; 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 S1034623AbeE1PhC (ORCPT + 99 others); Mon, 28 May 2018 11:37:02 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35914 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968825AbeE1PgU (ORCPT ); Mon, 28 May 2018 11:36:20 -0400 Received: by mail-pf0-f196.google.com with SMTP id w129-v6so6000819pfd.3; Mon, 28 May 2018 08:36:20 -0700 (PDT) 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=RYgnsgGDH2DZGlCutnwcznc4ECzEmCQZwkM3Ku89Vn8=; b=NAmtqIXqfgW2604H3BryYU+jqPowK7XP4tzOEXaa4Qo8LTx8dToM9f/vixiq9w6AGE 9qchayw3mgcXq3nMbo+Tp4F5FkcJby9m26B2fR0n7QqR8m4NJnCjXmrlOFASUPGRBWBH /0p0nnB0AZ08p0HL659cp+7V85OvQzCw3/NQ60Ff59+BvQTWrGNXG/A0LLi7J2HELlK8 6J9XG6vh/gORtCQDGWGUedGWgnhIcogil3sh9BX5Ea/jIqLvrUNBa5S2DJwxaxOjwxFI tVCe3O25vKcADyo2g9ImmRlC8PDZZPeFVHHEPCXi42nQq80/Y01BR1tGEuq1VByOSFjN r35A== 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=RYgnsgGDH2DZGlCutnwcznc4ECzEmCQZwkM3Ku89Vn8=; b=FJp7ZNuX7pYMl8PQiZtd+FtNpWKFuz75zXyIXK45i9FTiz2wx7qxtATrdsQYQP9oNY t3qjtP4GiCygUZXP295CHJaXP0LVTQgsuWeuoANtcQOk+2ZuQDOp3n6BpJCxoLKM0rGh mUpyfnyyKhoYosZl3oM7DlqDcw/S/D+tm28B1HcE+CJxb7Ktl2FyqKo+aSex9+YdMu8O t21pjiD7GpE6WKXf5iF5loW4xr3bJprMfbjl8OoO5zhiIfRsH1xyYFvK+GNv3kFC2rLh xDTRPvs8vxd5BOpNRQ2KCRygCtMow8wywlJaGk3E1FCUmIQnpEao1NuxPZhZ318WAcPl gkBw== X-Gm-Message-State: ALKqPwfLXSNJ6lScSadkryD12jdNePjdCqIi2dxsmv3rsGfgRjtlqhkZ GJfttYaTa3rNyxuarPkfHRo= X-Received: by 2002:a62:7f91:: with SMTP id a139-v6mr13915580pfd.25.1527521780270; Mon, 28 May 2018 08:36:20 -0700 (PDT) Received: from li1588-6.members.linode.com (li1588-6.members.linode.com. [139.162.104.6]) by smtp.gmail.com with ESMTPSA id n10-v6sm71302232pfk.145.2018.05.28.08.36.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 08:36:19 -0700 (PDT) From: Yafang Shao To: songliubraving@fb.com, edumazet@google.com, davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH v3 net-next 2/2] tcp: minor optimization around tcp_hdr() usage in tcp receive path Date: Mon, 28 May 2018 23:35:53 +0800 Message-Id: <1527521753-17963-2-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1527521753-17963-1-git-send-email-laoar.shao@gmail.com> References: <1527521753-17963-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 This is additional to the commit ea1627c20c34 ("tcp: minor optimizations around tcp_hdr() usage"). At this point, skb->data is same with tcp_hdr() as tcp header has not been pulled yet. Cc: Eric Dumazet Signed-off-by: Yafang Shao --- net/ipv4/tcp_ipv4.c | 2 +- net/ipv6/tcp_ipv6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index adbdb50..d179386 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1486,7 +1486,7 @@ int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb) sk->sk_rx_dst = NULL; } } - tcp_rcv_established(sk, skb, tcp_hdr(skb)); + tcp_rcv_established(sk, skb, (const struct tcphdr *)skb->data); return 0; } diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 7d47c2b..1c633ff 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1322,7 +1322,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) } } - tcp_rcv_established(sk, skb, tcp_hdr(skb)); + tcp_rcv_established(sk, skb, (const struct tcphdr *)skb->data); if (opt_skb) goto ipv6_pktoptions; return 0; -- 1.8.3.1