Re: [PATCH 1/9] rhashtable: Do hashing inside of rhashtable_lookup_compare()

2015-01-16 Thread Thomas Graf
On 01/16/15 at 03:37pm, Patrick McHardy wrote: > On 02.01, Thomas Graf wrote: > > +{ > > + struct nft_hash_elem *he = ptr; > > + struct nft_compare_arg *x = arg; > > + > > + if (!nft_data_cmp(&he->key, &x->elem->key, x->set->klen)) { > > + x->elem->cookie = &he->node; > > +

Re: [PATCH 1/9] rhashtable: Do hashing inside of rhashtable_lookup_compare()

2015-01-16 Thread Patrick McHardy
On 02.01, Thomas Graf wrote: > Hash the key inside of rhashtable_lookup_compare() like > rhashtable_lookup() does. This allows to simplify the hashing > functions and keep them private. One more question: > diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c > index 1e316ce..614ee09

[PATCH 1/9] rhashtable: Do hashing inside of rhashtable_lookup_compare()

2015-01-02 Thread Thomas Graf
Hash the key inside of rhashtable_lookup_compare() like rhashtable_lookup() does. This allows to simplify the hashing functions and keep them private. Signed-off-by: Thomas Graf Cc: netfilter-de...@vger.kernel.org --- include/linux/rhashtable.h | 5 +-- lib/rhashtable.c | 91 +