Re: [PATCH net-next v6 1/4] ethtool: Track user-provided RSS indirection table size
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-03-19 02:23:13
Also in:
linux-kselftest, linux-rdma, lkml
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-03-19 02:23:13
Also in:
linux-kselftest, linux-rdma, lkml
On Wed, 18 Mar 2026 13:25:58 +0100 Björn Töpel wrote:
diff --git a/net/ethtool/common.c b/net/ethtool/common.c index e252cf20c22f..ee91f1155830 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c@@ -1204,6 +1204,26 @@ void ethtool_rxfh_context_lost(struct net_device *dev, u32 context_id) } EXPORT_SYMBOL(ethtool_rxfh_context_lost); +bool netif_is_rxfh_configured(const struct net_device *dev) +{ + return dev->ethtool->rss_indir_user_size; +} +EXPORT_SYMBOL(netif_is_rxfh_configured); + +/** + * ethtool_rxfh_indir_clear - Clear user indirection table config + * @dev: network device + * + * Mark the default RSS context indirection table as unconfigured and + * send an %ETHTOOL_MSG_RSS_NTF notification.
If you're adding kdoc you should very clearly state this is function should only be called if the driver lost the ability to maintain the indirection table, usually after HW fault recovery reduced the max queue count.
+ */ +void ethtool_rxfh_indir_clear(struct net_device *dev)
ethtool_rxfh_indir_lost() would be a better name, it would align with ethtool_rxfh_context_lost() right above the code you're adding, right?
+{Let's add an error in here like the one we have in ethtool_rxfh_context_lost(), this should stop arbitrary use. And you can remove the local warning in bnxt if we do that.
+ dev->ethtool->rss_indir_user_size = 0;
+ ethtool_rss_notify(dev, ETHTOOL_MSG_RSS_NTF, 0);
+}
+EXPORT_SYMBOL(ethtool_rxfh_indir_clear);
+
enum ethtool_link_medium ethtool_str_to_medium(const char *str)
{
int i;