Skip to content

Commit 0285e7f

Browse files
azaki1NipaLocal
authored andcommitted
ice: fix ICE_AQ_VSI_Q_OPT_RSS_* register values
Fix the values of the ICE_AQ_VSI_Q_OPT_RSS_* registers. Shifting is already done when the values are used, no need to double shift. Bug was not discovered earlier since only ICE_AQ_VSI_Q_OPT_RSS_TPLZ (Zero) is currently used. Also, rename ICE_AQ_VSI_Q_OPT_RSS_XXX to ICE_AQ_VSI_Q_OPT_RSS_HASH_XXX for consistency. Co-developed-by: Jesse Brandeburg <[email protected]> Signed-off-by: Jesse Brandeburg <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Ahmed Zaki <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 1e153d1 commit 0285e7f

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ struct ice_aqc_vsi_props {
492492
#define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M (0xF << ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S)
493493
#define ICE_AQ_VSI_Q_OPT_RSS_HASH_S 6
494494
#define ICE_AQ_VSI_Q_OPT_RSS_HASH_M (0x3 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
495-
#define ICE_AQ_VSI_Q_OPT_RSS_TPLZ (0x0 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
496-
#define ICE_AQ_VSI_Q_OPT_RSS_SYM_TPLZ (0x1 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
497-
#define ICE_AQ_VSI_Q_OPT_RSS_XOR (0x2 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
498-
#define ICE_AQ_VSI_Q_OPT_RSS_JHASH (0x3 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S)
495+
#define ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ 0x0U
496+
#define ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ 0x1U
497+
#define ICE_AQ_VSI_Q_OPT_RSS_HASH_XOR 0x2U
498+
#define ICE_AQ_VSI_Q_OPT_RSS_HASH_JHASH 0x3U
499499
u8 q_opt_tc;
500500
#define ICE_AQ_VSI_Q_OPT_TC_OVR_S 0
501501
#define ICE_AQ_VSI_Q_OPT_TC_OVR_M (0x1F << ICE_AQ_VSI_Q_OPT_TC_OVR_S)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,12 +1191,12 @@ static void ice_set_rss_vsi_ctx(struct ice_vsi_ctx *ctxt, struct ice_vsi *vsi)
11911191
case ICE_VSI_PF:
11921192
/* PF VSI will inherit RSS instance of PF */
11931193
lut_type = ICE_AQ_VSI_Q_OPT_RSS_LUT_PF;
1194-
hash_type = ICE_AQ_VSI_Q_OPT_RSS_TPLZ;
1194+
hash_type = ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ;
11951195
break;
11961196
case ICE_VSI_VF:
11971197
/* VF VSI will gets a small RSS table which is a VSI LUT type */
11981198
lut_type = ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI;
1199-
hash_type = ICE_AQ_VSI_Q_OPT_RSS_TPLZ;
1199+
hash_type = ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ;
12001200
break;
12011201
default:
12021202
dev_dbg(dev, "Unsupported VSI type %s\n",

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -823,20 +823,18 @@ static int ice_vc_handle_rss_cfg(struct ice_vf *vf, u8 *msg, bool add)
823823
int status;
824824

825825
lut_type = ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI;
826-
hash_type = add ? ICE_AQ_VSI_Q_OPT_RSS_XOR :
827-
ICE_AQ_VSI_Q_OPT_RSS_TPLZ;
826+
hash_type = add ? ICE_AQ_VSI_Q_OPT_RSS_HASH_XOR :
827+
ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ;
828828

829829
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
830830
if (!ctx) {
831831
v_ret = VIRTCHNL_STATUS_ERR_NO_MEMORY;
832832
goto error_param;
833833
}
834834

835-
ctx->info.q_opt_rss = ((lut_type <<
836-
ICE_AQ_VSI_Q_OPT_RSS_LUT_S) &
837-
ICE_AQ_VSI_Q_OPT_RSS_LUT_M) |
838-
(hash_type &
839-
ICE_AQ_VSI_Q_OPT_RSS_HASH_M);
835+
ctx->info.q_opt_rss =
836+
FIELD_PREP(ICE_AQ_VSI_Q_OPT_RSS_LUT_M, lut_type) |
837+
FIELD_PREP(ICE_AQ_VSI_Q_OPT_RSS_HASH_M, hash_type);
840838

841839
/* Preserve existing queueing option setting */
842840
ctx->info.q_opt_rss |= (vsi->info.q_opt_rss &

0 commit comments

Comments
 (0)