Commit b3b93d6c authored by Tarun Singh's avatar Tarun Singh Committed by Tony Nguyen

ice: Add RL profile bit mask check

Mask bits before accessing the profile type field.
Signed-off-by: default avatarTarun Singh <tarun.k.singh@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent a02016de
...@@ -2153,8 +2153,8 @@ ice_sched_add_rl_profile(struct ice_port_info *pi, ...@@ -2153,8 +2153,8 @@ ice_sched_add_rl_profile(struct ice_port_info *pi,
hw = pi->hw; hw = pi->hw;
list_for_each_entry(rl_prof_elem, &pi->rl_prof_list[layer_num], list_for_each_entry(rl_prof_elem, &pi->rl_prof_list[layer_num],
list_entry) list_entry)
if (rl_prof_elem->profile.flags == profile_type && if ((rl_prof_elem->profile.flags & ICE_AQC_RL_PROFILE_TYPE_M) ==
rl_prof_elem->bw == bw) profile_type && rl_prof_elem->bw == bw)
/* Return existing profile ID info */ /* Return existing profile ID info */
return rl_prof_elem; return rl_prof_elem;
...@@ -2384,7 +2384,8 @@ ice_sched_rm_rl_profile(struct ice_port_info *pi, u8 layer_num, u8 profile_type, ...@@ -2384,7 +2384,8 @@ ice_sched_rm_rl_profile(struct ice_port_info *pi, u8 layer_num, u8 profile_type,
/* Check the existing list for RL profile */ /* Check the existing list for RL profile */
list_for_each_entry(rl_prof_elem, &pi->rl_prof_list[layer_num], list_for_each_entry(rl_prof_elem, &pi->rl_prof_list[layer_num],
list_entry) list_entry)
if (rl_prof_elem->profile.flags == profile_type && if ((rl_prof_elem->profile.flags & ICE_AQC_RL_PROFILE_TYPE_M) ==
profile_type &&
le16_to_cpu(rl_prof_elem->profile.profile_id) == le16_to_cpu(rl_prof_elem->profile.profile_id) ==
profile_id) { profile_id) {
if (rl_prof_elem->prof_id_ref) if (rl_prof_elem->prof_id_ref)
...@@ -2546,8 +2547,8 @@ ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node, ...@@ -2546,8 +2547,8 @@ ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node,
return 0; return 0;
return ice_sched_rm_rl_profile(pi, layer_num, return ice_sched_rm_rl_profile(pi, layer_num,
rl_prof_info->profile.flags, rl_prof_info->profile.flags &
old_id); ICE_AQC_RL_PROFILE_TYPE_M, old_id);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment