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 833BDA32A1 for ; Thu, 24 Oct 2019 08:08:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 781631C29C; Thu, 24 Oct 2019 08:07:47 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id BA4031C033 for ; Thu, 24 Oct 2019 08:07:00 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 3FC0E28FAAA; Wed, 23 Oct 2019 23:07:00 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 3FC0E28FAAA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1571897220; bh=N3ywszljJEBCojBxwqQcOJPZYSn5nhMFi7svh/Tx+jM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FtVHQ7MUkydc861CcgsbeJKh4esq0p5q1EjnAauoChKKBsbJIudjrfKM/dt7X9qvT ZpgyA4sFVCNzDgKYjhvk/Jqpz7jjROmOXvUZzjPcRHlcff9j9QPng+A+mrRESlJGK1 00lUryVuMO4arTSWoBr4/174uxscrDXYC1bjTPWY= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 24 Oct 2019 11:29:08 +0530 Message-Id: <20191024055913.28817-14-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20191024055913.28817-1-somnath.kotur@broadcom.com> References: <20191024055913.28817-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 13/16] 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); -- 1.8.3.1