From: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
To: Cody Haas <chaas@riotgames.com>, intel-wired-lan@lists.osuosl.org
Cc: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com
Subject: Re: [Intel-wired-lan] [PATCH iwl-next 1/1] ice: Fix persistent failure in ice_get_rxfh
Date: Tue, 9 Dec 2025 09:51:12 +0100 [thread overview]
Message-ID: <fb53b7bf-9d4e-4492-9d99-90e7e8105205@linux.intel.com> (raw)
In-Reply-To: <20251203184909.422955-2-chaas@riotgames.com>
Hey Cody,
Thank you for finding the bug and proposing a fix. In addition to
Przemek's review, below are some minor nitpicks from me, otherwise looks
good to me!
On 2025-12-03 7:49 PM, Cody Haas wrote:
> Several ioctl functions have the ability to call ice_get_rxfh, however
> all of these iotctl functions do not provide all of the expected
typo s/iotctl/ioctl
> information in ethtool_rxfh_param. For example,ethtool_get_rxfh_indir does
punctuation: missing space after "For example,"
> not provide an rss_key. Previously, caused ethtool_get_rxfh_indir to
> always fail with an -EINVAL.
>
> This change draws inspiration from i40e_get_rss to handle this
> situation, by only calling the appropriate rss helpers when the
> necessary information has been provided via ethtool_rxfh_param.
>
> Signed-off-by: Cody Haas <chaas@riotgames.com>
> Closes: https://lore.kernel.org/intel-wired-lan/CAH7f-UKkJV8MLY7zCdgCrGE55whRhbGAXvgkDnwgiZ9gUZT7_w@mail.gmail.com/
>
> ---
> drivers/net/ethernet/intel/ice/ice.h | 1 +
> drivers/net/ethernet/intel/ice/ice_ethtool.c | 6 +----
> drivers/net/ethernet/intel/ice/ice_main.c | 28 ++++++++++++++++++++
> 3 files changed, 30 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
> index c9104b13e1d2..87f4098324ed 100644
> --- a/drivers/net/ethernet/intel/ice/ice.h
> +++ b/drivers/net/ethernet/intel/ice/ice.h
> @@ -953,6 +953,7 @@ void ice_map_xdp_rings(struct ice_vsi *vsi);
> int
> ice_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
> u32 flags);
> +int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);
> int ice_set_rss_lut(struct ice_vsi *vsi, u8 *lut, u16 lut_size);
> int ice_get_rss_lut(struct ice_vsi *vsi, u8 *lut, u16 lut_size);
> int ice_set_rss_key(struct ice_vsi *vsi, u8 *seed);
> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> index b0805704834d..a5c139cc536d 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> @@ -3649,11 +3649,7 @@ ice_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
> if (!lut)
> return -ENOMEM;
>
> - err = ice_get_rss_key(vsi, rxfh->key);
> - if (err)
> - goto out;
> -
> - err = ice_get_rss_lut(vsi, lut, vsi->rss_table_size);
> + err = ice_get_rss(vsi, rxfh->key, lut, vsi->rss_table_size);
> if (err)
> goto out;
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index b084839eb811..7b409b9fca5c 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -8072,6 +8072,34 @@ int ice_get_rss_key(struct ice_vsi *vsi, u8 *seed)
> return status;
> }
>
> +/**
> + * ice_get_rss - Get RSS LUT and/or key
> + * @vsi: Pointer to VSI structure
> + * @seed: Buffer to store the key in
> + * @lut: Buffer to store the lookup table entries
> + * @lut_size: Size of buffer to store the lookup table entries
> + *
> + * Returns 0 on success, negative on failure
> + */
> +int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)
> +{
> + int status = 0;
> +
> + if (lut) {
nit: in function arguments "seed" appears first, maybe consider
switching the order of the if statements so they appear in the same
order as in function declaration? It would also match the i40e
implementation then
Thanks,
Dawid
> + status = ice_get_rss_lut(vsi, lut, lut_size);
> + if (status)
> + return status;
> + }
> +
> + if (seed) {
> + status = ice_get_rss_key(vsi, seed);
> + if (status)
> + return status;
> + }
> +
> + return status;
> +}
> +
> /**
> * ice_set_rss_hfunc - Set RSS HASH function
> * @vsi: Pointer to VSI structure
next prev parent reply other threads:[~2025-12-09 8:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-03 18:49 [Intel-wired-lan] [PATCH iwl-next 0/1] ice: Fix persistent failure in ice_get_rxfh Cody Haas
2025-12-03 18:49 ` [Intel-wired-lan] [PATCH iwl-next 1/1] " Cody Haas
2025-12-05 10:36 ` Przemek Kitszel
2025-12-05 10:36 ` Przemek Kitszel
2025-12-10 0:57 ` [Intel-wired-lan] " Cody Haas
2025-12-10 0:57 ` Cody Haas
2025-12-09 8:51 ` Dawid Osuchowski [this message]
2025-12-12 18:03 ` [Intel-wired-lan] " Cody Haas
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=fb53b7bf-9d4e-4492-9d99-90e7e8105205@linux.intel.com \
--to=dawid.osuchowski@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=chaas@riotgames.com \
--cc=davem@davemloft.net \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.