Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3998778pxb; Mon, 1 Feb 2021 09:46:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3WFZyfJfUnrdVyKRe3mr23mvKbi8beG00jltPdfmjPNHw0JXXYxpKfD/P5BI2zXQeYhLi X-Received: by 2002:a17:906:d189:: with SMTP id c9mr19355834ejz.36.1612201597418; Mon, 01 Feb 2021 09:46:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612201597; cv=none; d=google.com; s=arc-20160816; b=qw9K8i8WyWahwuXZMiOt1AhoY/SIAfYV0YCMwqAdEsjl6DdMIoWMNOK2KzrjRwHavu Lx7KodZupw3jOzG184U5g3fcBT3oAmsmkdLwAvJ3gNJQToHgZ5C9yy1jjxUehNGUJwXG XXzVq4eZXDTDOr1LH7AJMPGcOI01lHjZX+zuN1pH99bqFX+2K686Vj15zYdWivYZX1NY 3zp1M4QrMgsiweBWGAKjn24RUEtvUykOtxsH2uffYWkKgHorlnmKJ5Er7E4m91YrmwAF +asVoxwawQaQojSyCoiko8UDgGNxmmlSlc8mrvXSZtbjACRnHVSL1vIB4hObJAiLc6XA gXJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=2dJAjQqhEjIVgRLObUehhbawcyx+wTN2wrBIU5NRBZE=; b=Ikvr2VtYeV9F3SUdbb09py/wTB41bnJJXGQm62yNsWKjJuvPogAqUnROPnefoIHfBd wxBgavAlViij7mRbSlk7OciwE6it1yL1pAgWpfQU/Ffw78/ocDObJIKLZ4fOARmTAcQp 7YzJwHQ2AxE8QAU5yKdQVq9M6n8w5CsvP4vqVH4DdpD6UGE/O5qDVwTZg5qpplmKzVkZ ZcEArZiv+ptqedBBvH+vInDLge7fvXwmIY8Ps+aW8/EBYy9lHsyvabbpSWKRfF2+HMT0 ivjlYl+RW4R03bzHgsx93HH1wUbF3PSLPk8VT5foPPiUmoRzA8HDXjLfOGPbxbDW+/23 /mZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Zb/6M+XH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si614583edk.452.2021.02.01.09.46.12; Mon, 01 Feb 2021 09:46:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Zb/6M+XH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbhBARmh (ORCPT + 99 others); Mon, 1 Feb 2021 12:42:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbhBARmV (ORCPT ); Mon, 1 Feb 2021 12:42:21 -0500 Received: from mail-pf1-x44a.google.com (mail-pf1-x44a.google.com [IPv6:2607:f8b0:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E90EC0613D6 for ; Mon, 1 Feb 2021 09:41:41 -0800 (PST) Received: by mail-pf1-x44a.google.com with SMTP id n123so11269990pfn.10 for ; Mon, 01 Feb 2021 09:41:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=2dJAjQqhEjIVgRLObUehhbawcyx+wTN2wrBIU5NRBZE=; b=Zb/6M+XHCJqrYdZT8bW7liJK+lRA/UwvDlzWoPO9OSJe+MU0zDUVkXerihD2tPtBGy Y+7ql7AboELh2KMeBGcua+lWzDtZtPENDrtrQe0DbT2p7mJpopsG0a96OYplzBXgqe1Y jq2TWCS90Lc0PNuwHXHS+PHQQArIKfKzA3FoHcUXhmNFkUwX+wYGDdbEEmUG2bth0G3J Yz1AefphnCPqH8ilfPBZWyk3j7uGZzaGJaCN7fWfd7ZkyaNXo/2clrmqhyh61vSGfiXw FwHdfR+Kk/OyR+T3+Fp+Bna8zeSjxYtBox+K2wIPa4ZspdkCgLg5CW67jUDP12eAui+i 54xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=2dJAjQqhEjIVgRLObUehhbawcyx+wTN2wrBIU5NRBZE=; b=D2aVTTO1WaFbxO83Dmzeo3fUQisLP9XomfyR9iVdi3UAxNratp9Y/K+RTe+DBAiRFj uHptE3lpp7l2ksFWEMAomYSykWpwtSoQrgHFul25cTXXvR5zGq/ZKsNYgzk6ROqePF7i 4jc4RSQQgrSuucE4HCzGDyuOGkr3YhGB4C0l/ThZKq44nl2neQh8u0SG5eKt9hV8zJKb WxDPYEXlpaVYQRk47jQXfmg6HducBLhbhiWPGjAqj8CepmlJMHg/qcjwm16LJ1fw6lwZ /HuRBHMCmMORvbYOl9ZxoRZzTnp0j7sUcPgsZUDkQvaiwajOScSoQizJV1T4v8H0238y h4iA== X-Gm-Message-State: AOAM532zAVbFUI/8vcvPUCl3tls/LJLFlqLtGdmNfvB1B+W4Qz4hIqpm 8DMtxmLktUjYLd66x6Lq84ykbp+5Kof6 Sender: "brianvv via sendgmr" X-Received: from brianvv.c.googlers.com ([fda3:e722:ac3:10:7f:e700:c0a8:348]) (user=brianvv job=sendgmr) by 2002:a63:3648:: with SMTP id d69mr18173594pga.155.1612201301026; Mon, 01 Feb 2021 09:41:41 -0800 (PST) Date: Mon, 1 Feb 2021 17:41:29 +0000 In-Reply-To: <20210201174132.3534118-1-brianvv@google.com> Message-Id: <20210201174132.3534118-2-brianvv@google.com> Mime-Version: 1.0 References: <20210201174132.3534118-1-brianvv@google.com> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog Subject: [PATCH net-next v3 1/4] net: use indirect call helpers for dst_input From: Brian Vazquez To: Brian Vazquez , Brian Vazquez , Eric Dumazet , Luigi Rizzo , "David S . Miller" , Jakub Kicinski Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch avoids the indirect call for the common case: ip_local_deliver and ip6_input Signed-off-by: Brian Vazquez --- include/net/dst.h | 6 +++++- net/ipv4/ip_input.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/net/dst.h b/include/net/dst.h index 10f0a8399867..98cf6e8c06c4 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -18,6 +18,7 @@ #include #include #include +#include struct sk_buff; @@ -441,10 +442,13 @@ static inline int dst_output(struct net *net, struct sock *sk, struct sk_buff *s return skb_dst(skb)->output(net, sk, skb); } +INDIRECT_CALLABLE_DECLARE(int ip6_input(struct sk_buff *)); +INDIRECT_CALLABLE_DECLARE(int ip_local_deliver(struct sk_buff *)); /* Input packet from network to transport. */ static inline int dst_input(struct sk_buff *skb) { - return skb_dst(skb)->input(skb); + return INDIRECT_CALL_INET(skb_dst(skb)->input, + ip6_input, ip_local_deliver, skb); } static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie) diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index b0c244af1e4d..3a025c011971 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -253,6 +253,7 @@ int ip_local_deliver(struct sk_buff *skb) net, NULL, skb, skb->dev, NULL, ip_local_deliver_finish); } +EXPORT_SYMBOL(ip_local_deliver); static inline bool ip_rcv_options(struct sk_buff *skb, struct net_device *dev) { -- 2.30.0.365.g02bc693789-goog