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 0E163A0561; Fri, 28 Feb 2020 09:35:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 501991BFDA; Fri, 28 Feb 2020 09:35:34 +0100 (CET) Received: from relay.smtp.broadcom.com (unknown [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 0AB8FB62 for ; Fri, 28 Feb 2020 09:35:33 +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 781F228F58C; Fri, 28 Feb 2020 00:35:31 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 781F228F58C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1582878931; bh=j5+o7VxyFJUx5P7QZHMwL6cflECG4R07mtDoz5luvi0=; h=From:To:Cc:Subject:Date:From; b=itECFabiVtVCDv681zaync5/m8XVCs/4FRlP5iv5XUxk5iMfxMn/XUkkYxAFNtP5l D84bzNDvzNWJbOdoAEcVuy+bleyceGlm0/RQjXCB+hjcjJqLF3mtBihkPgh3cGkbmM 6l4grctYJ38EjvqVBJNIRm5YgMxNgL/VQLtUYl2Q= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Fri, 28 Feb 2020 14:22:15 +0530 Message-Id: <20200228085215.6566-1-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 Subject: [dpdk-dev] [PATCH] net/bnxt: fix to cancel recovery alarm in port close 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 There is a race condition when port is closed while error recovery is happening in driver. Fixed this by canceling the recovery threads during port close. Fixes: df6cd7c1f73a (net/bnxt: handle reset notify async event from FW) Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Santoshkumar Karanappa Rastapur --- drivers/net/bnxt/bnxt_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 18aa313..b8b30ed 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -133,6 +133,7 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev); static int bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev); static void bnxt_cancel_fw_health_check(struct bnxt *bp); static int bnxt_restore_vlan_filters(struct bnxt *bp); +static void bnxt_dev_recover(void *arg); int is_bnxt_in_error(struct bnxt *bp) { @@ -980,6 +981,10 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; + /* cancel the recovery handler before remove dev */ + rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp); + rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp); + if (eth_dev->data->dev_started) bnxt_dev_stop_op(eth_dev); -- 2.10.1