lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709153251.360291-1-gal@nvidia.com>
Date: Wed, 9 Jul 2025 18:32:51 +0300
From: Gal Pressman <gal@...dia.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
	<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>, Andrew Lunn <andrew+netdev@...n.ch>,
	<netdev@...r.kernel.org>
CC: Andrew Lunn <andrew@...n.ch>, Simon Horman <horms@...nel.org>, "Gal
 Pressman" <gal@...dia.com>, Dragos Tatulea <dtatulea@...dia.com>
Subject: [PATCH net-next] ethtool: Fix set RXFH for drivers without RXFH fields support

Some drivers (e.g., mlx4_en) support ->set_rxfh() functionality (such as
setting hash function), but not setting the RXFH fields.

The requirement of ->get_rxfh_fields() in ethtool_set_rxfh() is there to
verify that we have no conflict with the RSS fields options, if it
doesn't exist then there is no point in doing the check.
Soften the check in ethtool_set_rxfh() so it doesn't fail when
->get_rxfh_fields() doesn't exist.

This fixes the following error:
$ ethtool --set-rxfh-indir eth2 hfunc xor
Cannot set RX flow hash configuration: Operation not supported

Fixes: 72792461c8e8 ("net: ethtool: don't mux RXFH via rxnfc callbacks")
Reviewed-by: Dragos Tatulea <dtatulea@...dia.com>
Signed-off-by: Gal Pressman <gal@...dia.com>
---
 net/ethtool/ioctl.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index b6d96e562c9a..4bb8bf20a0eb 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -1519,7 +1519,7 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
 	u8 *rss_config;
 	int ret;
 
-	if (!ops->get_rxnfc || !ops->get_rxfh_fields || !ops->set_rxfh)
+	if (!ops->get_rxnfc || !ops->set_rxfh)
 		return -EOPNOTSUPP;
 
 	if (ops->get_rxfh_indir_size)
@@ -1623,9 +1623,11 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
 
 	mutex_lock(&dev->ethtool->rss_lock);
 
-	ret = ethtool_check_flow_types(dev, rxfh.input_xfrm);
-	if (ret)
-		goto out_unlock;
+	if (ops->get_rxfh_fields) {
+		ret = ethtool_check_flow_types(dev, rxfh.input_xfrm);
+		if (ret)
+			goto out_unlock;
+	}
 
 	if (rxfh.rss_context && rxfh_dev.rss_delete) {
 		ret = ethtool_check_rss_ctx_busy(dev, rxfh.rss_context);
-- 
2.40.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ