Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1367827

[PATCH net-next 5/6] net: export napi_by_id()

From Jason Wang <jasowang@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next 5/6] net: export napi_by_id()
Date 2016-03-31 08:00 +0200
Message-ID <riDOb-iF-17@gated-at.bofh.it> (permalink)
References <riDOa-iF-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch exports napi_by_id() which will be used by vhost_net socket
busy polling.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 include/net/busy_poll.h | 1 +
 net/core/dev.c          | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h
index e765e23..dc9c76d 100644
--- a/include/net/busy_poll.h
+++ b/include/net/busy_poll.h
@@ -74,6 +74,7 @@ static inline bool busy_loop_timeout(unsigned long end_time)
 
 bool sk_busy_loop(struct sock *sk, int nonblock);
 int sk_busy_loop_once(struct sock *sk, struct napi_struct *napi);
+struct napi_struct *napi_by_id(unsigned int napi_id);
 
 /* used in the NIC receive handler to mark the skb */
 static inline void skb_mark_napi_id(struct sk_buff *skb,
diff --git a/net/core/dev.c b/net/core/dev.c
index a2f0c46..b98d210 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4888,7 +4888,7 @@ void napi_complete_done(struct napi_struct *n, int work_done)
 EXPORT_SYMBOL(napi_complete_done);
 
 /* must be called under rcu_read_lock(), as we dont take a reference */
-static struct napi_struct *napi_by_id(unsigned int napi_id)
+struct napi_struct *napi_by_id(unsigned int napi_id)
 {
 	unsigned int hash = napi_id % HASH_SIZE(napi_hash);
 	struct napi_struct *napi;
@@ -4899,6 +4899,7 @@ static struct napi_struct *napi_by_id(unsigned int napi_id)
 
 	return NULL;
 }
+EXPORT_SYMBOL(napi_by_id);
 
 #if defined(CONFIG_NET_RX_BUSY_POLL)
 #define BUSY_POLL_BUDGET 8
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/6] net device rx busy polling support in vhost_net Jason Wang <jasowang@redhat.com> - 2016-03-31 08:00 +0200
  [PATCH net-next 2/6] tuntap: socket rx busy polling support Jason Wang <jasowang@redhat.com> - 2016-03-31 08:00 +0200
  [PATCH net-next 6/6] vhost_net: net device rx busy polling support Jason Wang <jasowang@redhat.com> - 2016-03-31 08:00 +0200
  [PATCH net-next 4/6] net: core: factor out core busy polling logic to sk_busy_loop_once() Jason Wang <jasowang@redhat.com> - 2016-03-31 08:00 +0200
  [PATCH net-next 5/6] net: export napi_by_id() Jason Wang <jasowang@redhat.com> - 2016-03-31 08:00 +0200

csiph-web