netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: VenkatKumar.Duvvuru@Emulex.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v5 net-next 0/2] patchset: Support for configurable RSS hash key
Date: Wed, 19 Mar 2014 15:59:30 -0400 (EDT)	[thread overview]
Message-ID: <20140319.155930.1805664690676428310.davem@davemloft.net> (raw)
In-Reply-To: <193620ac-855b-4c2a-b9ab-962b2edfbfa2@CMEXHTCAS2.ad.emulex.com>

From: Venkat Duvvuru <VenkatKumar.Duvvuru@Emulex.com>
Date: Mon, 17 Mar 2014 18:01:33 +0530

> NIC drivers that support RSS use either a hard-coded value or a random value for
> the RSS hash key. Irrespective of the type of the key used, the user would want
> to change the hash key if he/she is not satisfied with the effectiveness of the
> default hash-key in spreading the incoming flows evenly across the RSS queues.
> 
> This patch set adds support for configuring the RSS hash-key via the ethtool
> interface using -X option.

I apologize, but I really dislike this.  For several reasons.

First, why aren't we adding _just_ a RSS hash changing interface?

We already have an interface for changing the indirection table,
there is absolutely not need to add a second interface that supports
both indirection table _plus_ hash modifications.

And combining these two is what leads to this hard to audit, ugly,
data structure layout.

There's the indirection table at some offset, then the key at some
other offset.  This makes it impossible to impose type checking
of any kind on both objects.

And the data structure is furthermore named in a way that suggests
it's just for doing things with the RSS hash.

Just add:

struct ethtool_rxfh {
	__u32	cmd;
	__u32	key_size;
	__u32	key[0];
};

And that's it.

To change the indirection table, call "ETHTOOL_SRXFH".  To set the
RSS flow hash, call "ETHTOOL_SRSSH".

  reply	other threads:[~2014-03-19 19:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 12:31 [PATCH v5 net-next 0/2] patchset: Support for configurable RSS hash key Venkat Duvvuru
2014-03-19 19:59 ` David Miller [this message]
2014-03-20 12:02   ` Venkata Duvvuru
2014-03-20 19:43     ` David Miller
2014-03-21 14:33   ` Ben Hutchings
2014-03-21 19:28     ` David Miller
2014-03-26  9:21       ` Venkata Duvvuru
2014-03-27 18:53         ` David Miller
2014-03-28  1:39           ` Ben Hutchings
2014-03-28 21:12             ` David Miller
2014-04-01 15:19               ` Venkata Duvvuru
2014-04-01 16:20                 ` David Miller
2014-04-01 16:55                   ` Ben Hutchings
2014-04-02 11:14                   ` Venkata Duvvuru
2014-04-03 18:37                     ` David Miller

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=20140319.155930.1805664690676428310.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=VenkatKumar.Duvvuru@Emulex.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).