Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3258724imm; Tue, 29 May 2018 04:10:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL0wfpGkmlkjxJu3b7yFWTh6e4GBsd91SbmlfTEKRVIe+nFS1v/QqLbZ9v9r7RfYCSwNqyJ X-Received: by 2002:a63:8f0d:: with SMTP id n13-v6mr2610065pgd.109.1527592223432; Tue, 29 May 2018 04:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527592223; cv=none; d=google.com; s=arc-20160816; b=P/5ekVHQoKOZGj3EDjEoAieAcPvO7RmVsHBrWvTrcCt4fJUb/HKlppKJKymxmPAwim +c9tydVQE2v9IAQrpMwX85zAfzlaAQdHLcJAETz+8kIxjVv5i5isTwNGohTyebfZMor/ +fm3+qa2enqL0r64idA9ZbExcuu5Fsu5T4DKzq51rshZbuuUK+pceVcHSi5ygbxdDtIe zrnhoIdkDMCkmj8tVTTpFwg9bAcyR14BkVKMDzdu3iK/1BsaG+wnpzuqoHBRvs9K7y7p 3HxFHx2iXCkNl0cMXv4NHs3OB/9OvpNpaQShyiAiYdmE7c6rVlF/1DB5AybfcJ20chs5 hxrw== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=NnZKm0egrGQsBNo0ys1ilMq1rG0AUiDxbSyZFlEC/UA=; b=jSYgcyhwGK2mYlBjXxpztlX2/JWZRr4cKlMyGCdVBnqO0ehtNAHVxSEeZA6+al0KpH 1xPfUh35KBnG6rEkyy8QvOx/0dqsmiqRGv+YXdnySSMCT8cNIF/ik0RDSx8nppgjj0Tu 6DXxvOjeHW+fjW2IPiEix1DIMR8EnuaEsOLdNj1NG5F2Rd3EC8vTm9RfCZ3+K9eWORAR cQhawzOC7NPUTe3dclNokbkO3Dz8ofc0EabunQXI4cFPrzn5lo6l76/3W4Sup6UJACLy RuEIVcRJV6gw/4ittr2BriMgTO/jPhABTSlTbyV3oUwu6VNYYFXV4iURVTfC86YLN+xk dvAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=izMcgB9G; 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 d20-v6si30957868pfn.213.2018.05.29.04.10.09; Tue, 29 May 2018 04:10:23 -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=izMcgB9G; 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 S933286AbeE2LJm (ORCPT + 99 others); Tue, 29 May 2018 07:09:42 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:38408 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932949AbeE2LJj (ORCPT ); Tue, 29 May 2018 07:09:39 -0400 Received: by mail-it0-f65.google.com with SMTP id q4-v6so17979749ite.3; Tue, 29 May 2018 04:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NnZKm0egrGQsBNo0ys1ilMq1rG0AUiDxbSyZFlEC/UA=; b=izMcgB9GjOKmT8RPlKNyzYorrjxKjnjM7UwmQISHQ1SsXscgTn4vJUMJgICKBsazUV L0NsHRCGRLx21f94Pc0B6njfkhebkJNSHmLmgXk4QXWe0B2DId/kffMx6yF7ASVwmlqO e1+g2O3NHaDiWh3/fKExusEME+3jAkm5vrB7QEAkO5MehruFOjOOYEpglTDVBCCsTDIK SmOW4QgtBT7aUvfy4h06pn8x7fJfCPKuGpF2tvSojsAudZN68A+wbj/GLeNLmlJ5ug2e gwtQuqXBnF+obmAjyHHmq0xtc+rxn5uLWHzIwkPK0MPWb47DFEDVBQzoIE3R9J9HOz7/ Nabw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NnZKm0egrGQsBNo0ys1ilMq1rG0AUiDxbSyZFlEC/UA=; b=d7zFjV4Ka8wNZSuLUH7215NDTzeV/a1wH5Fwzcj6sYZKBr9O1JNvpHnymwk+UhcefR Vakn+95UkaqwzZxGkziQDqdvHvEBb/xsQUe+RVLA0ycdA9725V5RIyXOXys2XpsLPwBg QxAjzCNvq/Thp1A5WyL3n7OCM7Jt1p+LbC0QtO9daMyTaUyJuuVQi7JceJmR6KURZM3X x5iC/YkoGVu8lCylxXSOs3HgZMKELIKpZMZ1QxVh3khpJp5nvSYOyO1sxyo+nAlNbfgt EMiws6xDmyfu6wlLe/kRz1VCkyxYqluhT71NzbVbaxFD3Pfh3SI/u8nUdTPFGxQI6SH3 KygQ== X-Gm-Message-State: ALKqPwcprbtL9jA0UuF5nAmFRdgy9CUAEN/PAb5cu3x4Ov7fjtdITuU1 zSPklIhmRSMyLdG0l25xTU3u2YyJjIu0qbHszRA= X-Received: by 2002:a24:5c47:: with SMTP id q68-v6mr14436331itb.118.1527592179159; Tue, 29 May 2018 04:09:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ef03:0:0:0:0:0 with HTTP; Tue, 29 May 2018 04:08:58 -0700 (PDT) In-Reply-To: <68b62912-21d5-c238-7536-12928670a08a@gmail.com> References: <1527521753-17963-1-git-send-email-laoar.shao@gmail.com> <1527521753-17963-2-git-send-email-laoar.shao@gmail.com> <68b62912-21d5-c238-7536-12928670a08a@gmail.com> From: Yafang Shao Date: Tue, 29 May 2018 19:08:58 +0800 Message-ID: Subject: Re: [PATCH v3 net-next 2/2] tcp: minor optimization around tcp_hdr() usage in tcp receive path To: Eric Dumazet Cc: Eric Dumazet , Song Liu , David Miller , 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 Tue, May 29, 2018 at 12:53 PM, Eric Dumazet wrote: > > > 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. OK