From: Josh Hunt <johunt@akamai.com>
To: Daniel Borkmann <daniel@iogearbox.net>
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: Mon, 09 Feb 2015 08:44:32 -0600 [thread overview]
Message-ID: <54D8C7D0.9030803@akamai.com> (raw)
In-Reply-To: <54D7E677.5050708@iogearbox.net>
On 02/08/2015 04:43 PM, Daniel Borkmann wrote:
> 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.
Thanks Daniel that's what I wanted to know. I'll fix this on the
nft_hash side.
Josh
next prev parent reply other threads:[~2015-02-09 14:44 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
2015-02-09 14:44 ` Josh Hunt [this message]
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=54D8C7D0.9030803@akamai.com \
--to=johunt@akamai.com \
--cc=daniel@iogearbox.net \
--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.