aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netpoll.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netpoll.h')
-rw-r--r--include/linux/netpoll.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 791d5109f34c..79358bb712c6 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -14,7 +14,6 @@
14 14
15struct netpoll { 15struct netpoll {
16 struct net_device *dev; 16 struct net_device *dev;
17 struct net_device *real_dev;
18 char dev_name[IFNAMSIZ]; 17 char dev_name[IFNAMSIZ];
19 const char *name; 18 const char *name;
20 void (*rx_hook)(struct netpoll *, int, char *, int); 19 void (*rx_hook)(struct netpoll *, int, char *, int);
@@ -53,7 +52,13 @@ void netpoll_set_trap(int trap);
53void __netpoll_cleanup(struct netpoll *np); 52void __netpoll_cleanup(struct netpoll *np);
54void netpoll_cleanup(struct netpoll *np); 53void netpoll_cleanup(struct netpoll *np);
55int __netpoll_rx(struct sk_buff *skb); 54int __netpoll_rx(struct sk_buff *skb);
56void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); 55void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
56 struct net_device *dev);
57static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
58{
59 netpoll_send_skb_on_dev(np, skb, np->dev);
60}
61
57 62
58 63
59#ifdef CONFIG_NETPOLL 64#ifdef CONFIG_NETPOLL
@@ -63,20 +68,20 @@ static inline bool netpoll_rx(struct sk_buff *skb)
63 unsigned long flags; 68 unsigned long flags;
64 bool ret = false; 69 bool ret = false;
65 70
66 rcu_read_lock_bh(); 71 local_irq_save(flags);
67 npinfo = rcu_dereference_bh(skb->dev->npinfo); 72 npinfo = rcu_dereference_bh(skb->dev->npinfo);
68 73
69 if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) 74 if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags))
70 goto out; 75 goto out;
71 76
72 spin_lock_irqsave(&npinfo->rx_lock, flags); 77 spin_lock(&npinfo->rx_lock);
73 /* check rx_flags again with the lock held */ 78 /* check rx_flags again with the lock held */
74 if (npinfo->rx_flags && __netpoll_rx(skb)) 79 if (npinfo->rx_flags && __netpoll_rx(skb))
75 ret = true; 80 ret = true;
76 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 81 spin_unlock(&npinfo->rx_lock);
77 82
78out: 83out:
79 rcu_read_unlock_bh(); 84 local_irq_restore(flags);
80 return ret; 85 return ret;
81} 86}
82 87