[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150116160045.GB15052@casper.infradead.org>
Date: Fri, 16 Jan 2015 16:00:45 +0000
From: Thomas Graf <tgraf@...g.ch>
To: Patrick McHardy <kaber@...sh.net>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, herbert@...dor.apana.org.au,
paulmck@...ux.vnet.ibm.com, edumazet@...gle.com,
john.r.fastabend@...el.com, josh@...htriplett.org,
netfilter-devel@...r.kernel.org
Subject: Re: [PATCH 1/9] rhashtable: Do hashing inside of
rhashtable_lookup_compare()
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;
> > + x->elem->flags = 0;
> > + if (x->set->flags & NFT_SET_MAP)
> > + nft_data_copy(&x->elem->data, he->data);
>
> Is there any reason why we need to perform the assignments in the
> compare function? The reason why I'm asking is because to add
> timeout support, I need another compare function for nft_hash_lookup()
> and I'd prefer to use a single one for both cases.
No. I kept the nft_hash code as intact as possible without changing
any semantics (aside from the lost optimiztion of keeping the pprev
pointer from the lookup when doing removals). No reason speaks against
moving it out.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists