Skip to content

Commit f406220

Browse files
Cody Haasanguy11
authored andcommitted
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: b66a972 ("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>
1 parent b97d5ee commit f406220

3 files changed

Lines changed: 30 additions & 5 deletions

File tree

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ void ice_map_xdp_rings(struct ice_vsi *vsi);
979979
int
980980
ice_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
981981
u32 flags);
982+
int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);
982983
int ice_set_rss_lut(struct ice_vsi *vsi, u8 *lut, u16 lut_size);
983984
int ice_get_rss_lut(struct ice_vsi *vsi, u8 *lut, u16 lut_size);
984985
int ice_set_rss_key(struct ice_vsi *vsi, u8 *seed);

drivers/net/ethernet/intel/ice/ice_ethtool.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3626,11 +3626,7 @@ ice_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
36263626
if (!lut)
36273627
return -ENOMEM;
36283628

3629-
err = ice_get_rss_key(vsi, rxfh->key);
3630-
if (err)
3631-
goto out;
3632-
3633-
err = ice_get_rss_lut(vsi, lut, vsi->rss_table_size);
3629+
err = ice_get_rss(vsi, rxfh->key, lut, vsi->rss_table_size);
36343630
if (err)
36353631
goto out;
36363632

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7988,6 +7988,34 @@ int ice_get_rss_key(struct ice_vsi *vsi, u8 *seed)
79887988
return status;
79897989
}
79907990

7991+
/**
7992+
* ice_get_rss - Get RSS LUT and/or key
7993+
* @vsi: Pointer to VSI structure
7994+
* @seed: Buffer to store the key in
7995+
* @lut: Buffer to store the lookup table entries
7996+
* @lut_size: Size of buffer to store the lookup table entries
7997+
*
7998+
* Return: 0 on success, negative on failure
7999+
*/
8000+
int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)
8001+
{
8002+
int err;
8003+
8004+
if (seed) {
8005+
err = ice_get_rss_key(vsi, seed);
8006+
if (err)
8007+
return err;
8008+
}
8009+
8010+
if (lut) {
8011+
err = ice_get_rss_lut(vsi, lut, lut_size);
8012+
if (err)
8013+
return err;
8014+
}
8015+
8016+
return 0;
8017+
}
8018+
79918019
/**
79928020
* ice_set_rss_hfunc - Set RSS HASH function
79938021
* @vsi: Pointer to VSI structure

0 commit comments

Comments
 (0)