aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/ice/ice_main.c
diff options
context:
space:
mode:
authorBrett Creeley <brett.creeley@intel.com>2021-03-02 10:15:35 -0800
committerTony Nguyen <anthony.l.nguyen@intel.com>2021-03-31 14:21:28 -0700
commite3c53928a3b2b3ec983955a838547aa7344822be (patch)
treef6dce2efb88724afc5dd3ec32a12c5878ed6d030 /drivers/net/ethernet/intel/ice/ice_main.c
parent8134d5ff9788d3e7f63f963a211927a60ce462d6 (diff)
downloadlinux-e3c53928a3b2b3ec983955a838547aa7344822be.tar.gz
linux-e3c53928a3b2b3ec983955a838547aa7344822be.tar.bz2
linux-e3c53928a3b2b3ec983955a838547aa7344822be.zip
ice: Refactor get/set RSS LUT to use struct parameter
Update ice_aq_get_rss_lut() and ice_aq_set_rss_lut() to take a new structure ice_aq_get_set_rss_params instead of passing individual parameters. This is done for 2 reasons: 1. Reduce the number of parameters passed to the functions. 2. Reduce the amount of change required if the arguments ever need to be updated in the future. Also, reduce duplicate code that was checking for an invalid vsi_handle and lut parameter by moving the checks to the lower level __ice_aq_get_set_rss_lut(). Signed-off-by: Brett Creeley <brett.creeley@intel.com> Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_main.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_main.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 336db16d0e12..8085f0ab2441 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -6348,8 +6348,13 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)
}
if (lut) {
- status = ice_aq_set_rss_lut(hw, vsi->idx, vsi->rss_lut_type,
- lut, lut_size);
+ struct ice_aq_get_set_rss_lut_params set_params = {
+ .vsi_handle = vsi->idx, .lut_size = lut_size,
+ .lut_type = vsi->rss_lut_type, .lut = lut,
+ .global_lut_id = 0
+ };
+
+ status = ice_aq_set_rss_lut(hw, &set_params);
if (status) {
dev_err(dev, "Cannot set RSS lut, err %s aq_err %s\n",
ice_stat_str(status),
@@ -6392,8 +6397,13 @@ int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)
}
if (lut) {
- status = ice_aq_get_rss_lut(hw, vsi->idx, vsi->rss_lut_type,
- lut, lut_size);
+ struct ice_aq_get_set_rss_lut_params get_params = {
+ .vsi_handle = vsi->idx, .lut_size = lut_size,
+ .lut_type = vsi->rss_lut_type, .lut = lut,
+ .global_lut_id = 0
+ };
+
+ status = ice_aq_get_rss_lut(hw, &get_params);
if (status) {
dev_err(dev, "Cannot get RSS lut, err %s aq_err %s\n",
ice_stat_str(status),