Netdev List
 help / color / mirror / Atom feed
* [PATCH iwl-net v2 0/1] ice: Fix persistent failure in ice_get_rxfh
@ 2025-12-13  0:22 Cody Haas
  2025-12-13  0:22 ` Cody Haas
  0 siblings, 1 reply; 6+ messages in thread
From: Cody Haas @ 2025-12-13  0:22 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem, kuba,
	pabeni, netdev, Cody Haas

Hey all,

This is a small bug fix for an issue I found when testing some e810 NICs
on kernel 6.16.5-200.fc42.x86_64. I originally reported the bug in
https://lore.kernel.org/intel-wired-lan/CAH7f-UKkJV8MLY7zCdgCrGE55whRhbGAXvgkDnwgiZ9gUZT7_w@mail.gmail.com/

User Impact of the Bug
----------------------
In the current in-tree ice driver, if a user tries to get the
indirection table using the SIOCETHTOOL command and the
ETHTOOL_GRXFHINDIR subcommand the subsequent function call with always
fail with -EINVAL. 

Cause of the Bug
----------------
When a user gets the indirection table using SIOCETHTOOL and ETHTOOL_GRXFHINDIR
ethtool_get_rxfh_indir is called. This function will end up calling
ice_get_rxfh which then calls ice_get_rss_key. The function
ice_get_rss_key expects its *seed parameter to never be null. This *seed
parameter is the key field in ethtool_rxfh_param. Neither ice_get_rxfh
nor ethtool_get_rxfh_indir set this value, so it will always be null.
This causes the *seed parameter for ice_get_rss_key to always be null,
ultimately causing ice_get_rss_key to always return -EINVAL.

Fix for the Bug
---------------
To fix this, I went ahead and implemented ice_get_rss which checks if
the rss_key is not null before calling ice_key_rss_key. This follows
suit with the i40e driver's implementation.

Cody Haas (1):
  ice: Fix persistent failure in ice_get_rxfh

 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(-)

base-commit: 67181985211850332c8ff942815c1961fd7058b9
-- 
2.51.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH iwl-net v2 0/1] ice: Fix persistent failure in ice_get_rxfh
  2025-12-13  0:22 [PATCH iwl-net v2 0/1] ice: Fix persistent failure in ice_get_rxfh Cody Haas
@ 2025-12-13  0:22 ` Cody Haas
  2025-12-15  8:51   ` [Intel-wired-lan] " Loktionov, Aleksandr
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Cody Haas @ 2025-12-13  0:22 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem, kuba,
	pabeni, netdev, Cody Haas

Several ioctl functions have the ability to call ice_get_rxfh, however
all of these ioctl functions do not provide all of the expected
information in ethtool_rxfh_param. For example, ethtool_get_rxfh_indir does
not provide an rss_key. This previously caused ethtool_get_rxfh_indir to
always fail with -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.

Fixes: b66a972abb6b ("ice: Refactor ice_set/get_rss into LUT and key specific functions")
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..c653029f07c1 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 err;
+
+	if (seed) {
+		err = ice_get_rss_key(vsi, seed);
+		if (err)
+			return err;
+	}
+
+	if (lut) {
+		err = ice_get_rss_lut(vsi, lut, lut_size);
+		if (err)
+			return err;
+	}
+
+	return 0;
+}
+
 /**
  * ice_set_rss_hfunc - Set RSS HASH function
  * @vsi: Pointer to VSI structure
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-net v2 0/1] ice: Fix persistent failure in ice_get_rxfh
  2025-12-13  0:22 ` Cody Haas
@ 2025-12-15  8:51   ` Loktionov, Aleksandr
  2025-12-15 13:18   ` Przemek Kitszel
  2026-01-15 16:26   ` [Intel-wired-lan] " Rinitha, SX
  2 siblings, 0 replies; 6+ messages in thread
From: Loktionov, Aleksandr @ 2025-12-15  8:51 UTC (permalink / raw)
  To: Haas, Cody, intel-wired-lan@lists.osuosl.org
  Cc: Nguyen, Anthony L, Kitszel, Przemyslaw, andrew+netdev@lunn.ch,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, Haas, Cody



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Cody Haas
> Sent: Saturday, December 13, 2025 1:22 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@intel.com>; andrew+netdev@lunn.ch;
> davem@davemloft.net; kuba@kernel.org; pabeni@redhat.com;
> netdev@vger.kernel.org; Haas, Cody <chaas@riotgames.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net v2 0/1] ice: Fix persistent
> failure in ice_get_rxfh
> 
> Several ioctl functions have the ability to call ice_get_rxfh, however
> all of these ioctl functions do not provide all of the expected
> information in ethtool_rxfh_param. For example, ethtool_get_rxfh_indir
> does not provide an rss_key. This previously caused
> ethtool_get_rxfh_indir to always fail with -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.
> 
> Fixes: b66a972abb6b ("ice: Refactor ice_set/get_rss into LUT and key
> specific functions")
> 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..c653029f07c1 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 err;
> +
> +	if (seed) {
> +		err = ice_get_rss_key(vsi, seed);
> +		if (err)
> +			return err;
> +	}
> +
> +	if (lut) {
> +		err = ice_get_rss_lut(vsi, lut, lut_size);
> +		if (err)
> +			return err;
> +	}
> +
> +	return 0;
> +}
> +
>  /**
>   * ice_set_rss_hfunc - Set RSS HASH function
>   * @vsi: Pointer to VSI structure
> --
> 2.51.1

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH iwl-net v2 0/1] ice: Fix persistent failure in ice_get_rxfh
  2025-12-13  0:22 ` Cody Haas
  2025-12-15  8:51   ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2025-12-15 13:18   ` Przemek Kitszel
  2025-12-15 17:59     ` Cody Haas
  2026-01-15 16:26   ` [Intel-wired-lan] " Rinitha, SX
  2 siblings, 1 reply; 6+ messages in thread
From: Przemek Kitszel @ 2025-12-15 13:18 UTC (permalink / raw)
  To: Cody Haas
  Cc: anthony.l.nguyen, andrew+netdev, davem, kuba, pabeni, netdev,
	intel-wired-lan

On 12/13/25 01:22, Cody Haas wrote:
> Several ioctl functions have the ability to call ice_get_rxfh, however
> all of these ioctl functions do not provide all of the expected
> information in ethtool_rxfh_param. For example, ethtool_get_rxfh_indir does
> not provide an rss_key. This previously caused ethtool_get_rxfh_indir to
> always fail with -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.
> 
> Fixes: b66a972abb6b ("ice: Refactor ice_set/get_rss into LUT and key specific functions")
> Signed-off-by: Cody Haas <chaas@riotgames.com>
> Closes: https://lore.kernel.org/intel-wired-lan/CAH7f-UKkJV8MLY7zCdgCrGE55whRhbGAXvgkDnwgiZ9gUZT7_w@mail.gmail.com/

thank you for the fix,
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>

next time please do link to the previous revision and add a changelog
(no need to respin just for that!)

> ---
>   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..c653029f07c1 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 err;
> +
> +	if (seed) {
> +		err = ice_get_rss_key(vsi, seed);
> +		if (err)
> +			return err;
> +	}
> +
> +	if (lut) {
> +		err = ice_get_rss_lut(vsi, lut, lut_size);
> +		if (err)
> +			return err;
> +	}
> +
> +	return 0;
> +}
> +
>   /**
>    * ice_set_rss_hfunc - Set RSS HASH function
>    * @vsi: Pointer to VSI structure


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH iwl-net v2 0/1] ice: Fix persistent failure in ice_get_rxfh
  2025-12-15 13:18   ` Przemek Kitszel
@ 2025-12-15 17:59     ` Cody Haas
  0 siblings, 0 replies; 6+ messages in thread
From: Cody Haas @ 2025-12-15 17:59 UTC (permalink / raw)
  To: Przemek Kitszel
  Cc: anthony.l.nguyen, andrew+netdev, davem, kuba, pabeni, netdev,
	intel-wired-lan

On Mon, Dec 15, 2025 at 5:18 AM Przemek Kitszel
<przemyslaw.kitszel@intel.com> wrote:
> thank you for the fix,
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>

Thank you for the review!

> next time please do link to the previous revision and add a changelog

I'll take note and make sure to add it next time! Thank you for the feedback

Cody

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-net v2 0/1] ice: Fix persistent failure in ice_get_rxfh
  2025-12-13  0:22 ` Cody Haas
  2025-12-15  8:51   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2025-12-15 13:18   ` Przemek Kitszel
@ 2026-01-15 16:26   ` Rinitha, SX
  2 siblings, 0 replies; 6+ messages in thread
From: Rinitha, SX @ 2026-01-15 16:26 UTC (permalink / raw)
  To: Haas, Cody, intel-wired-lan@lists.osuosl.org
  Cc: Nguyen, Anthony L, Kitszel, Przemyslaw, andrew+netdev@lunn.ch,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, Haas, Cody

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Cody Haas
> Sent: 13 December 2025 05:52
> To: intel-wired-lan@lists.osuosl.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; andrew+netdev@lunn.ch; davem@davemloft.net; kuba@kernel.org; pabeni@redhat.com; netdev@vger.kernel.org; Haas, Cody <chaas@riotgames.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net v2 0/1] ice: Fix persistent failure in ice_get_rxfh
>
> Several ioctl functions have the ability to call ice_get_rxfh, however all of these ioctl functions do not provide all of the expected information in ethtool_rxfh_param. For example, ethtool_get_rxfh_indir does not provide an rss_key. This previously caused ethtool_get_rxfh_indir to always fail with -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.
>
> Fixes: b66a972abb6b ("ice: Refactor ice_set/get_rss into LUT and key specific functions")
> 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(-)
>

Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-01-15 16:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-13  0:22 [PATCH iwl-net v2 0/1] ice: Fix persistent failure in ice_get_rxfh Cody Haas
2025-12-13  0:22 ` Cody Haas
2025-12-15  8:51   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-12-15 13:18   ` Przemek Kitszel
2025-12-15 17:59     ` Cody Haas
2026-01-15 16:26   ` [Intel-wired-lan] " Rinitha, SX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox