From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AC517A054A for ; Fri, 19 Feb 2021 09:15:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6499160767; Fri, 19 Feb 2021 09:15:27 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.232.172]) by mails.dpdk.org (Postfix) with ESMTP id 8160F160885 for ; Fri, 19 Feb 2021 09:15:26 +0100 (CET) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by relay.smtp-ext.broadcom.com (Postfix) with ESMTPS id D151824761; Fri, 19 Feb 2021 00:15:24 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com D151824761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1613722526; bh=i3MzxWOK3rTnZka5gMujh+JuejCg3FWKFsf46Uj3ZDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j+hqLmi9vwVwfhC1kc8ftTkCW0lVNirrN5MWIjw0K1vCHgz207SiiKnY+iEN9td+R fkeSNDl4q4P8RdjpdxEBPdoe7V+bZ5v1WVi7JQTLzz2iH7OahM6lCUXRPgZpxkKnw4 2NgnlYPmDhcLkpg2XntNWENnxiwB8bsyborbsFIc= From: Somnath Kotur To: stable@dpdk.org Cc: christian.ehrhardt@canonical.com, Somnath Kotur , Ajit Khaparde Date: Fri, 19 Feb 2021 13:45:18 +0530 Message-Id: <20210219081518.12097-2-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.28.0.450.g3a238e5 In-Reply-To: <20210219081518.12097-1-somnath.kotur@broadcom.com> References: <20210219081518.12097-1-somnath.kotur@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 19.11 2/2] net/bnxt: fix lock init and destroy X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" [ upstream commit c9ffd6f88653163d51c497bb56c62ec3276caf3d] Invoking init/uninit locks in init_resources and uninit_resources would end up initializing and destroying locks on every port start stop which is not desired. Move the 2 routines to dev_init and dev_close respectively as locks need to be initialized and destroyed only once during the lifetime of the driver. Fixes: 1cb3d39a48f7 ("net/bnxt: synchronize between flow related functions") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index e3f243cb86..5f9b912b1c 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -4814,10 +4814,6 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev) if (rc) return rc; - rc = bnxt_init_locks(bp); - if (rc) - return rc; - return 0; } @@ -4880,6 +4876,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev) if (rc) goto error_free; + rc = bnxt_init_locks(bp); + if (rc) + goto error_free; + PMD_DRV_LOG(INFO, DRV_MODULE_NAME "found at mem %" PRIX64 ", node addr %pM\n", pci_dev->mem_resource[0].phys_addr, @@ -4920,7 +4920,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev) } } - bnxt_uninit_locks(bp); rte_free(bp->ptp_cfg); bp->ptp_cfg = NULL; return rc; @@ -4952,6 +4951,7 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) if (eth_dev->data->dev_started) bnxt_dev_close_op(eth_dev); bnxt_hwrm_free_vf_info(bp); + bnxt_uninit_locks(bp); eth_dev->dev_ops = NULL; eth_dev->rx_pkt_burst = NULL; eth_dev->tx_pkt_burst = NULL; -- 2.28.0.497.g54e85e7