Tom Herbert <t...@herbertland.com> wrote: > The obj_orderfn function may be specified in the parameters for a > rhashtable. When inserting an element this function is used to order > objects in a bucket list (greatest to least ordering value).This > allows entries to have wild card fields, where entries with > more specific information match are placed first in the bucket. > When a lookup is done, the first match found will contain > the most specific match. > > Signed-off-by: Tom Herbert <t...@herbertland.com>
I think this is fundamentally broken with respect to rehashing. During a rehash you're going to have some elements in the old table and some in the new table. At which point all your ordering guarantees go out of the window. I actually need something quite similar for IPsec. What I was planning on doing is have the actual objects hang off an ordered list object. The ordered list would then be the thing that you insert into rhashtable. This means that during rehashing they get moved atomically. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html