aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-08-12 18:13:06 -0400
committerTony Luck <tony.luck@intel.com>2005-08-12 18:13:06 -0400
commitfc464476aa8356f7aae8787d9b8c14aa15d166eb (patch)
tree99068df8e33177f2376f953486a235a8b0215e69 /include
parent691241315116b962f2161e6190f1678cc65bbe26 (diff)
parent2da5bf80f754e28cc153362e5ed1edaa9740897a (diff)
Auto-update from upstream
Diffstat (limited to 'include')
-rw-r--r--include/linux/netpoll.h20
-rw-r--r--include/linux/skbuff.h2
2 files changed, 15 insertions, 7 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 @@
9 9
10#include <linux/netdevice.h> 10#include <linux/netdevice.h>
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/rcupdate.h>
12#include <linux/list.h> 13#include <linux/list.h>
13 14
14struct netpoll; 15struct netpoll;
@@ -26,6 +27,7 @@ struct netpoll {
26struct netpoll_info { 27struct netpoll_info {
27 spinlock_t poll_lock; 28 spinlock_t poll_lock;
28 int poll_owner; 29 int poll_owner;
30 int tries;
29 int rx_flags; 31 int rx_flags;
30 spinlock_t rx_lock; 32 spinlock_t rx_lock;
31 struct netpoll *rx_np; /* netpoll that registered an rx_hook */ 33 struct netpoll *rx_np; /* netpoll that registered an rx_hook */
@@ -60,25 +62,31 @@ static inline int netpoll_rx(struct sk_buff *skb)
60 return ret; 62 return ret;
61} 63}
62 64
63static inline void netpoll_poll_lock(struct net_device *dev) 65static inline void *netpoll_poll_lock(struct net_device *dev)
64{ 66{
67 rcu_read_lock(); /* deal with race on ->npinfo */
65 if (dev->npinfo) { 68 if (dev->npinfo) {
66 spin_lock(&dev->npinfo->poll_lock); 69 spin_lock(&dev->npinfo->poll_lock);
67 dev->npinfo->poll_owner = smp_processor_id(); 70 dev->npinfo->poll_owner = smp_processor_id();
71 return dev->npinfo;
68 } 72 }
73 return NULL;
69} 74}
70 75
71static inline void netpoll_poll_unlock(struct net_device *dev) 76static inline void netpoll_poll_unlock(void *have)
72{ 77{
73 if (dev->npinfo) { 78 struct netpoll_info *npi = have;
74 dev->npinfo->poll_owner = -1; 79
75 spin_unlock(&dev->npinfo->poll_lock); 80 if (npi) {
81 npi->poll_owner = -1;
82 spin_unlock(&npi->poll_lock);
76 } 83 }
84 rcu_read_unlock();
77} 85}
78 86
79#else 87#else
80#define netpoll_rx(a) 0 88#define netpoll_rx(a) 0
81#define netpoll_poll_lock(a) 89#define netpoll_poll_lock(a) 0
82#define netpoll_poll_unlock(a) 90#define netpoll_poll_unlock(a)
83#endif 91#endif
84 92
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 0061c9470482..948527e42a60 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -255,7 +255,7 @@ struct sk_buff {
255 nohdr:1; 255 nohdr:1;
256 /* 3 bits spare */ 256 /* 3 bits spare */
257 __u8 pkt_type; 257 __u8 pkt_type;
258 __u16 protocol; 258 __be16 protocol;
259 259
260 void (*destructor)(struct sk_buff *skb); 260 void (*destructor)(struct sk_buff *skb);
261#ifdef CONFIG_NETFILTER 261#ifdef CONFIG_NETFILTER