mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: <namit@vmware.com>, <jpoimboe@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <x86@kernel.org>
Subject: [RFC PATCH v2 3/4] net: core: use a dynamic_call for dst_input
Date: Sat, 2 Feb 2019 00:07:48 +0000	[thread overview]
Message-ID: <26040f5c-daad-46ec-a364-8aac09a84773@solarflare.com> (raw)
In-Reply-To: <1c8bfbb9-c76f-85d7-f6e2-aba33d5950b0@solarflare.com>

Typically there will be a small number of callees, such as ip_local_deliver
 or ip_forward, which will cover most packets.

Signed-off-by: Edward Cree <ecree@solarflare.com>
---
 include/net/dst.h | 5 ++++-
 net/core/dst.c    | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/net/dst.h b/include/net/dst.h
index 6cf0870414c7..5dd838b9a7d2 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -16,6 +16,7 @@
 #include <linux/bug.h>
 #include <linux/jiffies.h>
 #include <linux/refcount.h>
+#include <linux/dynamic_call.h>
 #include <net/neighbour.h>
 #include <asm/processor.h>
 
@@ -444,10 +445,12 @@ static inline int dst_output(struct net *net, struct sock *sk, struct sk_buff *s
 	return skb_dst(skb)->output(net, sk, skb);
 }
 
+DEFINE_DYNAMIC_CALL_1(int, dst_input, 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 dynamic_dst_input(skb_dst(skb)->input, skb);
 }
 
 static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)
diff --git a/net/core/dst.c b/net/core/dst.c
index 81ccf20e2826..a00a75bab84e 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -342,3 +342,5 @@ void metadata_dst_free_percpu(struct metadata_dst __percpu *md_dst)
 	free_percpu(md_dst);
 }
 EXPORT_SYMBOL_GPL(metadata_dst_free_percpu);
+
+DYNAMIC_CALL_1(int, dst_input, struct sk_buff *);


  parent reply	other threads:[~2019-02-02  0:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-02  0:05 [RFC PATCH v2 0/4] dynamic indirect call promotion Edward Cree
2019-02-02  0:07 ` [RFC PATCH v2 1/4] static_call: add indirect call promotion (dynamic_call) infrastructure Edward Cree
2019-02-02  0:07 ` [RFC PATCH v2 2/4] net: core: use a dynamic_call for pt_prev->func() in RX path Edward Cree
2019-02-02  0:07 ` Edward Cree [this message]
2019-02-02  0:08 ` [RFC PATCH v2 4/4] net: core: use a dynamic_call for pt_prev->list_func() in list " Edward Cree
2019-02-05  8:50 ` [RFC PATCH v2 0/4] dynamic indirect call promotion Nadav Amit
2019-02-15 17:21   ` Edward Cree
2019-02-18 16:22     ` Nadav Amit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26040f5c-daad-46ec-a364-8aac09a84773@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namit@vmware.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®