summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-08-12 15:13:06 -0700
committerTony Luck <tony.luck@intel.com>2005-08-12 15:13:06 -0700
commitfc464476aa8356f7aae8787d9b8c14aa15d166eb (patch)
tree99068df8e33177f2376f953486a235a8b0215e69 /include
parent691241315116b962f2161e6190f1678cc65bbe26 (diff)
parent2da5bf80f754e28cc153362e5ed1edaa9740897a (diff)
downloadop-kernel-dev-fc464476aa8356f7aae8787d9b8c14aa15d166eb.zip
op-kernel-dev-fc464476aa8356f7aae8787d9b8c14aa15d166eb.tar.gz
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 bcd0ac3..5ade54a 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
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 0061c94..948527e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -255,7 +255,7 @@ struct sk_buff {
nohdr:1;
/* 3 bits spare */
__u8 pkt_type;
- __u16 protocol;
+ __be16 protocol;
void (*destructor)(struct sk_buff *skb);
#ifdef CONFIG_NETFILTER
OpenPOWER on IntegriCloud