diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 83b8c4f1d69..fea0d9db684 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/if_packet.h> | 30 | #include <linux/if_packet.h> |
31 | 31 | ||
32 | #ifdef __KERNEL__ | 32 | #ifdef __KERNEL__ |
33 | #include <linux/timer.h> | ||
33 | #include <asm/atomic.h> | 34 | #include <asm/atomic.h> |
34 | #include <asm/cache.h> | 35 | #include <asm/cache.h> |
35 | #include <asm/byteorder.h> | 36 | #include <asm/byteorder.h> |
@@ -38,7 +39,6 @@ | |||
38 | #include <linux/percpu.h> | 39 | #include <linux/percpu.h> |
39 | #include <linux/dmaengine.h> | 40 | #include <linux/dmaengine.h> |
40 | 41 | ||
41 | struct divert_blk; | ||
42 | struct vlan_group; | 42 | struct vlan_group; |
43 | struct ethtool_ops; | 43 | struct ethtool_ops; |
44 | struct netpoll_info; | 44 | struct netpoll_info; |
@@ -67,6 +67,10 @@ struct netpoll_info; | |||
67 | #define NET_RX_CN_HIGH 4 /* The storm is here */ | 67 | #define NET_RX_CN_HIGH 4 /* The storm is here */ |
68 | #define NET_RX_BAD 5 /* packet dropped due to kernel error */ | 68 | #define NET_RX_BAD 5 /* packet dropped due to kernel error */ |
69 | 69 | ||
70 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It | ||
71 | * indicates that the device will soon be dropping packets, or already drops | ||
72 | * some packets of the same priority; prompting us to send less aggressively. */ | ||
73 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) | ||
70 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) | 74 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) |
71 | 75 | ||
72 | #endif | 76 | #endif |
@@ -189,13 +193,20 @@ struct hh_cache | |||
189 | { | 193 | { |
190 | struct hh_cache *hh_next; /* Next entry */ | 194 | struct hh_cache *hh_next; /* Next entry */ |
191 | atomic_t hh_refcnt; /* number of users */ | 195 | atomic_t hh_refcnt; /* number of users */ |
192 | __be16 hh_type; /* protocol identifier, f.e ETH_P_IP | 196 | /* |
197 | * We want hh_output, hh_len, hh_lock and hh_data be a in a separate | ||
198 | * cache line on SMP. | ||
199 | * They are mostly read, but hh_refcnt may be changed quite frequently, | ||
200 | * incurring cache line ping pongs. | ||
201 | */ | ||
202 | __be16 hh_type ____cacheline_aligned_in_smp; | ||
203 | /* protocol identifier, f.e ETH_P_IP | ||
193 | * NOTE: For VLANs, this will be the | 204 | * NOTE: For VLANs, this will be the |
194 | * encapuslated type. --BLG | 205 | * encapuslated type. --BLG |
195 | */ | 206 | */ |
196 | int hh_len; /* length of header */ | 207 | u16 hh_len; /* length of header */ |
197 | int (*hh_output)(struct sk_buff *skb); | 208 | int (*hh_output)(struct sk_buff *skb); |
198 | rwlock_t hh_lock; | 209 | seqlock_t hh_lock; |
199 | 210 | ||
200 | /* cached hardware header; allow for machine alignment needs. */ | 211 | /* cached hardware header; allow for machine alignment needs. */ |
201 | #define HH_DATA_MOD 16 | 212 | #define HH_DATA_MOD 16 |
@@ -517,11 +528,6 @@ struct net_device | |||
517 | /* bridge stuff */ | 528 | /* bridge stuff */ |
518 | struct net_bridge_port *br_port; | 529 | struct net_bridge_port *br_port; |
519 | 530 | ||
520 | #ifdef CONFIG_NET_DIVERT | ||
521 | /* this will get initialized at each interface type init routine */ | ||
522 | struct divert_blk *divert; | ||
523 | #endif /* CONFIG_NET_DIVERT */ | ||
524 | |||
525 | /* class/net/name entry */ | 531 | /* class/net/name entry */ |
526 | struct class_device class_dev; | 532 | struct class_device class_dev; |
527 | /* space for optional statistics and wireless sysfs groups */ | 533 | /* space for optional statistics and wireless sysfs groups */ |
@@ -900,6 +906,7 @@ static inline void netif_poll_disable(struct net_device *dev) | |||
900 | 906 | ||
901 | static inline void netif_poll_enable(struct net_device *dev) | 907 | static inline void netif_poll_enable(struct net_device *dev) |
902 | { | 908 | { |
909 | smp_mb__before_clear_bit(); | ||
903 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); | 910 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); |
904 | } | 911 | } |
905 | 912 | ||