All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Eelco Chaudron <echaudro@redhat.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, dev@openvswitch.org,
	pabeni@redhat.com, pshelar@ovn.org, fw@strlen.de
Subject: Re: [PATCH net-next v2 2/2] net: openvswitch: make masks cache size configurable
Date: Thu, 23 Jul 2020 09:42:36 -0700	[thread overview]
Message-ID: <20200723094236.04d82921@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <159550911106.849915.7304995736710705589.stgit@ebuild>

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 *

  reply	other threads:[~2020-07-23 16:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 12:58 [PATCH net-next v2 0/2] net: openvswitch: masks cache enhancements Eelco Chaudron
2020-07-23 12:58 ` [PATCH net-next v2 1/2] net: openvswitch: add masks cache hit counter Eelco Chaudron
2020-07-24  2:37   ` [ovs-dev] " Tonghao Zhang
2020-07-23 12:58 ` [PATCH net-next v2 2/2] net: openvswitch: make masks cache size configurable Eelco Chaudron
2020-07-23 16:42   ` Jakub Kicinski [this message]
2020-07-24  8:00     ` Eelco Chaudron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200723094236.04d82921@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=echaudro@redhat.com \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pshelar@ovn.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.