aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/netpoll.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 388cd91bc7a6..bcd0ac33f592 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -27,7 +27,8 @@ struct netpoll_info {
27 spinlock_t poll_lock; 27 spinlock_t poll_lock;
28 int poll_owner; 28 int poll_owner;
29 int rx_flags; 29 int rx_flags;
30 struct netpoll *np; 30 spinlock_t rx_lock;
31 struct netpoll *rx_np; /* netpoll that registered an rx_hook */
31}; 32};
32 33
33void netpoll_poll(struct netpoll *np); 34void netpoll_poll(struct netpoll *np);
@@ -44,11 +45,19 @@ void netpoll_queue(struct sk_buff *skb);
44static inline int netpoll_rx(struct sk_buff *skb) 45static inline int netpoll_rx(struct sk_buff *skb)
45{ 46{
46 struct netpoll_info *npinfo = skb->dev->npinfo; 47 struct netpoll_info *npinfo = skb->dev->npinfo;
48 unsigned long flags;
49 int ret = 0;
47 50
48 if (!npinfo || !npinfo->rx_flags) 51 if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags))
49 return 0; 52 return 0;
50 53
51 return npinfo->np && __netpoll_rx(skb); 54 spin_lock_irqsave(&npinfo->rx_lock, flags);
55 /* check rx_flags again with the lock held */
56 if (npinfo->rx_flags && __netpoll_rx(skb))
57 ret = 1;
58 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
59
60 return ret;
52} 61}
53 62
54static inline void netpoll_poll_lock(struct net_device *dev) 63static inline void netpoll_poll_lock(struct net_device *dev)