bnxt_en: Don't set ETS on unused TCs.

Currently, the code allows ETS bandwidth weight 0 to be set on unused TCs.
We should not set any DCB parameters on unused TCs at all.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Michael Chan 2018-12-16 18:46:27 -05:00 committed by David S. Miller
parent e37fed7903
commit 24654f095e
1 changed files with 4 additions and 1 deletions

View File

@ -471,7 +471,10 @@ static int bnxt_ets_validate(struct bnxt *bp, struct ieee_ets *ets, u8 *tc)
if (total_ets_bw > 100)
return -EINVAL;
*tc = max_tc + 1;
if (max_tc >= bp->max_tc)
*tc = bp->max_tc;
else
*tc = max_tc + 1;
return 0;
}