]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/netdevice.h
rps: Fixed build with CONFIG_SMP not enabled.
[net-next-2.6.git] / include / linux / netdevice.h
index 682d02521bbc16be2bf464def9e381342c60e7fc..726ecd1af535cc77d6e01f271131145cf101a53b 100644 (file)
@@ -137,7 +137,7 @@ static inline bool dev_xmit_complete(int rc)
  *     used.
  */
 
-#if defined(CONFIG_WLAN_80211) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
+#if defined(CONFIG_WLAN) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
 # if defined(CONFIG_MAC80211_MESH)
 #  define LL_MAX_HEADER 128
 # else
@@ -223,6 +223,7 @@ struct netif_rx_stats {
        unsigned dropped;
        unsigned time_squeeze;
        unsigned cpu_collision;
+       unsigned received_rps;
 };
 
 DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat);
@@ -530,6 +531,24 @@ struct netdev_queue {
        unsigned long           tx_dropped;
 } ____cacheline_aligned_in_smp;
 
+/*
+ * This structure holds an RPS map which can be of variable length.  The
+ * map is an array of CPUs.
+ */
+struct rps_map {
+       unsigned int len;
+       struct rcu_head rcu;
+       u16 cpus[0];
+};
+#define RPS_MAP_SIZE(_num) (sizeof(struct rps_map) + (_num * sizeof(u16)))
+
+/* This structure contains an instance of an RX queue. */
+struct netdev_rx_queue {
+       struct rps_map *rps_map;
+       struct kobject kobj;
+       struct netdev_rx_queue *first;
+       atomic_t count;
+} ____cacheline_aligned_in_smp;
 
 /*
  * This structure defines the management hooks for network devices.
@@ -878,6 +897,13 @@ struct net_device {
 
        unsigned char           broadcast[MAX_ADDR_LEN];        /* hw bcast add */
 
+       struct kset             *queues_kset;
+
+       struct netdev_rx_queue  *_rx;
+
+       /* Number of RX queues allocated at alloc_netdev_mq() time  */
+       unsigned int            num_rx_queues;
+
        struct netdev_queue     rx_queue;
 
        struct netdev_queue     *_tx ____cacheline_aligned_in_smp;
@@ -924,7 +950,12 @@ struct net_device {
               NETREG_UNREGISTERED,     /* completed unregister todo */
               NETREG_RELEASED,         /* called free_netdev */
               NETREG_DUMMY,            /* dummy device for NAPI poll */
-       } reg_state;
+       } reg_state:16;
+
+       enum {
+               RTNL_LINK_INITIALIZED,
+               RTNL_LINK_INITIALIZING,
+       } rtnl_link_state:16;
 
        /* Called from unregister, can be used to call free_netdev */
        void (*destructor)(struct net_device *dev);
@@ -1306,14 +1337,18 @@ static inline int unregister_gifconf(unsigned int family)
  */
 struct softnet_data {
        struct Qdisc            *output_queue;
-       struct sk_buff_head     input_pkt_queue;
        struct list_head        poll_list;
        struct sk_buff          *completion_queue;
 
+       /* Elements below can be accessed between CPUs for RPS */
+#ifdef CONFIG_SMP
+       struct call_single_data csd ____cacheline_aligned_in_smp;
+#endif
+       struct sk_buff_head     input_pkt_queue;
        struct napi_struct      backlog;
 };
 
-DECLARE_PER_CPU(struct softnet_data,softnet_data);
+DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
 
 #define HAVE_NETIF_QUEUE
 
@@ -1582,7 +1617,9 @@ extern int                dev_valid_name(const char *name);
 extern int             dev_ioctl(struct net *net, unsigned int cmd, void __user *);
 extern int             dev_ethtool(struct net *net, struct ifreq *);
 extern unsigned                dev_get_flags(const struct net_device *);
+extern int             __dev_change_flags(struct net_device *, unsigned int flags);
 extern int             dev_change_flags(struct net_device *, unsigned);
+extern void            __dev_notify_flags(struct net_device *, unsigned int old_flags);
 extern int             dev_change_name(struct net_device *, const char *);
 extern int             dev_set_alias(struct net_device *, const char *, size_t);
 extern int             dev_change_net_namespace(struct net_device *,