Commit 89154002 authored by Dave Ertman's avatar Dave Ertman Committed by Jeff Kirsher

ice: Fix check for contiguous TCs

The current implementation for contiguous TC check
is assuming that the UPs will be mapped to TCs in
a linear progressing fashion.  This is obviously
not always true.

Change the check to allow for various UP2TC mapping
configurations.
Signed-off-by: default avatarDave Ertman <david.m.ertman@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 610ed0e9
...@@ -584,16 +584,21 @@ static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool ets_willing, bool locked) ...@@ -584,16 +584,21 @@ static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool ets_willing, bool locked)
*/ */
static bool ice_dcb_tc_contig(u8 *prio_table) static bool ice_dcb_tc_contig(u8 *prio_table)
{ {
u8 max_tc = 0; bool found_empty = false;
u8 used_tc = 0;
int i; int i;
for (i = 0; i < CEE_DCBX_MAX_PRIO; i++) { /* Create a bitmap of used TCs */
u8 cur_tc = prio_table[i]; for (i = 0; i < CEE_DCBX_MAX_PRIO; i++)
used_tc |= BIT(prio_table[i]);
if (cur_tc > max_tc) for (i = 0; i < CEE_DCBX_MAX_PRIO; i++) {
return false; if (used_tc & BIT(i)) {
else if (cur_tc == max_tc) if (found_empty)
max_tc++; return false;
} else {
found_empty = true;
}
} }
return true; return true;
......
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