]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ice: Fix persistent failure in ice_get_rxfh
authorCody Haas <chaas@riotgames.com>
Sat, 13 Dec 2025 00:22:26 +0000 (16:22 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 20 Jan 2026 20:55:34 +0000 (12:55 -0800)
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/
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice.h
drivers/net/ethernet/intel/ice/ice_ethtool.c
drivers/net/ethernet/intel/ice/ice_main.c

index 147aaee192a791d4c721f69d4e59fc13b2c07a3d..00f75d87c73f9a47b6c8e942876b5d0ee5ad091f 100644 (file)
@@ -979,6 +979,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);
index 969d4f8f9c02460c2dd40cb9c520d83bd13391a3..3565a5d96c6d18a0aa414d5aa374c0d58bfc68fe 100644 (file)
@@ -3626,11 +3626,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;
 
index 4bb68e7a00f5f4f60a667b0f0c1ff0ec5142ac54..6a9278487ccb45b52f7a3516a9cc3253de695b4f 100644 (file)
@@ -7988,6 +7988,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
+ *
+ * Return: 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