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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a6341aa1-dd8b-4449-ba95-38bb067d6483@nvidia.com>
Date: Thu, 10 Jul 2025 14:17:11 +0300
From: Gal Pressman <gal@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
 Andrew Lunn <andrew+netdev@...n.ch>, netdev@...r.kernel.org,
 Andrew Lunn <andrew@...n.ch>, Simon Horman <horms@...nel.org>,
 Dragos Tatulea <dtatulea@...dia.com>
Subject: Re: [PATCH net-next] ethtool: Fix set RXFH for drivers without RXFH
 fields support

On 10/07/2025 3:25, Jakub Kicinski wrote:
> On Wed, 9 Jul 2025 18:32:51 +0300 Gal Pressman wrote:
>> 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
> 
> Ah, thanks for the fix!
> 
> In this case I wonder if we wouldn't be better off returning early 
> in ethtool_check_flow_types() if input_xfrm is 0 or NO_CHANGE.
> Most drivers will have get_rxfh_fields - still there's no point
> in doing the check if they have empty ops->supported_input_xfrm

Makes sense.

> 
> We could add a:
> 
> 	if (WARN_ON(ops->supported_input_xfrm && !ops->get_rxfh_fields))
> 		return -EINVAL;
> 
> into ethtool_check_ops() and we'd be both safe and slightly faster.

This is a step further.

There could be a driver that allows setting of input xfrm but not rxfh
fields. Failing the netdevice registration is different than skipping
ethtool_check_flow_types().

Maybe there are no such devices and we shouldn't care?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ