From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1260BA32A1 for ; Thu, 24 Oct 2019 09:54:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5438E1E4EB; Thu, 24 Oct 2019 09:53:05 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id A694F1D422 for ; Thu, 24 Oct 2019 09:52:35 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 8D1741B729C; Thu, 24 Oct 2019 00:52:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 8D1741B729C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1571903555; bh=lenC6Y5sZV6NU97PGscAb1N8CsiYfpYsfVoIwidSPCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MTvpBlNlajyI3BTOIJq2v9XW63zeU2A02qGqlxdFRC8t6+bqDOBWyh9neg3XEL/jQ 0GOpd88XgPLhsUNNYH8nchj/k5y6xu0CZCk/H1H1lqJ7SLjtJVsitXn2XGEn7DQDQP BcrtBrDIgvNCgP+mIf2CxOoiHHUNT4M/rR4cHaTk= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 24 Oct 2019 13:14:28 +0530 Message-Id: <20191024074432.30705-14-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20191024074432.30705-1-somnath.kotur@broadcom.com> References: <20191024074432.30705-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 13/17] net/bnxt: add more checks for fw reset X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP Added check for fw reset or fw errors in few more routines. While processing the events, if it is fw fatal or non-fatal event, there is no need to process the remaining events as driver triggers recovery mechanism. Also added a check for fw reset or fatal error in bnxt_disable_int() to avoid bar access in case of fatal error. Signed-off-by: Kalesh AP Reviewed-by: Rahul Gupta Reviewed-by: Somnath Kotur Reviewed-by: Ajit Kumar Khaparde Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt_irq.c | 8 ++++++++ drivers/net/bnxt/bnxt_rxr.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c index 4feb637..846325e 100644 --- a/drivers/net/bnxt/bnxt_irq.c +++ b/drivers/net/bnxt/bnxt_irq.c @@ -37,6 +37,11 @@ void bnxt_int_handler(void *param) return; } + if (is_bnxt_in_error(bp)) { + pthread_mutex_unlock(&bp->def_cp_lock); + return; + } + cons = RING_CMP(cpr->cp_ring_struct, raw_cons); cmp = &cpr->cp_desc_ring[cons]; @@ -104,6 +109,9 @@ void bnxt_disable_int(struct bnxt *bp) if (BNXT_NUM_ASYNC_CPR(bp) == 0) return; + if (is_bnxt_in_error(bp)) + return; + if (!cpr || !cpr->cp_db.doorbell) return; diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 03dae57..ee1444c 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -639,6 +639,9 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, evt = bnxt_event_hwrm_resp_handler(rxq->bp, (struct cmpl_base *)rxcmp); + /* If the async event is Fatal error, return */ + if (unlikely(is_bnxt_in_error(rxq->bp))) + goto done; } raw_cons = NEXT_RAW_CMP(raw_cons); -- 2.10.1.613.g2cc2e70