Skip to content

Commit

Permalink
Merge branch 'qed-dcbx-fixes'
Browse files Browse the repository at this point in the history
Sudarsana Reddy Kalluru says:

====================
qed: Dcbx bug fixes

The series has set of bug fixes for dcbx implementation of qed driver.
Please consider applying this to 'net' branch.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Apr 20, 2017
2 parents e9156cd + c0c5dbe commit 43af390
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion 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 Expand Up @@ -1001,6 +1008,8 @@ qed_dcbx_set_pfc_data(struct qed_hwfn *p_hwfn,
u8 pfc_map = 0;
int i;

*pfc &= ~DCBX_PFC_ERROR_MASK;

if (p_params->pfc.willing)
*pfc |= DCBX_PFC_WILLING_MASK;
else
Expand Down Expand Up @@ -1255,7 +1264,7 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn,
{
struct qed_dcbx_get *dcbx_info;

dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_KERNEL);
dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_ATOMIC);
if (!dcbx_info)
return NULL;

Expand Down Expand Up @@ -2073,6 +2082,8 @@ static int qed_dcbnl_ieee_setpfc(struct qed_dev *cdev, struct ieee_pfc *pfc)
for (i = 0; i < QED_MAX_PFC_PRIORITIES; i++)
dcbx_set.config.params.pfc.prio[i] = !!(pfc->pfc_en & BIT(i));

dcbx_set.config.params.pfc.max_tc = pfc->pfc_cap;

ptt = qed_ptt_acquire(hwfn);
if (!ptt)
return -EINVAL;
Expand Down

0 comments on commit 43af390

Please sign in to comment.