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 BBDD2A0561; Fri, 28 Feb 2020 11:04:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F23671BFD1; Fri, 28 Feb 2020 11:04:49 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 6B4741BFCE for ; Fri, 28 Feb 2020 11:04:48 +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 1FE5228F9FC; Fri, 28 Feb 2020 02:04:47 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 1FE5228F9FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1582884287; bh=VjyD6YFmknBbfHej71woElnwN898yKHDcpdt0V3MA/g=; h=From:To:Cc:Subject:Date:From; b=sH2mlKNgG+T3lmwo+zn6d9HPwhU1R3iR9dB25Tyja3fcET1/PMm8MCddmXKjWMvpB 6beygdrAmEysI2FLN7lNfJU1xIUDO/JSDSpQVkncvCS6ms8itX44s0x15eb5FdQqeZ K2qZbUhEYvGYAiNjYJarskcz/96q4Us6joeQoNEw= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Fri, 28 Feb 2020 15:51:31 +0530 Message-Id: <20200228102131.7941-1-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 Subject: [dpdk-dev] [PATCH v2] 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 --- v1->v2: fixed the "Fixes" tagline as pointed by Kevin Traynor 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