Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp326168pxu; Fri, 11 Dec 2020 03:20:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNBbeShP/qPqk/tQude37Jju9NzbWTKQ5Vm8BAhTNVZdf8Db8m6tI7GwNBMW/t+BXgOLGC X-Received: by 2002:a50:9d04:: with SMTP id v4mr11322149ede.363.1607685655811; Fri, 11 Dec 2020 03:20:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607685655; cv=none; d=google.com; s=arc-20160816; b=lfJvt9v41WMcOcrCgh3YcZ72J0aWCTKEn+Yclb7hIFYZFLZxzCmxUqcw3PRJiKek5g RpLU7vIK2QCdwGtqFz6JCVuOBWc46A73T94x4z9RTRTmsYhn702lrQz/MJbRY4xkjP2F JcZWYfhVk64YfcUtw/nKvVV/Tzwu0u7bQzYy9H2c0Yu/kR3oENs5NUlqUwwOtInZi2NY ZMNQ/nNQRqataGC5asM9mn+MZvnBM9wxrcRszWGKIMf6pushuv4Dw8rZgzTsRmyRdE6n ZqlhakP9JNNI5+z4gtZ8ezd9sIcsGv2RgeJTYwR10gcKNJJclj/PUMMxhJtDLufcliWf heZQ== 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=aDAJY+8VIyQrulSE2QmK19TS3uRloTNCtUe012HVBlY=; b=tuZ5OonxsZjCERNCAOQ3hU9JEUVUBeZW66uBWpYv9PHCCzBmTvftsIcUQpZBe+JGMs x+YCuetSdi6sxsJN8WF2B9F9Yiq3Cab7kpWjyv3vBaP8Ek8hxBgir58hOHHHiUygB0lH vMnGAwG1D/jbijYiYfH+8WO0rQRyIReUH/EJuJ+i480oShZTcrEqrs6i7izd5CW2Ayv5 HxAZe92ptEz7lOaeSh5OV7WD4RlizUtuIfrjHVhKv5rMds0kxespz7ZFY6gAfX1ODw8p X60kJYmm+3Sm4LapzGCo1x+WmAecez2RFsGjhr3k6X5GHkc99oqkrm6HU99fjm4eNrFs b33A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WY0wPAkE; 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 zc2si4472842ejb.427.2020.12.11.03.20.31; Fri, 11 Dec 2020 03:20:55 -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=WY0wPAkE; 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 S2394998AbgLKB70 (ORCPT + 99 others); Thu, 10 Dec 2020 20:59:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391182AbgLKB7L (ORCPT ); Thu, 10 Dec 2020 20:59:11 -0500 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69C6CC061793 for ; Thu, 10 Dec 2020 17:58:31 -0800 (PST) Received: by mail-pg1-x549.google.com with SMTP id i6so5437060pgg.10 for ; Thu, 10 Dec 2020 17:58:31 -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=aDAJY+8VIyQrulSE2QmK19TS3uRloTNCtUe012HVBlY=; b=WY0wPAkEvRHvd0V95IlCbjSJdmpuWYQiBudlmdQoBVhngtSq6VOXDHi7se/3cQ0lAH L1x0OCQnhimFFGx1IuKBQaela/tfqY+ZhyFxvDmKnxKvX/Q7pvOY+QKeKr8tk7hXlnGW MpFnWponVBcwuzxQ34lHdTY6E2hFY60CJVVR/p7/MauubF3jFubAfKFOcZVo4SWFmtKF RA1cHNV3qfvr3RfEexC8d5wBXKUdwVZ2OG2C8KP+PGHTQRzFeoCnJhCbtrigFhXpWivT jA8FtbYA6BAc4KbvSl/UB/dXoSLhCQ853Tlc9g5L5wZgy2Os+YK6TLoH9QOdLONRpkOK JtAA== 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=aDAJY+8VIyQrulSE2QmK19TS3uRloTNCtUe012HVBlY=; b=RoDRWs3kctDXkSLyjDGSntTL4+j0OzMVXBJH1g+3FaCZopxGWpy95jOZESMWcLkUwo J0ClHO97QMhhvJgWOZ2s/o/xYFFXbVEujA7FTrbO1hCu1wZHST9uotLlWjrAaM7J7yuR lmBnH764yVwF2BOf/va/voRJp2EPmau/uVE2Cekcw/k4nIZet7YTFvqAZ0pqpZ2dpu3I n5jTXa4SLfXLPDpnZYL6KkcpERsNc3UnhgCyZe0ARz5MtiQOBHHQp+aCYahAI12hk39H jHXGFj6w/+bKP+Fzn3LZ35q0ieWz/qkR+4XRDy7fnaYlEd2+l7jIxs36kup4VLvNmk6F OGxg== X-Gm-Message-State: AOAM533nDDiVAsVVI7saexTM0LysK6WNYGzPgMmaHtb0/GicnlkZD6v9 C9ug/sidjDdtGZ+jqNle7gy56hqrs/20 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:a62:7e09:0:b029:19e:9fdd:80a3 with SMTP id z9-20020a627e090000b029019e9fdd80a3mr8312032pfc.24.1607651910852; Thu, 10 Dec 2020 17:58:30 -0800 (PST) Date: Fri, 11 Dec 2020 01:58:20 +0000 In-Reply-To: <20201211015823.1079574-1-brianvv@google.com> Message-Id: <20201211015823.1079574-2-brianvv@google.com> Mime-Version: 1.0 References: <20201211015823.1079574-1-brianvv@google.com> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog Subject: [PATCH net-next 1/4] net: use indirect call helpers for dst_input From: Brian Vazquez To: Brian Vazquez , Brian Vazquez , Eric Dumazet , "David S . Miller" 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 From: brianvv This patch avoids the indirect call for the common case: ip_local_deliver and ip6_input Signed-off-by: brianvv --- include/net/dst.h | 6 +++++- 1 file changed, 5 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) -- 2.29.2.576.ga3fc446d84-goog