aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netpoll.h
diff options
context:
space:
mode:
authorAmerigo Wang <amwang@redhat.com>2012-08-10 01:24:41 +0000
committerDavid S. Miller <davem@davemloft.net>2012-08-14 14:33:31 -0700
commit91fe4a4b9e490a24f6702dd8afe72d8afab6fcdb (patch)
treeded789b4e378c4e657ea425f0e05ea72be395747 /include/linux/netpoll.h
parentnetpoll: take rcu_read_lock_bh() in netpoll_rx() (diff)
downloadlinux-dev-91fe4a4b9e490a24f6702dd8afe72d8afab6fcdb.tar.xz
linux-dev-91fe4a4b9e490a24f6702dd8afe72d8afab6fcdb.zip
netpoll: use netpoll_rx_on() in netpoll_rx()
The logic of the code is same, just call netpoll_rx_on(). Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netpoll.h')
-rw-r--r--include/linux/netpoll.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 5d881c388273..2d178baa49df 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -63,6 +63,13 @@ static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
#ifdef CONFIG_NETPOLL
+static inline int netpoll_rx_on(struct sk_buff *skb)
+{
+ struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo);
+
+ return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
+}
+
static inline bool netpoll_rx(struct sk_buff *skb)
{
struct netpoll_info *npinfo;
@@ -70,11 +77,11 @@ static inline bool netpoll_rx(struct sk_buff *skb)
bool ret = false;
local_irq_save(flags);
- npinfo = rcu_dereference_bh(skb->dev->npinfo);
- if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags))
+ if (!netpoll_rx_on(skb))
goto out;
+ npinfo = rcu_dereference_bh(skb->dev->npinfo);
spin_lock(&npinfo->rx_lock);
/* check rx_flags again with the lock held */
if (npinfo->rx_flags && __netpoll_rx(skb, npinfo))
@@ -86,13 +93,6 @@ out:
return ret;
}
-static inline int netpoll_rx_on(struct sk_buff *skb)
-{
- struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo);
-
- return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
-}
-
static inline int netpoll_receive_skb(struct sk_buff *skb)
{
if (!list_empty(&skb->dev->napi_list))