Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [PATCH 6/7] mlx4_en: Adding rxhash support
Date: Tue, 18 Oct 2011 10:34:30 +0200	[thread overview]
Message-ID: <1318926870.2657.5.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> (raw)
In-Reply-To: <953B660C027164448AE903364AC447D2235EEB65@MTLDAG01.mtl.com>

Le mardi 18 octobre 2011 à 07:36 +0000, Yevgeny Petrilin a écrit :
> > >  	rss_context->flags = rss_mask;
> > > +	rss_context->hash_fn = 1;
> > > +	for (i = 0; i < 10; i++)
> > > +		rss_context->rss_key[i] = random32();
> > >
> > 
> > Thats bit of a problem : Two NICS will have different seeds, and thus provide different rxhash for a given flow. A bonding of two NICS will
> > not be able to provide a consistent rxhash.
> > 
> > drivers/net/ethernet/intel/igb/igb_main.c uses a static table to avoid this problem.
> > 
> 
> Hello Eric, thanks for your review.
> 
> I agree that in this case two ports will have different seeds.
> But even if we use static values for the key, what about bonding of 2 NICs from different vendors?
> How can we ensure we get same rxhash value for all NICs?
> 
> There are also other drivers that use random values as well, for example:
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> 

What is the gain using random values ?

Usually, we tend to have same hardware in a single machine, or we use
active-backup bonding mode, and an active slave flip can change rxhash
values with litle effect, since this happens not often.

I really prefer not random values, because it allows to have replayable
configurations : For a given tcp flow, the same rxhash value is given
and same cpu target in RPS. Its way easier to tune your machine for some
workloads.

  reply	other threads:[~2011-10-18  8:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17 20:18 [PATCH 6/7] mlx4_en: Adding rxhash support Yevgeny Petrilin
2011-10-18  1:48 ` Eric Dumazet
2011-10-18  7:36   ` Yevgeny Petrilin
2011-10-18  8:34     ` Eric Dumazet [this message]
2011-10-18  8:59       ` Yevgeny Petrilin
2011-10-18 15:36         ` Stephen Hemminger
2011-10-18 18:49           ` Jesse Brandeburg
2011-10-18 19:05             ` Eric Dumazet
2011-10-18 19:35           ` Ben Hutchings
2011-10-19 14:57             ` Ben Hutchings

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=1318926870.2657.5.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=yevgenyp@mellanox.co.il \
    /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