From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mody, Rasesh" Subject: [PATCH 03/18] net/qede/base: add DPC sync after PF stop Date: Sat, 29 Sep 2018 08:14:28 +0000 Message-ID: <1538208822-9726-4-git-send-email-rasesh.mody@cavium.com> References: <1538208822-9726-1-git-send-email-rasesh.mody@cavium.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "Mody, Rasesh" , "ferruh.yigit@intel.com" , Dept-Eng DPDK Dev To: "dev@dpdk.org" Return-path: Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690074.outbound.protection.outlook.com [40.107.69.74]) by dpdk.org (Postfix) with ESMTP id E51A85F35 for ; Sat, 29 Sep 2018 10:14:35 +0200 (CEST) In-Reply-To: <1538208822-9726-1-git-send-email-rasesh.mody@cavium.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add DPC sync after stopping the physical funciton to allow clean up of asyncronous events. Post this the driver don't expect the FW to send async events. Signed-off-by: Rasesh Mody --- drivers/net/qede/base/ecore_dev.c | 6 ++++++ drivers/net/qede/base/ecore_spq.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecor= e_dev.c index f09f771..4558306 100644 --- a/drivers/net/qede/base/ecore_dev.c +++ b/drivers/net/qede/base/ecore_dev.c @@ -2804,6 +2804,12 @@ enum _ecore_status_t ecore_hw_stop(struct ecore_dev = *p_dev) rc2 =3D ECORE_UNKNOWN_ERROR; } =20 + OSAL_DPC_SYNC(p_hwfn); + + /* After this point we don't expect the FW to send us async + * events + */ + /* perform debug action after PF stop was sent */ OSAL_AFTER_PF_STOP((void *)p_dev, p_hwfn->my_id); =20 diff --git a/drivers/net/qede/base/ecore_spq.c b/drivers/net/qede/base/ecor= e_spq.c index 776c86f..1a02ba2 100644 --- a/drivers/net/qede/base/ecore_spq.c +++ b/drivers/net/qede/base/ecore_spq.c @@ -283,8 +283,10 @@ static enum _ecore_status_t ecore_spq_hw_post(struct e= core_hwfn *p_hwfn, { ecore_spq_async_comp_cb cb; =20 - if (!p_hwfn->p_spq || (p_eqe->protocol_id >=3D MAX_PROTOCOL_TYPE)) + if (p_eqe->protocol_id >=3D MAX_PROTOCOL_TYPE) { + DP_ERR(p_hwfn, "Wrong protocol: %d\n", p_eqe->protocol_id); return ECORE_INVAL; + } =20 cb =3D p_hwfn->p_spq->async_comp_cb[p_eqe->protocol_id]; if (cb) { @@ -339,10 +341,16 @@ enum _ecore_status_t ecore_eq_completion(struct ecore= _hwfn *p_hwfn, { struct ecore_eq *p_eq =3D cookie; struct ecore_chain *p_chain =3D &p_eq->chain; + u16 fw_cons_idx =3D 0; enum _ecore_status_t rc =3D 0; =20 + if (!p_hwfn->p_spq) { + DP_ERR(p_hwfn, "Unexpected NULL p_spq\n"); + return ECORE_INVAL; + } + /* take a snapshot of the FW consumer */ - u16 fw_cons_idx =3D OSAL_LE16_TO_CPU(*p_eq->p_fw_cons); + fw_cons_idx =3D OSAL_LE16_TO_CPU(*p_eq->p_fw_cons); =20 DP_VERBOSE(p_hwfn, ECORE_MSG_SPQ, "fw_cons_idx %x\n", fw_cons_idx); =20 --=20 1.7.10.3