netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Josh Hunt <johunt@akamai.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	Patrick McHardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH v2 2/2] nft_hash: define max_shift rhashtable parameter
Date: Tue, 24 Feb 2015 16:42:19 +0000	[thread overview]
Message-ID: <20150224164219.GC21107@casper.infradead.org> (raw)
In-Reply-To: <1424794259-30241-3-git-send-email-johunt@akamai.com>

On 02/24/15 at 11:10am, Josh Hunt wrote:
> You must define a max_shift parameter to rhashtable or else the table cannot
> grow. This sets max_shift for nft_hash to 24, which will allow the table to
> grow to 2^24 or 16 million buckets.
> 
> Signed-off-by: Josh Hunt <johunt@akamai.com>
> ---
>  net/netfilter/nft_hash.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c
> index 61e6c40..839ed30 100644
> --- a/net/netfilter/nft_hash.c
> +++ b/net/netfilter/nft_hash.c
> @@ -23,6 +23,9 @@
>  /* We target a hash table size of 4, element hint is 75% of final size */
>  #define NFT_HASH_ELEMENT_HINT 3
>  
> +/* Set default of 2^24 buckets or 16 million entries */
> +#define NFT_HASH_MAX_ELEMENTS 24

Maybe this should be called .._MAX_BUCKETS instead, the table
itself does not have a upper nelements limit but will not grow
above 16M buckets as the comment states correctly already.

After this change:
Acked-by: Thomas Graf <tgraf@suug.ch>

  reply	other threads:[~2015-02-24 16:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 16:10 [PATCH v2 0/2] nft hash resize fixes Josh Hunt
2015-02-24 16:10 ` [PATCH v2 1/2] rhashtable: require max_shift if grow_decision defined Josh Hunt
2015-02-24 16:40   ` Thomas Graf
2015-02-24 18:18   ` David Miller
2015-02-24 19:48     ` Daniel Borkmann
2015-02-24 21:31       ` David Miller
2015-02-24 22:49         ` Thomas Graf
2015-02-25  2:12           ` David Miller
2015-02-24 22:36     ` Josh Hunt
2015-02-24 16:10 ` [PATCH v2 2/2] nft_hash: define max_shift rhashtable parameter Josh Hunt
2015-02-24 16:42   ` Thomas Graf [this message]
2015-02-24 17:03     ` 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=20150224164219.GC21107@casper.infradead.org \
    --to=tgraf@suug.ch \
    --cc=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 \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).