diff options
| author | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-11-03 10:11:27 -0400 |
|---|---|---|
| committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-11-03 10:11:27 -0400 |
| commit | 8f987768eb99631374f4ab0bb19cd062baf1397d (patch) | |
| tree | b89aa5c207f7ba6a688f45657424b937f17ceb8a /include/linux/netpoll.h | |
| parent | 63f7526f26f0a9291ac3f7a986aa18ebfb61ec19 (diff) | |
| parent | c8ddb2713c624f432fa5fe3c7ecffcdda46ea0d4 (diff) | |
Merge commit 'v2.6.37-rc1' into for-2.6.37
Diffstat (limited to 'include/linux/netpoll.h')
| -rw-r--r-- | include/linux/netpoll.h | 17 |
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 | ||
| 15 | struct netpoll { | 15 | struct 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); | |||
| 53 | void __netpoll_cleanup(struct netpoll *np); | 52 | void __netpoll_cleanup(struct netpoll *np); |
| 54 | void netpoll_cleanup(struct netpoll *np); | 53 | void netpoll_cleanup(struct netpoll *np); |
| 55 | int __netpoll_rx(struct sk_buff *skb); | 54 | int __netpoll_rx(struct sk_buff *skb); |
| 56 | void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); | 55 | void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, |
| 56 | struct net_device *dev); | ||
| 57 | static 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 | ||
| 78 | out: | 83 | out: |
| 79 | rcu_read_unlock_bh(); | 84 | local_irq_restore(flags); |
| 80 | return ret; | 85 | return ret; |
| 81 | } | 86 | } |
| 82 | 87 | ||
