From: Jacob Keller <jacob.e.keller@intel.com>
To: netdev@vger.kernel.org
Cc: Jakub Kicinski <moorray3@wp.pl>,
David Miller <davem@davemloft.net>,
Jacob Keller <jacob.e.keller@intel.com>
Subject: [PATCH v2 0/4] ethtool: correct {GS}CHANNELS and {GS}RXFH conflict
Date: Mon, 8 Feb 2016 16:05:02 -0800 [thread overview]
Message-ID: <1454976306-23523-1-git-send-email-jacob.e.keller@intel.com> (raw)
This patch series fixes up ethtool_set_channels operation which
allowed modifying the RXFH table indirectly by reducing the number of
queues below the current max queue used by the Rx flow table. Most
drivers incorrectly allowed this to destroy the Rx flow table and
would then start by reinitializing it to default settings. However,
drivers are not able to correctly handle the conflict since there was
no way to differentiate between the default settings and the user
requested explicit settings.
To fix this, implement a new netdev private flag which we use to
indicate whether the RXFH has been user configured. If someone has
a better alternative of how to store this information, let me know.
I am not sure that priv_flags is the best solution but I have not had
any better idea.
Secondly, we add a function which just calls the driver's get_rxfh
callback to determine the current indirection table. Loop through this
and we can determine the current highest queue that will be used by
RSS.
Now, modify ethtool_set_channels to add a check ensuring that if (a)
we have had rxfh configured by user, (b) we can get the maximum RSS
queue currently used, then we ensure that the newly requested Rx count
(or combined count) is at least as high as this maximum RSS queue. The
reasoning here is that we can always safely increase the number of
queues. If we decrease the queues we must ensure that the decrease
does not go lower than the highest in-use queue for the Rx flow table.
Drivers may still need to be patched if they currently overwrite the
Rx flow table during channel configuration. If the driver currently
always resets Rx flow table when increasing number of queues it must
be patched to only do this when netif_is_rxfh_configured returns
false.
The second patch simply adds a check to ensure that all provided
channel counts fit within driver defined maximums.
The third patch fixes fm10k to correctly reconfigure the RSS reta
table whenever it is still unconfigured. This means that the default
state will provide RSS to every queue. Once the user has configured
RXFH, then we should maintain it. In addition, since the case where we
must reconfigure the RSS table in this case should now no longer
occur, add a dev_err message to indicate the user that we did so.
I have also supplied an ethtool patch to enable setting the default Rx
flow indirection table. Without this, current ethtool does not support
sending an indir_size of 0, and thus does not correctly support
configuring back to the default.
Changes in v2:
* fixed compile error
* fixed incorrect comparison with max_rx_in_use
* adjusted looping over dev_size
* removed inline on function
* dropped patch about separating combined vs asymmetric channels
* verified behavior using fm10k driver
Jacob Keller (3):
ethtool: correctly ensure {GS}CHANNELS doesn't conflict with GS{RXFH}
ethtool: ensure channel counts are within bounds during SCHANNELS
fm10k: don't reinitialize RSS flow table when RXFH configured
drivers/net/ethernet/intel/fm10k/fm10k_main.c | 10 +++-
include/linux/netdevice.h | 8 +++
net/core/ethtool.c | 71 ++++++++++++++++++++++++++-
3 files changed, 85 insertions(+), 4 deletions(-)
--
2.7.0.236.gda096a0.dirty
next reply other threads:[~2016-02-09 0:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-09 0:05 Jacob Keller [this message]
2016-02-09 0:05 ` [PATCH 1/4] ethtool: correctly ensure {GS}CHANNELS doesn't conflict with GS{RXFH} Jacob Keller
2016-02-09 0:05 ` [PATCH 2/4] ethtool: ensure channel counts are within bounds during SCHANNELS Jacob Keller
2016-02-09 0:05 ` [PATCH 3/4] fm10k: don't reinitialize RSS flow table when RXFH configured Jacob Keller
2016-02-09 0:05 ` [PATCH v2 4/4] ethtool: support setting default Rx flow indirection table Jacob Keller
2016-02-16 20:20 ` [PATCH v2 0/4] ethtool: correct {GS}CHANNELS and {GS}RXFH conflict David Miller
[not found] ` <1455657758.23620.21.camel@intel.com>
2016-03-13 16:25 ` [PATCH v2 4/4] ethtool: support setting default Rx flow indirection table Ben Hutchings
2016-03-14 18:13 ` Keller, Jacob E
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=1454976306-23523-1-git-send-email-jacob.e.keller@intel.com \
--to=jacob.e.keller@intel.com \
--cc=davem@davemloft.net \
--cc=moorray3@wp.pl \
--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).