All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Josh Hunt <johunt@akamai.com>
Cc: Thomas Graf <tgraf@suug.ch>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	kaber@trash.net, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org
Subject: Re: nft hash set expansion problem
Date: Sun, 08 Feb 2015 23:43:03 +0100	[thread overview]
Message-ID: <54D7E677.5050708@iogearbox.net> (raw)
In-Reply-To: <54D7BB53.2050203@akamai.com>

On 02/08/2015 08:38 PM, Josh Hunt wrote:
> Nft hash sets are unable to expand past the initial # of buckets. This is b/c nft hash sets don't define the max_shift parameter and so rht_grow_above_75():
...
> diff --git a/lib/rhashtable.c b/lib/rhashtable.c
> index e96fc00..2c51617 100644
> --- a/lib/rhashtable.c
> +++ b/lib/rhashtable.c
> @@ -250,7 +250,7 @@ bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size)
>   {
>          /* Expand table when exceeding 75% load */
>          return atomic_read(&ht->nelems) > (new_size / 4 * 3) &&
> -              (ht->p.max_shift && atomic_read(&ht->shift) < ht->p.max_shift);
> +              (ht->p.max_shift ? atomic_read(&ht->shift) < ht->p.max_shift : 1);
>   }
>   EXPORT_SYMBOL_GPL(rht_grow_above_75);

This seems not correct as we want to have an upper limit for
rhashtable expansions. It's better to define a max_shift for
nftables, instead.

  reply	other threads:[~2015-02-08 22:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-08 19:38 nft hash set expansion problem Josh Hunt
2015-02-08 22:43 ` Daniel Borkmann [this message]
2015-02-09 14:44   ` Josh Hunt
2015-02-09 15:21     ` Thomas Graf
2015-02-09 15:28       ` Josh Hunt

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=54D7E677.5050708@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=johunt@akamai.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=tgraf@suug.ch \
    /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.