Thread (5 messages) 5 messages, 3 authors, 2015-02-09

Re: nft hash set expansion problem

flat view

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2015-02-08 22:43:08
Also in: netfilter-devel

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():
...
quoted hunk ↗ jump to hunk
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help