[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1358266444.8744.5892.camel@edumazet-glaptop>
Date: Tue, 15 Jan 2013 08:14:04 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Tom Herbert <therbert@...gle.com>, netdev@...r.kernel.org,
davem@...emloft.net, netdev@...kandruth.co.uk
Subject: Re: [PATCH 1/5] soreuseport: infrastructure
On Tue, 2013-01-15 at 07:53 -0800, Stephen Hemminger wrote:
> On Mon, 14 Jan 2013 12:00:18 -0800 (PST)
> Tom Herbert <therbert@...gle.com> wrote:
>
> > +/* Pseudo random number generator from numerical recipes. */
> > +static inline u32 next_pseudo_random32(u32 seed)
> > +{
> > + return seed * 1664525 + 1013904223;
> > +}
> > +
>
> Don't reimplement a pseudo random number generator, there already
> exists net_random()
net_random() is way more expensive and not needed in this context.
If you have 32 listeners bound on the same port, we can call this 32
times per SYN message.
Initial seed is random enough (phash = inet_ehashfn(net, daddr,
hnum,saddr,sport)
Anyway, the full idea of distributing SYN using a random generator is
not the best one for a multi queue NIC, and/or if RPS/RFS is used.
Ideally, we should chose a target given by the current CPU number, in
case SYN messages are spread on all cpus or a set of cpus.
(same idea than PACKET_FANOUT_CPU in net/packet/af_packet.c)
--
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