From: Chuck Lever <chuck.lever@oracle•com>
To: "Aurélien Charbon" <aurelien.charbon@ext•bull.net>
Cc: Mailing list NFSv4 <nfsv4@linux-nfs•org>,
netdev ML <netdev@vger•kernel.org>, Neil Brown <neilb@suse•de>
Subject: Re: [PATCH 1/1] NFS: change the ip_map cache code to handle IPv6 addresses
Date: Thu, 09 Aug 2007 11:14:45 -0400 [thread overview]
Message-ID: <46BB2F65.4080602@oracle.com> (raw)
In-Reply-To: <46BB2E01.2010406@ext.bull.net>
[-- Attachment #1: Type: text/plain, Size: 999 bytes --]
Aurélien Charbon wrote:
>>> @@ -112,12 +112,16 @@
>>> return (hash ^ (hash>>8)) & 0xff;
>>> }
>>> #endif
>>> +static inline int hash_ip6(struct in6_addr ip)
>>> +{
>>> + return (hash_ip(ip.s6_addr32[0]) ^ hash_ip(ip.s6_addr32[1])
>>> ^ hash_ip(ip.s6_addr32[2]) ^ hash_ip(ip.s6_addr32[3])) ;
>>> +}
>>
>>
>> How have you tested the effectiveness of the new hash function?
>
> I have not tested that point but I can easily imagine there are better
> solutions.
> Perhaps we can keep the same function for an IPv4 address (only taking
> the 32 bits of IPv4 addr), and then design one for IPv6 addresses.
I see that, to generate the hash, you would be xor-ing the FF and 00
bytes in the canonicalized IPv4 address. Yes, perhaps a better function
is needed, or as you say, one specifically for IPv6 and one for
canonicalized IPv4.
> Do you have any suggestion on that ?
I don't have anything specific, but you may find something useful if you
poke around elsewhere under net/.
[-- Attachment #2: chuck.lever.vcf --]
[-- Type: text/x-vcard, Size: 302 bytes --]
begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
url:http://oss.oracle.com/~cel
version:2.1
end:vcard
next prev parent reply other threads:[~2007-08-09 15:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-09 7:22 [PATCH 1/1] NFS: change the ip_map cache code to handle IPv6 addresses Aurélien Charbon
2007-08-09 12:16 ` Chuck Lever
2007-08-09 15:08 ` Aurélien Charbon
2007-08-09 15:14 ` Chuck Lever [this message]
2007-08-10 1:11 ` Neil Brown
2007-08-10 1:06 ` Neil Brown
-- strict thread matches above, loose matches on Subject: below --
2007-08-23 13:18 Aurélien Charbon
2007-08-23 15:32 ` Brian Haley
2007-09-06 11:30 ` Aurélien Charbon
2007-09-06 16:16 ` Brian Haley
2007-08-23 15:39 ` Chuck Lever
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46BB2F65.4080602@oracle.com \
--to=chuck.lever@oracle$(echo .)com \
--cc=aurelien.charbon@ext$(echo .)bull.net \
--cc=neilb@suse$(echo .)de \
--cc=netdev@vger$(echo .)kernel.org \
--cc=nfsv4@linux-nfs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox