bnxt_en: Fix enables field in HWRM_QUEUE_COS2BW_CFG request
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Fri, 5 Oct 2018 04:26:01 +0000 (00:26 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2018 07:18:11 +0000 (09:18 +0200)
[ Upstream commit 5db0e0969af6501ad45fe0494039d3b9c797822b ]

In HWRM_QUEUE_COS2BW_CFG request, enables field should have the bits
set only for the queue ids which are having the valid parameters.

This causes firmware to return error when the TC to hardware CoS queue
mapping is not 1:1 during DCBNL ETS setup.

Fixes: 2e8ef77ee0ff ("bnxt_en: Add TC to hardware QoS queue mapping logic.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c

index d5bc72cecde3287e37fba1365b1f54104853738d..3f896acc4ca813f400bfadb837573e01e1c49a82 100644 (file)
@@ -98,13 +98,13 @@ static int bnxt_hwrm_queue_cos2bw_cfg(struct bnxt *bp, struct ieee_ets *ets,
 
        bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_COS2BW_CFG, -1, -1);
        for (i = 0; i < max_tc; i++) {
-               u8 qidx;
+               u8 qidx = bp->tc_to_qidx[i];
 
                req.enables |= cpu_to_le32(
-                       QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID0_VALID << i);
+                       QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID0_VALID <<
+                       qidx);
 
                memset(&cos2bw, 0, sizeof(cos2bw));
-               qidx = bp->tc_to_qidx[i];
                cos2bw.queue_id = bp->q_info[qidx].queue_id;
                if (ets->tc_tsa[i] == IEEE_8021QAZ_TSA_STRICT) {
                        cos2bw.tsa =