aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-11-02 09:00:12 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-03 12:25:08 -0500
commit4cdb1e2e3d3495423db558d3bb7ed11d66aabce7 (patch)
tree8ac47c7323c806a287b6f63277d6576040e4a1dc /include/linux/netdevice.h
parent55b42b5ca2dcf143465968697fe6c6503b05fca1 (diff)
net: shrink struct softnet_data
flow_limit in struct softnet_data is only read from local cpu and can be moved to fill a hole, reducing softnet_data size by 64 bytes on x86_64 While we are at it, move output_queue, output_queue_tailp and completion_queue, so that rx / tx paths touch a single cache line. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c85e06512246..5ed05bd764dc 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2329,10 +2329,7 @@ extern int netdev_flow_limit_table_len;
2329 * Incoming packets are placed on per-cpu queues 2329 * Incoming packets are placed on per-cpu queues
2330 */ 2330 */
2331struct softnet_data { 2331struct softnet_data {
2332 struct Qdisc *output_queue;
2333 struct Qdisc **output_queue_tailp;
2334 struct list_head poll_list; 2332 struct list_head poll_list;
2335 struct sk_buff *completion_queue;
2336 struct sk_buff_head process_queue; 2333 struct sk_buff_head process_queue;
2337 2334
2338 /* stats */ 2335 /* stats */
@@ -2340,10 +2337,17 @@ struct softnet_data {
2340 unsigned int time_squeeze; 2337 unsigned int time_squeeze;
2341 unsigned int cpu_collision; 2338 unsigned int cpu_collision;
2342 unsigned int received_rps; 2339 unsigned int received_rps;
2343
2344#ifdef CONFIG_RPS 2340#ifdef CONFIG_RPS
2345 struct softnet_data *rps_ipi_list; 2341 struct softnet_data *rps_ipi_list;
2342#endif
2343#ifdef CONFIG_NET_FLOW_LIMIT
2344 struct sd_flow_limit __rcu *flow_limit;
2345#endif
2346 struct Qdisc *output_queue;
2347 struct Qdisc **output_queue_tailp;
2348 struct sk_buff *completion_queue;
2346 2349
2350#ifdef CONFIG_RPS
2347 /* Elements below can be accessed between CPUs for RPS */ 2351 /* Elements below can be accessed between CPUs for RPS */
2348 struct call_single_data csd ____cacheline_aligned_in_smp; 2352 struct call_single_data csd ____cacheline_aligned_in_smp;
2349 struct softnet_data *rps_ipi_next; 2353 struct softnet_data *rps_ipi_next;
@@ -2355,9 +2359,6 @@ struct softnet_data {
2355 struct sk_buff_head input_pkt_queue; 2359 struct sk_buff_head input_pkt_queue;
2356 struct napi_struct backlog; 2360 struct napi_struct backlog;
2357 2361
2358#ifdef CONFIG_NET_FLOW_LIMIT
2359 struct sd_flow_limit __rcu *flow_limit;
2360#endif
2361}; 2362};
2362 2363
2363static inline void input_queue_head_incr(struct softnet_data *sd) 2364static inline void input_queue_head_incr(struct softnet_data *sd)