Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2992977imm; Mon, 28 May 2018 21:56:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrR/c5Pj9548q9nrpXqtk3DbOzZVQEm9QkYvMTn8bsvTnpF6i2oRQR1dKNRlUAK/H/fD29P X-Received: by 2002:a63:6185:: with SMTP id v127-v6mr12215100pgb.301.1527569760522; Mon, 28 May 2018 21:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527569760; cv=none; d=google.com; s=arc-20160816; b=Yeh6m0E+vGAiFTiHyT3qKjgKqS9dOaHJRInYkzSnmCBMb4gbmgV9Im3C3AX3Hq+k3o kT77Vjnb9/9vjCQOnVHaDrV/cCwUi1F1ZQxQdRC7/ebjtbknw2tPxo/f2gnBDtSP+zkn jYQR3NPcQ/bXhbOW3WPcTDicAJqqwuBzDvGX0ag+1SnY/8dKhgxE6Qb4WD885AmGeqUQ nHj/s26KInYtmBgKzc8G95ld3sAy0vY8LDsjtgVnegj0vB1cGs6qQqmF+NbLzIiRVL35 /1iRMjXEDhxTNYrLoQ4olydDQoayryNS11tzSq6lFt9SVuhIN+RltkTL1/w1WMrlaOij 4xPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=cMm/+3ooPD+aXqxTdGrE9q3kOqJVasog5X2Wz6W/uZY=; b=nVjjSCGQekDwoACtshe0S2yi+RPN3/5g5WiHovV2cXwss9w63TgqLR8miqQTaWagMK hkTRovO+bfPvwseBDCpmdxmw7ai+mQ2NhHDl2QT4c641U7oDpKLwNkJqlx3g2+hUHf+j mJ2V2rPLyYBkv/hz38P76ccnW2zCClkzSUnye1gT4cWz6Cy9emkPEoMl26mNhhOPenCr qmY3GeNMlIHCGYhDxTw6w5FMI3Tey95RrnoqBquFAO0Du8sqvpnhAuMQXJGTwE7quA0a DBA7Jb6BKA+OWqDYo4fNrfF7ISgG+4HjKDzYwAB4kCamOTkFulv6I0NhG0ptX/bnRJgF 2zzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uOerzNev; 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 y125-v6si9190750pfb.284.2018.05.28.21.55.46; Mon, 28 May 2018 21:56:00 -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=uOerzNev; 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 S1754301AbeE2Exx (ORCPT + 99 others); Tue, 29 May 2018 00:53:53 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:44325 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751684AbeE2Exs (ORCPT ); Tue, 29 May 2018 00:53:48 -0400 Received: by mail-pl0-f68.google.com with SMTP id z9-v6so4875108plk.11; Mon, 28 May 2018 21:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cMm/+3ooPD+aXqxTdGrE9q3kOqJVasog5X2Wz6W/uZY=; b=uOerzNev8aV9dvEV17katDL44OUZNbBjD9Ix8FW92tSgvHt0Rl209juDSEXlcP4G59 TSQgvpQRiLlNAybJ/d/jLRqkulwk2S7vrxek1NUhwRKEbm+z4ZrLzp43L+qq/0FCBUP9 MBBBDXWXo/5uEFUr0/H6ZH0EJv3kzn7GLnNEvbCqCcWeI49z8A5HyRklKSOdJk17PtKb DsEjploqDNDMiLBUbH0zTXdKwZJ2+P13do1/tnc314Xk4b7wJ9/ZDT3XPibvNll7UANt PkQRohW/DKpEjiWiw+GYaOdq4HfMAUs4kHSEvX7eMkzGBV/t4Z0pdjGEWBPxLJerOOxg +q5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cMm/+3ooPD+aXqxTdGrE9q3kOqJVasog5X2Wz6W/uZY=; b=SJ/zmR/NqWSNVniNSacoKNabHbdXRVEncI5oAqCFVJb4q7QrzH2iwn5+77Z5Oa/Hhs +rOd1HVl98bePrBDgB3MA4jK2YCaQELXUQctTM/3d4hNErtNko807666lqCJvj1SdPu+ W28OnFHkFvDX7FLhyqyxlPUEPLlpKlAHpbUs4wOhsXymS3f3CN+WAk9z4n1RH4JErKqR W2hJgi7A1xOo20THNCH3GKhLhHZ+/uRpakg6ZZF39f0IkcQ1XQfxW94zsgcOK1KU5Wn0 aHCgdN0XVDLfCnkwoBWjvCji6X0Q2m+vAJX79BdM3Kvy5nhrT1KY0j0FKrKqF33VJ1Ob c6+g== X-Gm-Message-State: ALKqPwd6xNG1rsKY/fnPACMXxzZKMdTHMAGCgIQnFiXuowcGlFMJ3me7 TuEFpaZj0UeKTH31PxM53+EMtqMX X-Received: by 2002:a17:902:bb8d:: with SMTP id m13-v6mr12943401pls.46.1527569627515; Mon, 28 May 2018 21:53:47 -0700 (PDT) Received: from [192.168.86.235] (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.gmail.com with ESMTPSA id q19-v6sm32807888pgv.78.2018.05.28.21.53.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 May 2018 21:53:46 -0700 (PDT) Subject: Re: [PATCH v3 net-next 2/2] tcp: minor optimization around tcp_hdr() usage in tcp receive path To: Yafang Shao , Eric Dumazet Cc: Song Liu , David Miller , netdev , LKML References: <1527521753-17963-1-git-send-email-laoar.shao@gmail.com> <1527521753-17963-2-git-send-email-laoar.shao@gmail.com> From: Eric Dumazet Message-ID: <68b62912-21d5-c238-7536-12928670a08a@gmail.com> Date: Mon, 28 May 2018 21:53:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/28/2018 05:41 PM, Yafang Shao wrote: > OK. > > And what about introducing a new helper tcp_hdr_fast() ? > > /* use it when tcp header has not been pulled yet */ > static inline struct tcphdr *tcp_hdr_fast(const struct sk_buff *skb) > > { > > return (const struct tcphdr *)skb->data; > > } > > > That could help us to use this optimized one instead of the original > one if possilbe. I would rather not add such macro... The call site needs to know what is going on, so having a macro like that would not help.