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 6DFA7A0524 for ; Fri, 5 Feb 2021 12:30:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6044A188715; Fri, 5 Feb 2021 12:30:47 +0100 (CET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mails.dpdk.org (Postfix) with ESMTP id 033184067B for ; Fri, 5 Feb 2021 12:30:45 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id g10so7336007wrx.1 for ; Fri, 05 Feb 2021 03:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4JG90DXeWeGSW0qDCUhE9MZgmbGp2pgOxdlx8hT6oKU=; b=uevA4yNnjOCn5GJviiuiXjCfLiD9hYCgpv5lpCPH+1VmhP8MW2VK/ua7NCD08Vfa0N LYLA8Dnu3sNYrvZoHpZG4y0uaik+BHskLeNadVK2Gr82l4ugYqHtHg1XTmbGuCpGyvLO YNofb1C2mpHzyOt9YNJvv7J20OAsWo1uFJbWi4fb4yuxVXfUMboc78RwOaro/U9Zzrpn C15vnt1QyRJZzmcLmk9Cvs78yYtVvCx84XBZqpINujUKyKkl4K/MPI69w/ISeMZ1p+C0 lLmCtYpiv9CCR/STjQ6cRN4h3igxVOpirJ5Ff93yOacjov7SkWNfvV55qLUvcq0MYlJm DCJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4JG90DXeWeGSW0qDCUhE9MZgmbGp2pgOxdlx8hT6oKU=; b=WHH/Dr7ReYn1q8dHGZtef77NI+qKqX/P+WuxMwrlJjZKzAJ96UXJAIkxVBG4dSeLW5 U5ll5lfZgDXRS1vmXAjBve5u3PR6Qv5xMRqliUd4FV5aBzwIuRTaWuHrXBRIESkuATTM slYUpjI2szAdvESGxp0NCadF6D5LMoBdEDqgaE1MjU6vV8eTBogcve1qH5rROQK4KU// z8iOXnRRqnTUCuI5kWpcrJAjz0iHQ+eRCYTgxCs6wJOD8wXAdUa72ITS2MjDVm9SUgTi xZkamVXZiyDUeNsEaomG+yQIehljq7M1cpCdDAjSVxmzxRyP0HT2L/ug01XPCBJLq0FZ XGKg== X-Gm-Message-State: AOAM531yuGEKs8Ac++uWwmZQvWPrSRNGh4HUPAY+2tRffv4d5x67idkh zGk4IBGGbEKn/GlLgs5CEOs= X-Google-Smtp-Source: ABdhPJwkmLda6Uwp1NCSAGP2eLXG5RfekLOWwlsUsAUOfvqrCcszhYt+2/EwsBXXgYvLdWr0PrQU1Q== X-Received: by 2002:a5d:44ce:: with SMTP id z14mr4528834wrr.330.1612524645778; Fri, 05 Feb 2021 03:30:45 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id e11sm11865041wrx.14.2021.02.05.03.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:30:45 -0800 (PST) From: luca.boccassi@gmail.com To: Somnath Kotur Cc: Ajit Khaparde , dpdk stable Date: Fri, 5 Feb 2021 11:16:32 +0000 Message-Id: <20210205111920.1272063-106-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix lock init and destroy' has been queued to stable release 20.11.1 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" Hi, FYI, your patch has been queued to stable release 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/56c042f48df51cfd8c0524b3b1fccc18bf17c8d0 Thanks. Luca Boccassi --- >From 56c042f48df51cfd8c0524b3b1fccc18bf17c8d0 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Thu, 24 Dec 2020 15:07:32 +0530 Subject: [PATCH] net/bnxt: fix lock init and destroy [ 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") Signed-off-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index b2e3683eeb..ff34d54964 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1434,6 +1434,18 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) return 0; } +static void +bnxt_uninit_locks(struct bnxt *bp) +{ + pthread_mutex_destroy(&bp->flow_lock); + pthread_mutex_destroy(&bp->def_cp_lock); + pthread_mutex_destroy(&bp->health_check_lock); + if (bp->rep_info) { + pthread_mutex_destroy(&bp->rep_info->vfr_lock); + pthread_mutex_destroy(&bp->rep_info->vfr_start_lock); + } +} + static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; @@ -1459,6 +1471,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev) bnxt_free_link_info(bp); bnxt_free_pf_info(bp); bnxt_free_parent_info(bp); + bnxt_uninit_locks(bp); rte_memzone_free((const struct rte_memzone *)bp->tx_mem_zone); bp->tx_mem_zone = NULL; @@ -4804,10 +4817,6 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev) return rc; } - rc = bnxt_init_locks(bp); - if (rc) - return rc; - return 0; } @@ -5294,6 +5303,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused) if (rc) goto error_free; + rc = bnxt_init_locks(bp); + if (rc) + goto error_free; + rc = bnxt_init_resources(bp, false); if (rc) goto error_free; @@ -5385,18 +5398,6 @@ bnxt_free_error_recovery_info(struct bnxt *bp) bp->fw_cap &= ~BNXT_FW_CAP_ERROR_RECOVERY; } -static void -bnxt_uninit_locks(struct bnxt *bp) -{ - pthread_mutex_destroy(&bp->flow_lock); - pthread_mutex_destroy(&bp->def_cp_lock); - pthread_mutex_destroy(&bp->health_check_lock); - if (bp->rep_info) { - pthread_mutex_destroy(&bp->rep_info->vfr_lock); - pthread_mutex_destroy(&bp->rep_info->vfr_start_lock); - } -} - static int bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev) { @@ -5418,7 +5419,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev) bnxt_uninit_ctx_mem(bp); - bnxt_uninit_locks(bp); bnxt_free_flow_stats_info(bp); bnxt_free_rep_info(bp); rte_free(bp->ptp_cfg); -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:33.989890192 +0000 +++ 0106-net-bnxt-fix-lock-init-and-destroy.patch 2021-02-05 11:18:28.962694082 +0000 @@ -1 +1 @@ -From c9ffd6f88653163d51c497bb56c62ec3276caf3d Mon Sep 17 00:00:00 2001 +From 56c042f48df51cfd8c0524b3b1fccc18bf17c8d0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c9ffd6f88653163d51c497bb56c62ec3276caf3d ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index ef6b611beb..bd7bcbdfdf 100644 +index b2e3683eeb..ff34d54964 100644 @@ -26 +27 @@ -@@ -1440,6 +1440,18 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) +@@ -1434,6 +1434,18 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) @@ -45 +46 @@ -@@ -1465,6 +1477,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev) +@@ -1459,6 +1471,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev) @@ -53 +54 @@ -@@ -4832,10 +4845,6 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev) +@@ -4804,10 +4817,6 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev) @@ -64 +65 @@ -@@ -5322,6 +5331,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused) +@@ -5294,6 +5303,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused) @@ -75 +76 @@ -@@ -5413,18 +5426,6 @@ bnxt_free_error_recovery_info(struct bnxt *bp) +@@ -5385,18 +5398,6 @@ bnxt_free_error_recovery_info(struct bnxt *bp) @@ -94 +95 @@ -@@ -5446,7 +5447,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev) +@@ -5418,7 +5419,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)