[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070430144715.b0c03c83.dada1@cosmosbay.com>
Date: Mon, 30 Apr 2007 14:47:15 +0200
From: Eric Dumazet <dada1@...mosbay.com>
To: YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@...ux-ipv6.org>
Cc: davem@...emloft.net, zacco@...hu, baruch@...en.org,
netdev@...r.kernel.org
Subject: Re: many sockets, slow sendto
On Mon, 30 Apr 2007 19:56:04 +0900 (JST)
YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@...ux-ipv6.org> wrote:
> In article <20070430.002643.68156452.davem@...emloft.net> (at Mon, 30 Apr 2007 00:26:43 -0700 (PDT)), David Miller <davem@...emloft.net> says:
>
> > > Signed-off-by: Eric Dumazet <dada1@...mosbay.com>
> >
> > Eric, I've applied this, thanks again.
> >
> > Could I trouble you to cook up an ipv6 version of this patch?
>
> Here's my tentative version. Not tested.
> Dave, Eric, could you double-check this, please?
Hi Yoshifuji
Your patch seems good, thank you.
I have two minor comments about udp6_hash_port_and_addr()
Compiler knows that const 'struct in6_addr *addr' is NULL when we call udp6_hash_port_and_addr(..., NULL)
But not when we pass saddr : udp6_hash_port_and_addr(port, saddr)
So to avoid one conditional branch, you could use udp6_hash_port_and_addr() only once, with addr not NULL :
Also, I am not sure we need to use all 128 bits of IPV6 address, maybe the 64 low order bits are enough ?
static inline unsigned int udp6_hash_port_and_addr(__u16 port,
const struct in6_addr *addr)
{
u32 hash = (__force u32) addr->s6_addr32[2] ^
(__force u32) addr->s6_addr32[3];
hash ^= hash >> 16;
hash ^= hash >> 8;
return port ^ hash;
}
static inline unsigned int udp6_hash_wildcard(__u16 port,
const struct in6_addr *addr)
{
return port;
}
...
hash = udp6_hash_port_and_addr(ntohs(dport), saddr);
hashwild = udp6_hash_wildcard(ntohs(dport), saddr);
Eric
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists