[PATCH 1/1] NFS: change the ip_map cache code to handle IPv6 addresses

Neil Brown neilb at suse.de
Thu Aug 9 21:11:19 EDT 2007


On Thursday August 9, chuck.lever at oracle.com wrote:
> >>
> >> 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.
> 

I suspect that the given hash function will be as good as any other.
The values in each byte of an IPv6 are likely to be either evenly
distributed, or constant.
Each the first case you don't need a clever hash function to
distribute them, while in the second, no hash function can improve the
distribution. 

NeilBrown


More information about the NFSv4 mailing list