diff options
Diffstat (limited to 'include/linux/netdevice.h')
| -rw-r--r-- | include/linux/netdevice.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c79a88be7c33..de1a52bcb9e0 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 | ||
| 228 | DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); | 229 | DECLARE_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 | */ | ||
| 538 | struct 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. */ | ||
| 546 | struct 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,16 @@ static inline int unregister_gifconf(unsigned int family) | |||
| 1311 | */ | 1337 | */ |
| 1312 | struct softnet_data { | 1338 | struct 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 | struct call_single_data csd ____cacheline_aligned_in_smp; | ||
| 1345 | struct sk_buff_head input_pkt_queue; | ||
| 1318 | struct napi_struct backlog; | 1346 | struct napi_struct backlog; |
| 1319 | }; | 1347 | }; |
| 1320 | 1348 | ||
| 1321 | DECLARE_PER_CPU(struct softnet_data,softnet_data); | 1349 | DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); |
| 1322 | 1350 | ||
| 1323 | #define HAVE_NETIF_QUEUE | 1351 | #define HAVE_NETIF_QUEUE |
| 1324 | 1352 | ||
