]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qed: Fix possible error in populating max_tc field.
authorsudarsana.kalluru@cavium.com <sudarsana.kalluru@cavium.com>
Wed, 19 Apr 2017 10:19:52 +0000 (03:19 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Tue, 19 Sep 2017 05:31:50 +0000 (22:31 -0700)
Orabug: 26783820

Some adapters may not publish the max_tc value. Populate the default
value for max_tc field in case the mfw didn't provide one.

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ Upstream commit 66367dab30c7040e638e5496a47184cfc8ba39a4 ]
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
drivers/net/ethernet/qlogic/qed/qed_dcbx.c

index 0285d3beed41133c4eb77082aadd7c2903457d73..46a63c289f98c6269babb72bea6c29855fe995de 100644 (file)
@@ -581,6 +581,13 @@ qed_dcbx_get_ets_data(struct qed_hwfn *p_hwfn,
                   p_params->ets_cbs,
                   p_ets->pri_tc_tbl[0], p_params->max_ets_tc);
 
+       if (p_params->ets_enabled && !p_params->max_ets_tc) {
+               p_params->max_ets_tc = QED_MAX_PFC_PRIORITIES;
+               DP_VERBOSE(p_hwfn, QED_MSG_DCB,
+                          "ETS params: max_ets_tc is forced to %d\n",
+               p_params->max_ets_tc);
+       }
+
        /* 8 bit tsa and bw data corresponding to each of the 8 TC's are
         * encoded in a type u32 array of size 2.
         */