Thread (28 messages) flat view 28 messages, 4 authors, 2012-08-08

Re: [PATCH 1/6] hash: Introduce ptr_hash_mix routine

From: Eric Dumazet <hidden>
Date: 2012-08-07 10:30:11

On Tue, 2012-08-07 at 13:55 +0400, Pavel Emelyanov wrote:
OK. I was under impression, that hash_ptr was balanced from the fast/effective
perspective, but I can't argue with you in that area :) So, please, consider
the below patch instead of #1 and #2 (the rest ones remain unchanged).

Thanks,
Pavel


From: Pavel Emelyanov <redacted>
Subject: [PATCH 1/5] net: Dont use ifindices in hash fns

Eric noticed, that when there will be devices with equal indices, some
hash functions that use them will become less effective as they could.
Fix this in advance by mixing the net_device address into the hash value
instead of the device index.

This is true for arp and ndisc hash fns. The netlabel, can and llc ones
are also ifindex-based, but that three are init_net-only, thus will not
be affected.

Many thanks to David and Eric for the hash32_ptr implementation!

Signed-off-by: Pavel Emelyanov <redacted>
---
 include/linux/hash.h |   10 ++++++++++
 include/net/arp.h    |    3 ++-
 include/net/ndisc.h  |    3 ++-
 3 files changed, 14 insertions(+), 2 deletions(-)
Signed-off-by: Eric Dumazet <edumazet@google.com>

You should resend other patches, since they are no more on
http://patchwork.ozlabs.org/project/netdev/list/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help