netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Gal Pressman <gal@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>, <netdev@vger.kernel.org>,
	Andrew Lunn <andrew@lunn.ch>, Simon Horman <horms@kernel.org>,
	Dragos Tatulea <dtatulea@nvidia.com>
Subject: Re: [PATCH net-next] ethtool: Fix set RXFH for drivers without RXFH fields support
Date: Wed, 9 Jul 2025 17:25:08 -0700	[thread overview]
Message-ID: <20250709172508.5df4e5c9@kernel.org> (raw)
In-Reply-To: <20250709153251.360291-1-gal@nvidia.com>

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

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.

WDYT?

  reply	other threads:[~2025-07-10  0:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 15:32 [PATCH net-next] ethtool: Fix set RXFH for drivers without RXFH fields support Gal Pressman
2025-07-10  0:25 ` Jakub Kicinski [this message]
2025-07-10 11:17   ` Gal Pressman
2025-07-10 13:37     ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250709172508.5df4e5c9@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=horms@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).