Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp327395pxu; Fri, 11 Dec 2020 03:22:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfa0cqyyTCrvOH/Eu31+Qju4E161I6/aXyP01QwZWOSEb03189fCQP3aMI97w2s9MRXFgI X-Received: by 2002:a50:9ee6:: with SMTP id a93mr11446140edf.174.1607685777281; Fri, 11 Dec 2020 03:22:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607685777; cv=none; d=google.com; s=arc-20160816; b=w6HZbgfA9tUjLkJglpadg/VHDSr5Ks0eOjwvUb+Un5lHHYM9wLZbb8w3jULksZ1Uia wEOYsGWnPCndNHCnLdRa8UzGHLLC8LG9gbnlXGwuoHC+8e20z4p1iEg/lPKilxmlPV7k +XJ+03cwDfS0Kn2rcllAZpQd0M9Zs4fhfgLVVOdEbKGSpM51mF+CVyMXlxfyxe4JkS5V 4qn4GjGAO3iMnHRQIdugaJzNepFYNaazj6yV4yI2L2ki2XUNXeGAPKFK3TzkpnP5LeLk 8zNfTpoUtQqR8dml6RIMUF+yemfEa9D9GidTVpErmK+VmHgVR39cyK/Jj6OjVwkNK90V EP+Q== 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=JZuBMUjdVVVxh6WnK4CWaG8XFlwg5qneM5nzLNIVeag=; b=Nz7AC406n4H41uGCZH2pdmalH8aAvK65rSmkhwXrxEKVwhRPlA26MaAyKAisEEqaMB 1gkNPtAHiDD0EuCel4PmIsulgYW4kj/MUd+d00uckJuyzSpkJ1N4eux6XlWAPbwrXsww Q7uqTK68Ou+a0ZELBI4SAnMZjshdffWCRtb1YojXT/RSwbA83sGxv4LMF/mDcU9qYH/Y uBA+ESXHbxQh/XqTEkpdQgI5VxXq9CgxImd95gnj6gAUWY67RK38CSkEeYpOSAi9XSM3 YtFz/XhzqWIy1nZfH1H2J0iWFEiPDbfb50CXvgZeJjRzYPYbFBYmff/AIBx0namD19OG ChSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ko6IbsPS; 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.22.34; Fri, 11 Dec 2020 03:22:57 -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=ko6IbsPS; 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 S2395023AbgLKCAS (ORCPT + 99 others); Thu, 10 Dec 2020 21:00:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391596AbgLKB7u (ORCPT ); Thu, 10 Dec 2020 20:59:50 -0500 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D11CC06179C for ; Thu, 10 Dec 2020 17:58:33 -0800 (PST) Received: by mail-pg1-x54a.google.com with SMTP id q4so5431967pgn.0 for ; Thu, 10 Dec 2020 17:58:33 -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=JZuBMUjdVVVxh6WnK4CWaG8XFlwg5qneM5nzLNIVeag=; b=ko6IbsPShEqsmfAfsfV9qvC127/jPkMqeofdfguKVDhv4nl4PDHYX0VMp3YLRGQHpd M9FIEZPyHzEjhCzMvJS1Q3kmPNYL88oBazzPo+UWk5Bj9slbUNmN+z7RIEwVb7od+GtU sW1+wy9m4H3MrISFx6vRt3pCu3UUUrpSQsw1Cv3EOAXbhNBzj+hFbcT72q90susNYJuM 2g3YmJtYWRQnDygT5FJIG5GfVA7FvANcKmFVmI1MtfOzZ2Rv2CsQLe7zpQ3sMnV+zzs+ j7rSlK/ixBtETx6kq03jHXYo2XnRMuM4/XE1PAsbJ1WtZBuErSpMuVfVKX3cUoY1yn0T JHyA== 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=JZuBMUjdVVVxh6WnK4CWaG8XFlwg5qneM5nzLNIVeag=; b=rdPxbSCJQcFXjKS1EccvszXGYNOeBeKV+jyNcgTA5AWlA9AkDBmsTBk7pop/XxUcRC h5eQRNyjdKkuTc0haSawadumKCsKjrZGR5aVoVgs4wBt9kcVPfiJUPRAeoKCYBl4U3ee Sgq7vpk/q9P8cGr9NleQ9R3bz5ZU9l4u8/3xARp2SxoWXRAV+zvHKPaULJwpRxwlVsiL gr5nrfgEYNyarhPGIv4XFrarf6ue9aqojkjBe9LXhuUoXH1ngD6bOJvZnfFZKq99cVvE 212L990/ZaD2e7B1vPx5oV69tkiRWJ7B9Mc0VbX6Vugt2cCIyPe+vOdy5i60CeBd262X S5Cg== X-Gm-Message-State: AOAM531kNHhv4Rv4bPBdIA3feEiJevQafUZCgNRgzAOrgZCTCkuXgcJt 4HYPIHL8MGs+vTO7VmFsUAhEjt5Umw96 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:a17:90b:50a:: with SMTP id r10mr10755699pjz.103.1607651912600; Thu, 10 Dec 2020 17:58:32 -0800 (PST) Date: Fri, 11 Dec 2020 01:58:21 +0000 In-Reply-To: <20201211015823.1079574-1-brianvv@google.com> Message-Id: <20201211015823.1079574-3-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 2/4] net: use indirect call helpers for dst_output 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: ip6_output and ip_output Signed-off-by: brianvv --- include/net/dst.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/net/dst.h b/include/net/dst.h index 98cf6e8c06c4..3932e9931f08 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -436,10 +436,16 @@ static inline void dst_set_expires(struct dst_entry *dst, int timeout) dst->expires = expires; } +INDIRECT_CALLABLE_DECLARE(int ip6_output(struct net *, struct sock *, + struct sk_buff *)); +INDIRECT_CALLABLE_DECLARE(int ip_output(struct net *, struct sock *, + struct sk_buff *)); /* Output packet to network from transport. */ static inline int dst_output(struct net *net, struct sock *sk, struct sk_buff *skb) { - return skb_dst(skb)->output(net, sk, skb); + return INDIRECT_CALL_INET(skb_dst(skb)->output, + ip6_output, ip_output, + net, sk, skb); } INDIRECT_CALLABLE_DECLARE(int ip6_input(struct sk_buff *)); -- 2.29.2.576.ga3fc446d84-goog