diff options
| author | 2005-08-14 23:10:00 -0400 | |
|---|---|---|
| committer | 2005-08-14 23:10:00 -0400 | |
| commit | 4c0e176dd5e4c44dd60f398518f75eedbe1a65f3 (patch) | |
| tree | 07aea7539f78f221c6fc535a94a07befa2afdb63 /include/linux/netpoll.h | |
| parent | [PATCH] ieee80211: Fix frame control pver mask (diff) | |
| parent | Revert PCIBIOS_MIN_IO changes for 2.6.13 (diff) | |
| download | linux-dev-4c0e176dd5e4c44dd60f398518f75eedbe1a65f3.tar.xz linux-dev-4c0e176dd5e4c44dd60f398518f75eedbe1a65f3.zip | |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'include/linux/netpoll.h')
| -rw-r--r-- | include/linux/netpoll.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index bcd0ac33f592..5ade54a78dbb 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -9,6 +9,7 @@ #include <linux/netdevice.h> #include <linux/interrupt.h> +#include <linux/rcupdate.h> #include <linux/list.h> struct netpoll; @@ -26,6 +27,7 @@ struct netpoll { struct netpoll_info { spinlock_t poll_lock; int poll_owner; + int tries; int rx_flags; spinlock_t rx_lock; struct netpoll *rx_np; /* netpoll that registered an rx_hook */ @@ -60,25 +62,31 @@ static inline int netpoll_rx(struct sk_buff *skb) return ret; } -static inline void netpoll_poll_lock(struct net_device *dev) +static inline void *netpoll_poll_lock(struct net_device *dev) { + rcu_read_lock(); /* deal with race on ->npinfo */ if (dev->npinfo) { spin_lock(&dev->npinfo->poll_lock); dev->npinfo->poll_owner = smp_processor_id(); + return dev->npinfo; } + return NULL; } -static inline void netpoll_poll_unlock(struct net_device *dev) +static inline void netpoll_poll_unlock(void *have) { - if (dev->npinfo) { - dev->npinfo->poll_owner = -1; - spin_unlock(&dev->npinfo->poll_lock); + struct netpoll_info *npi = have; + + if (npi) { + npi->poll_owner = -1; + spin_unlock(&npi->poll_lock); } + rcu_read_unlock(); } #else #define netpoll_rx(a) 0 -#define netpoll_poll_lock(a) +#define netpoll_poll_lock(a) 0 #define netpoll_poll_unlock(a) #endif |
