[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200723094236.04d82921@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 23 Jul 2020 09:42:36 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Eelco Chaudron <echaudro@...hat.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, dev@...nvswitch.org,
pabeni@...hat.com, pshelar@....org, fw@...len.de
Subject: Re: [PATCH net-next v2 2/2] net: openvswitch: make masks cache size
configurable
On Thu, 23 Jul 2020 14:58:31 +0200 Eelco Chaudron wrote:
> + if ((size & (size - 1)) != 0 ||
is_power_of_2() ?
> + (size * sizeof(struct mask_cache_entry)) > PCPU_MIN_UNIT_SIZE)
> + return NULL;
> + new->cache_size = size;
> + if (new->cache_size > 0) {
> + cache = __alloc_percpu(sizeof(struct mask_cache_entry) *
> + new->cache_size,
array_size() ?
> + __alignof__(struct mask_cache_entry));
> +
No need for the new line here
> + if (!cache) {
> + kfree(new);
> + return NULL;
> + }
> + }
> + if (size == mc->cache_size || (size & (size - 1)) != 0)
why check "is power of 2" twice?
> @@ -454,7 +516,7 @@ void ovs_flow_tbl_destroy(struct flow_table *table)
> struct table_instance *ti = rcu_dereference_raw(table->ti);
> struct table_instance *ufid_ti = rcu_dereference_raw(table->ufid_ti);
>
> - free_percpu(table->mask_cache);
> + call_rcu(&table->mask_cache->rcu, mask_cache_rcu_cb);
> call_rcu(&table->mask_array->rcu, mask_array_rcu_cb);
> table_instance_destroy(table, ti, ufid_ti, false);
> }
This adds a new warning :(
net/openvswitch/flow_table.c:519:24: warning: incorrect type in argument 1 (different address spaces)
net/openvswitch/flow_table.c:519:24: expected struct callback_head *head
net/openvswitch/flow_table.c:519:24: got struct callback_head [noderef] __rcu *
Powered by blists - more mailing lists