[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c07725b3a3d0b0a63b85e230f9c77af59d4d07f8.1723045898.git.ecree.xilinx@gmail.com>
Date: Wed, 7 Aug 2024 17:06:13 +0100
From: <edward.cree@....com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <edumazet@...gle.com>,
<pabeni@...hat.com>
CC: Edward Cree <ecree.xilinx@...il.com>, <netdev@...r.kernel.org>
Subject: [PATCH v2 net 2/2] net: ethtool: check rxfh_max_num_contexts != 1 at register time
From: Edward Cree <ecree.xilinx@...il.com>
A value of 1 doesn't make sense, as it implies the only allowed
context ID is 0, which is reserved for the default context - in
which case the driver should just not claim to support custom
RSS contexts at all.
Suggested-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Edward Cree <ecree.xilinx@...il.com>
---
net/ethtool/common.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 07032babd1b6..5f714bbbef19 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -654,6 +654,8 @@ int ethtool_check_ops(const struct ethtool_ops *ops)
{
if (WARN_ON(ops->set_coalesce && !ops->supported_coalesce_params))
return -EINVAL;
+ if (WARN_ON(ops->rxfh_max_num_contexts == 1))
+ 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.
Powered by blists - more mailing lists