[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250717234343.2328602-2-kuba@kernel.org>
Date: Thu, 17 Jul 2025 16:43:36 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
andrew+netdev@...n.ch,
horms@...nel.org,
andrew@...n.ch,
donald.hunter@...il.com,
shuah@...nel.org,
kory.maincent@...tlin.com,
gal@...dia.com,
ecree.xilinx@...il.com,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH net-next 1/8] ethtool: assert that drivers with sym hash are consistent for RSS contexts
Supporting per-RSS context configuration of hashing fields but
not the hashing algorithm would complicate the code a lot.
We'd need to cross check the config against all RSS contexts.
None of the drivers need this today, so explicitly prevent
new drivers with such skewed capabilities from registering.
If such driver appears it will need to first adjust the checks
in the core.
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
net/ethtool/common.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 4dcb4194f3ce..82afe0f2a7cd 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -829,6 +829,10 @@ int ethtool_check_ops(const struct ethtool_ops *ops)
return -EINVAL;
if (WARN_ON(ops->supported_input_xfrm && !ops->get_rxfh_fields))
return -EINVAL;
+ if (WARN_ON(ops->supported_input_xfrm &&
+ ops->rxfh_per_ctx_fields != ops->rxfh_per_ctx_key))
+ return -EINVAL;
+
/* NOTE: sufficiently insane drivers may swap ethtool_ops at runtime,
* the fact that ops are checked at registration time does not
* mean the ops attached to a netdev later on are sane.
--
2.50.1
Powered by blists - more mailing lists