From: sudarsana.kalluru@cavium.com Date: Wed, 19 Apr 2017 10:19:52 +0000 (-0700) Subject: qed: Fix possible error in populating max_tc field. X-Git-Tag: v4.1.12-111.0.20170918_2215~150 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4a274b883fc9317bc6259fe29ff881105f149b47;p=users%2Fjedix%2Flinux-maple.git qed: Fix possible error in populating max_tc field. 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 Signed-off-by: Yuval Mintz Signed-off-by: David S. Miller [ Upstream commit 66367dab30c7040e638e5496a47184cfc8ba39a4 ] Signed-off-by: Somasundaram Krishnasamy --- diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index 0285d3beed411..46a63c289f98c 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c @@ -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. */