Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Tom Herbert <therbert@google.com>,
	netdev@vger.kernel.org, davem@davemloft.net,
	netdev@markandruth.co.uk
Subject: Re: [PATCH 1/5] soreuseport: infrastructure
Date: Tue, 15 Jan 2013 08:14:04 -0800	[thread overview]
Message-ID: <1358266444.8744.5892.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130115075323.64b2fdc7@nehalam.linuxnetplumber.net>

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@google.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)

  reply	other threads:[~2013-01-15 16:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14 20:00 [PATCH 1/5] soreuseport: infrastructure Tom Herbert
2013-01-15 15:53 ` Stephen Hemminger
2013-01-15 16:14   ` Eric Dumazet [this message]
2013-01-16 18:37     ` Tom Herbert
2013-01-16 19:13       ` Eric Dumazet
     [not found]         ` <20130116224734.GA28741@ppwaskie-mobl2.jf.intel.com>
2013-01-20 23:33           ` Tom Herbert
  -- strict thread matches above, loose matches on Subject: below --
2013-01-22 19:49 Tom Herbert

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=1358266444.8744.5892.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@markandruth.co.uk \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=therbert@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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