Skip to content

Commit

Permalink
qed: Fix possible error in populating max_tc field.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sudarsana.kalluru@cavium.com authored and David S. Miller committed Apr 20, 2017
1 parent e9156cd commit 66367da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/ethernet/qlogic/qed/qed_dcbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,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.
*/
Expand Down

0 comments on commit 66367da

Please sign in to comment.