Subject: Re: many sockets, slow sendto

From: Eric Dumazet <[email-masked]>
Date: Mon, 30 Apr 2007 21:59:06 +0200

YOSHIFUJI Hideaki / 吉藤英明 a écrit :
> In article <[email-masked]> (at Mon, 30 Apr 2007 14:47:15 +0200), Eric Dumazet <[email-masked]> says:
> 
>> Also, I am not sure we need to use all 128 bits of IPV6 address, maybe the 64 low order bits are enough ?
> 
> Well, maybe, but in IPv6, auto-configured addresses on an interface have
> the same 64-bit LSBs.  So, I'd keep as-is so far.
> 

Hum... then maybe ipv6_addr_hash() in include/net/addrconf.h should be changed 
as well

static __inline__ u8 ipv6_addr_hash(const struct in6_addr *addr)
{
         __u32 word;

         /*
          * We perform the hash function over the last 64 bits of the address
          * This will include the IEEE address token on links that support it.
          */

         word = (__force u32)(addr->s6_addr32[2] ^ addr->s6_addr32[3]);
         word ^= (word >> 16);
         word ^= (word >> 8);

         return ((word ^ (word >> 4)) & 0x0f);
}