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.h36
1 files changed, 33 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index fa8b47637997..9fc6ee8e7508 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -223,6 +223,7 @@ struct netif_rx_stats {
223 unsigned dropped; 223 unsigned dropped;
224 unsigned time_squeeze; 224 unsigned time_squeeze;
225 unsigned cpu_collision; 225 unsigned cpu_collision;
226 unsigned received_rps;
226}; 227};
227 228
228DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); 229DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat);
@@ -530,6 +531,24 @@ struct netdev_queue {
530 unsigned long tx_dropped; 531 unsigned long tx_dropped;
531} ____cacheline_aligned_in_smp; 532} ____cacheline_aligned_in_smp;
532 533
534/*
535 * This structure holds an RPS map which can be of variable length. The
536 * map is an array of CPUs.
537 */
538struct rps_map {
539 unsigned int len;
540 struct rcu_head rcu;
541 u16 cpus[0];
542};
543#define RPS_MAP_SIZE(_num) (sizeof(struct rps_map) + (_num * sizeof(u16)))
544
545/* This structure contains an instance of an RX queue. */
546struct netdev_rx_queue {
547 struct rps_map *rps_map;
548 struct kobject kobj;
549 struct netdev_rx_queue *first;
550 atomic_t count;
551} ____cacheline_aligned_in_smp;
533 552
534/* 553/*
535 * This structure defines the management hooks for network devices. 554 * This structure defines the management hooks for network devices.
@@ -878,6 +897,13 @@ struct net_device {
878 897
879 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 898 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
880 899
900 struct kset *queues_kset;
901
902 struct netdev_rx_queue *_rx;
903
904 /* Number of RX queues allocated at alloc_netdev_mq() time */
905 unsigned int num_rx_queues;
906
881 struct netdev_queue rx_queue; 907 struct netdev_queue rx_queue;
882 908
883 struct netdev_queue *_tx ____cacheline_aligned_in_smp; 909 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
@@ -1311,14 +1337,18 @@ static inline int unregister_gifconf(unsigned int family)
1311 */ 1337 */
1312struct softnet_data { 1338struct softnet_data {
1313 struct Qdisc *output_queue; 1339 struct Qdisc *output_queue;
1314 struct sk_buff_head input_pkt_queue;
1315 struct list_head poll_list; 1340 struct list_head poll_list;
1316 struct sk_buff *completion_queue; 1341 struct sk_buff *completion_queue;
1317 1342
1343 /* Elements below can be accessed between CPUs for RPS */
1344#ifdef CONFIG_SMP
1345 struct call_single_data csd ____cacheline_aligned_in_smp;
1346#endif
1347 struct sk_buff_head input_pkt_queue;
1318 struct napi_struct backlog; 1348 struct napi_struct backlog;
1319}; 1349};
1320 1350
1321DECLARE_PER_CPU(struct softnet_data,softnet_data); 1351DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
1322 1352
1323#define HAVE_NETIF_QUEUE 1353#define HAVE_NETIF_QUEUE
1324 1354
@@ -1975,7 +2005,7 @@ extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct
1975extern int dev_set_promiscuity(struct net_device *dev, int inc); 2005extern int dev_set_promiscuity(struct net_device *dev, int inc);
1976extern int dev_set_allmulti(struct net_device *dev, int inc); 2006extern int dev_set_allmulti(struct net_device *dev, int inc);
1977extern void netdev_state_change(struct net_device *dev); 2007extern void netdev_state_change(struct net_device *dev);
1978extern void netdev_bonding_change(struct net_device *dev, 2008extern int netdev_bonding_change(struct net_device *dev,
1979 unsigned long event); 2009 unsigned long event);
1980extern void netdev_features_change(struct net_device *dev); 2010extern void netdev_features_change(struct net_device *dev);
1981/* Load a device via the kmod */ 2011/* Load a device via the kmod */