Commit 4cdb1e2e authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 55b42b5c
...@@ -2329,10 +2329,7 @@ extern int netdev_flow_limit_table_len; ...@@ -2329,10 +2329,7 @@ extern int netdev_flow_limit_table_len;
* Incoming packets are placed on per-cpu queues * Incoming packets are placed on per-cpu queues
*/ */
struct softnet_data { struct softnet_data {
struct Qdisc *output_queue;
struct Qdisc **output_queue_tailp;
struct list_head poll_list; struct list_head poll_list;
struct sk_buff *completion_queue;
struct sk_buff_head process_queue; struct sk_buff_head process_queue;
/* stats */ /* stats */
...@@ -2340,10 +2337,17 @@ struct softnet_data { ...@@ -2340,10 +2337,17 @@ struct softnet_data {
unsigned int time_squeeze; unsigned int time_squeeze;
unsigned int cpu_collision; unsigned int cpu_collision;
unsigned int received_rps; unsigned int received_rps;
#ifdef CONFIG_RPS #ifdef CONFIG_RPS
struct softnet_data *rps_ipi_list; struct softnet_data *rps_ipi_list;
#endif
#ifdef CONFIG_NET_FLOW_LIMIT
struct sd_flow_limit __rcu *flow_limit;
#endif
struct Qdisc *output_queue;
struct Qdisc **output_queue_tailp;
struct sk_buff *completion_queue;
#ifdef CONFIG_RPS
/* Elements below can be accessed between CPUs for RPS */ /* Elements below can be accessed between CPUs for RPS */
struct call_single_data csd ____cacheline_aligned_in_smp; struct call_single_data csd ____cacheline_aligned_in_smp;
struct softnet_data *rps_ipi_next; struct softnet_data *rps_ipi_next;
...@@ -2355,9 +2359,6 @@ struct softnet_data { ...@@ -2355,9 +2359,6 @@ struct softnet_data {
struct sk_buff_head input_pkt_queue; struct sk_buff_head input_pkt_queue;
struct napi_struct backlog; struct napi_struct backlog;
#ifdef CONFIG_NET_FLOW_LIMIT
struct sd_flow_limit __rcu *flow_limit;
#endif
}; };
static inline void input_queue_head_incr(struct softnet_data *sd) static inline void input_queue_head_incr(struct softnet_data *sd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment