Re: [PATCH v2 net-next 3/3] rhashtable: Add scored lookups

2015-07-14 Thread Tom Herbert
On Tue, Jul 14, 2015 at 5:18 PM, Herbert Xu wrote: > On Tue, Jul 14, 2015 at 04:45:49PM -0700, Tom Herbert wrote: >> >> + } else if (score == best_score) { >> + matches++; >> + if (reciprocal_scale(khash, matches) == 0) >> +

Re: [PATCH v2 net-next 3/3] rhashtable: Add scored lookups

2015-07-14 Thread Herbert Xu
On Tue, Jul 14, 2015 at 04:45:49PM -0700, Tom Herbert wrote: > > + } else if (score == best_score) { > + matches++; > + if (reciprocal_scale(khash, matches) == 0) > + result = he; > + khash = next_ps

[PATCH v2 net-next 3/3] rhashtable: Add scored lookups

2015-07-14 Thread Tom Herbert
This patch adds a mechanism to do scored lookups in an rhashtable. This mechanism is based on the UDP and TCP listener socket lookup functions. When a bucket is traversed, a matching score is computed for each entry and the input key. The entry with the greatest non-zero score is returned, and if