Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a1cb1bf authored by Denis Bolotin's avatar Denis Bolotin Committed by David S. Miller
Browse files

qed: Add DCBX API - qed_dcbx_get_priority_tc()



The API receives a priority and looks for the TC it is mapped to in the
operational DCBX configuration. The API returns QED_DCBX_DEFAULT_TC (0)
when DCBX is disabled.

Signed-off-by: default avatarMichal Kalderon <michal.kalderon@cavium.com>
Signed-off-by: default avatarAriel Elior <ariel.elior@cavium.com>
Signed-off-by: default avatarDenis Bolotin <denis.bolotin@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5941923d
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
@@ -989,6 +989,24 @@ void qed_dcbx_set_pf_update_params(struct qed_dcbx_results *p_src,
	qed_dcbx_update_protocol_data(p_dcb_data, p_src, DCBX_PROTOCOL_ETH);
	qed_dcbx_update_protocol_data(p_dcb_data, p_src, DCBX_PROTOCOL_ETH);
}
}


u8 qed_dcbx_get_priority_tc(struct qed_hwfn *p_hwfn, u8 pri)
{
	struct qed_dcbx_get *dcbx_info = &p_hwfn->p_dcbx_info->get;

	if (pri >= QED_MAX_PFC_PRIORITIES) {
		DP_ERR(p_hwfn, "Invalid priority %d\n", pri);
		return QED_DCBX_DEFAULT_TC;
	}

	if (!dcbx_info->operational.valid) {
		DP_VERBOSE(p_hwfn, QED_MSG_DCB,
			   "Dcbx parameters not available\n");
		return QED_DCBX_DEFAULT_TC;
	}

	return dcbx_info->operational.params.ets_pri_tc_tbl[pri];
}

#ifdef CONFIG_DCB
#ifdef CONFIG_DCB
static int qed_dcbx_query_params(struct qed_hwfn *p_hwfn,
static int qed_dcbx_query_params(struct qed_hwfn *p_hwfn,
				 struct qed_dcbx_get *p_get,
				 struct qed_dcbx_get *p_get,
+3 −0
Original line number Original line Diff line number Diff line
@@ -123,4 +123,7 @@ void qed_dcbx_info_free(struct qed_hwfn *p_hwfn);
void qed_dcbx_set_pf_update_params(struct qed_dcbx_results *p_src,
void qed_dcbx_set_pf_update_params(struct qed_dcbx_results *p_src,
				   struct pf_update_ramrod_data *p_dest);
				   struct pf_update_ramrod_data *p_dest);


#define QED_DCBX_DEFAULT_TC	0

u8 qed_dcbx_get_priority_tc(struct qed_hwfn *p_hwfn, u8 pri);
#endif
#endif