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 05288A0555; Thu, 20 Feb 2020 04:55:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 83FA81BF9D; Thu, 20 Feb 2020 04:55:31 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 724B71BF7D for ; Thu, 20 Feb 2020 04:55:26 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 9C6D3290C93; Wed, 19 Feb 2020 19:55:25 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 9C6D3290C93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1582170925; bh=/xsfRnxnhU1R913zslPFpqUm5bFbF6LZMkaFz/vqvtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ss6xgbnQuURwzDnFQTNUF2AIvGHWE+HUz4stGe1RQClG+6zu56ZUqCzAAm42tUTgN nWCFV5Kh2w7bBY5+70YJtILIS1sASxjNf2e8stIhGWRXARHtrMKmRlIyORtrN5fDR/ RFFO5+qMYWoelx8ZpluACya8q4yWEHK8XWUI0KSc= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Thu, 20 Feb 2020 09:42:14 +0530 Message-Id: <20200220041214.18053-3-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200220041214.18053-1-kalesh-anakkur.purayil@broadcom.com> References: <20200220041214.18053-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 2/2] net/bnxt: fix race when port is stopped and async events are received 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 Fix a race condition between port stop and error recovery task. When io forwarding is not started on Stingray devices, driver will not receive the async event from FW when there is a FW reset. While exiting testpmd, as part of port stop driver sees this event and this in turn causes a race between port stop and error recovery task. Fixed this by ignoring the fatal/non-fatal async event from FW while stopping port. Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Rahul Gupta Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/bnxt_cpr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 0f7b5e9..21565b1 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -76,6 +76,12 @@ void bnxt_handle_async_event(struct bnxt *bp, PMD_DRV_LOG(INFO, "Port conn async event\n"); break; case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY: + /* Ignore reset notify async events when stopping the port */ + if (!bp->eth_dev->data->dev_started) { + bp->flags |= BNXT_FLAG_FATAL_ERROR; + return; + } + event_data = rte_le_to_cpu_32(async_cmp->event_data1); /* timestamp_lo/hi values are in units of 100ms */ bp->fw_reset_max_msecs = async_cmp->timestamp_hi ? -- 2.10.1