]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
bnxt_en: Don't set ETS on unused TCs.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 16 Dec 2018 23:46:27 +0000 (18:46 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Dec 2018 07:08:53 +0000 (23:08 -0800)
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>
drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c

index a85d2be986af48a7143566a5aa9739129275b126..15c7041e937b7c9275fd52aa6cfbe5b9d510c37b 100644 (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;
 }