All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Hunt <johunt@akamai.com>
To: Patrick McHardy <kaber@trash.net>, Thomas Graf <tgraf@suug.ch>,
	Daniel Borkmann <daniel@iogearbox.net>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] rhashtable: require max_shift definition
Date: Tue, 10 Feb 2015 15:18:16 -0600	[thread overview]
Message-ID: <54DA7598.6090201@akamai.com> (raw)
In-Reply-To: <FB9AAD93-7F9C-440E-8EB2-44D50B8AA22A@trash.net>

On 02/10/2015 11:44 AM, Patrick McHardy wrote:
> Am 10. Februar 2015 18:22:41 MEZ, schrieb Thomas Graf <tgraf@suug.ch>:
>> On 02/10/15 at 06:06pm, Daniel Borkmann wrote:
>>> Hm, given that min_shift/max_shift are parameters that directly
>>> concern internals of rhashtable i.e. are tightly coupled to expand
>>> and shrink functionality, I'd say that depending on the use case,
>>> a maxelem limit should rather be handled outside of it, if it's
>>> truly an issue/concern.
>>
>> Agreed, Netlink already uses the atomic counter of rhashtable to
>> enforce  upper limit of table entries:
>>
>>         err = -ENOMEM;
>>         if (BITS_PER_LONG > 32 &&
>>             unlikely(atomic_read(&table->hash.nelems) >= UINT_MAX))
>>                 goto err;
>
> I would tend to agree with Pablo, now we're handling half (shift) internally and half (max) externally, using internal values.

OK. Thanks for all the feedback. I will send a v2 once the other 2 
patches get reviewed.

Thanks
Josh

  reply	other threads:[~2015-02-10 21:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10  0:48 [PATCH 0/3] nft hash set expansion fixes Josh Hunt
2015-02-10  0:48 ` [PATCH 1/3] rhashtable: require max_shift definition Josh Hunt
2015-02-10  0:58   ` Thomas Graf
2015-02-10  8:30     ` Daniel Borkmann
2015-02-10 15:56       ` Josh Hunt
2015-02-10 17:06         ` Daniel Borkmann
2015-02-10 17:22           ` Thomas Graf
2015-02-10 17:44             ` Patrick McHardy
2015-02-10 21:18               ` Josh Hunt [this message]
2015-02-10  0:48 ` [PATCH 2/3] nft_hash: define max_shift rhashtable param Josh Hunt
2015-02-10  0:48 ` [PATCH 3/3] nft_hash: introduce init_size set parameter 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=54DA7598.6090201@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.