aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c57088f575a3..1a528548cd1d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -193,13 +193,20 @@ struct hh_cache
193{ 193{
194 struct hh_cache *hh_next; /* Next entry */ 194 struct hh_cache *hh_next; /* Next entry */
195 atomic_t hh_refcnt; /* number of users */ 195 atomic_t hh_refcnt; /* number of users */
196 __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
197 * NOTE: For VLANs, this will be the 204 * NOTE: For VLANs, this will be the
198 * encapuslated type. --BLG 205 * encapuslated type. --BLG
199 */ 206 */
200 u16 hh_len; /* length of header */ 207 u16 hh_len; /* length of header */
201 int (*hh_output)(struct sk_buff *skb); 208 int (*hh_output)(struct sk_buff *skb);
202 rwlock_t hh_lock; 209 seqlock_t hh_lock;
203 210
204 /* cached hardware header; allow for machine alignment needs. */ 211 /* cached hardware header; allow for machine alignment needs. */
205#define HH_DATA_MOD 16 212#define HH_DATA_MOD 16
@@ -522,10 +529,11 @@ struct net_device
522 struct net_bridge_port *br_port; 529 struct net_bridge_port *br_port;
523 530
524 /* class/net/name entry */ 531 /* class/net/name entry */
525 struct class_device class_dev; 532 struct device dev;
526 /* space for optional statistics and wireless sysfs groups */ 533 /* space for optional statistics and wireless sysfs groups */
527 struct attribute_group *sysfs_groups[3]; 534 struct attribute_group *sysfs_groups[3];
528}; 535};
536#define to_net_dev(d) container_of(d, struct net_device, dev)
529 537
530#define NETDEV_ALIGN 32 538#define NETDEV_ALIGN 32
531#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) 539#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
@@ -541,7 +549,7 @@ static inline void *netdev_priv(struct net_device *dev)
541/* Set the sysfs physical device reference for the network logical device 549/* Set the sysfs physical device reference for the network logical device
542 * if set prior to registration will cause a symlink during initialization. 550 * if set prior to registration will cause a symlink during initialization.
543 */ 551 */
544#define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) 552#define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev))
545 553
546struct packet_type { 554struct packet_type {
547 __be16 type; /* This is really htons(ether_type). */ 555 __be16 type; /* This is really htons(ether_type). */
@@ -581,7 +589,7 @@ extern int dev_open(struct net_device *dev);
581extern int dev_close(struct net_device *dev); 589extern int dev_close(struct net_device *dev);
582extern int dev_queue_xmit(struct sk_buff *skb); 590extern int dev_queue_xmit(struct sk_buff *skb);
583extern int register_netdevice(struct net_device *dev); 591extern int register_netdevice(struct net_device *dev);
584extern int unregister_netdevice(struct net_device *dev); 592extern void unregister_netdevice(struct net_device *dev);
585extern void free_netdev(struct net_device *dev); 593extern void free_netdev(struct net_device *dev);
586extern void synchronize_net(void); 594extern void synchronize_net(void);
587extern int register_netdevice_notifier(struct notifier_block *nb); 595extern int register_netdevice_notifier(struct notifier_block *nb);
@@ -899,6 +907,7 @@ static inline void netif_poll_disable(struct net_device *dev)
899 907
900static inline void netif_poll_enable(struct net_device *dev) 908static inline void netif_poll_enable(struct net_device *dev)
901{ 909{
910 smp_mb__before_clear_bit();
902 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 911 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
903} 912}
904 913