From: Jesse Gross Date: Fri, 6 Dec 2013 21:17:33 +0000 (-0800) Subject: datapath: Don't allocate space for per-CPU flow stats from cache. X-Git-Tag: sliver-openvswitch-2.0.90-1~1^2~5 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d22d7ed076d29dadca431d1785f8acc4c33f2b5c;p=sliver-openvswitch.git datapath: Don't allocate space for per-CPU flow stats from cache. Per-CPU flow stats are now allocated separately (if necessary) so there's no longer any need to allocate space for them directly in the base flow. Signed-off-by: Jesse Gross Acked-by: Pravin B Shelar --- diff --git a/datapath/flow_table.c b/datapath/flow_table.c index b20adcb34..6bb68d8b2 100644 --- a/datapath/flow_table.c +++ b/datapath/flow_table.c @@ -606,15 +606,11 @@ int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, * Returns zero if successful or a negative error code. */ int ovs_flow_init(void) { - int flow_size; - BUILD_BUG_ON(__alignof__(struct sw_flow_key) % __alignof__(long)); BUILD_BUG_ON(sizeof(struct sw_flow_key) % sizeof(long)); - flow_size = sizeof(struct sw_flow) + - (num_possible_cpus() * sizeof(struct sw_flow_stats)); - - flow_cache = kmem_cache_create("sw_flow", flow_size, 0, 0, NULL); + flow_cache = kmem_cache_create("sw_flow", sizeof(struct sw_flow), 0, + 0, NULL); if (flow_cache == NULL) return -ENOMEM;