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 30239A04A2 for ; Sat, 25 Dec 2021 11:58:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E77DF40E64; Sat, 25 Dec 2021 11:58:43 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id B9E9D40140 for ; Sat, 25 Dec 2021 11:58:41 +0100 (CET) Received: from kwepemi500001.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4JLgrk3CHlzbjZr; Sat, 25 Dec 2021 18:58:14 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by kwepemi500001.china.huawei.com (7.221.188.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Sat, 25 Dec 2021 18:58:40 +0800 Received: from localhost.localdomain (10.67.165.24) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Sat, 25 Dec 2021 18:58:39 +0800 From: Huisong Li To: , CC: , Subject: [PATCH 19.11 4/4] net/hns3: unregister MP action on close for secondary Date: Sat, 25 Dec 2021 18:53:44 +0800 Message-ID: <20211225105344.28355-5-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211225105344.28355-1-lihuisong@huawei.com> References: <20211225105344.28355-1-lihuisong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected 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 [ upstream commit 443242212baeb67d298c54cc927553c92aa29bec ] This patch fixes lack of unregistering MP action for secondary process when PMD is closed. Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result") Fixes: 23d4b61fee5d ("net/hns3: support multiple process") Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_ethdev.c | 6 ++++-- drivers/net/hns3/hns3_ethdev_vf.c | 6 ++++-- drivers/net/hns3/hns3_mp.c | 5 +---- drivers/net/hns3/hns3_mp.h | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 122a2bc66c..df76dfce7f 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -4750,6 +4750,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) rte_free(eth_dev->process_private); eth_dev->process_private = NULL; __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); + hns3_mp_uninit(); return; } @@ -4768,7 +4769,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) rte_free(hw->reset.wait_data); rte_free(eth_dev->process_private); eth_dev->process_private = NULL; - hns3_mp_uninit_primary(); + hns3_mp_uninit(); hns3_warn(hw, "Close port %d finished", hw->data->port_id); } @@ -5529,7 +5530,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev) rte_free(hw->reset.wait_data); err_init_reset: - hns3_mp_uninit_primary(); + hns3_mp_uninit(); err_mp_init_primary: err_mp_init_secondary: @@ -5554,6 +5555,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev) rte_free(eth_dev->process_private); eth_dev->process_private = NULL; __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); + hns3_mp_uninit(); return 0; } diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 562f6f7662..dbd46cd278 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1655,6 +1655,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) rte_free(eth_dev->process_private); eth_dev->process_private = NULL; __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); + hns3_mp_uninit(); return; } @@ -1672,7 +1673,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) rte_free(hw->reset.wait_data); rte_free(eth_dev->process_private); eth_dev->process_private = NULL; - hns3_mp_uninit_primary(); + hns3_mp_uninit(); hns3_warn(hw, "Close port %d finished", hw->data->port_id); } @@ -2364,7 +2365,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev) rte_free(hw->reset.wait_data); err_init_reset: - hns3_mp_uninit_primary(); + hns3_mp_uninit(); err_mp_init_primary: err_mp_init_secondary: @@ -2390,6 +2391,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev) rte_free(eth_dev->process_private); eth_dev->process_private = NULL; __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); + hns3_mp_uninit(); return 0; } diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c index c7e49a798a..b017387efd 100644 --- a/drivers/net/hns3/hns3_mp.c +++ b/drivers/net/hns3/hns3_mp.c @@ -213,10 +213,7 @@ int hns3_mp_init_primary(void) return 0; } -/* - * Un-initialize by primary process. - */ -void hns3_mp_uninit_primary(void) +void hns3_mp_uninit(void) { process_data.eth_dev_cnt--; diff --git a/drivers/net/hns3/hns3_mp.h b/drivers/net/hns3/hns3_mp.h index 8ef432e763..ef334648ff 100644 --- a/drivers/net/hns3/hns3_mp.h +++ b/drivers/net/hns3/hns3_mp.h @@ -15,7 +15,7 @@ extern struct hns3_process_local_data process_data; void hns3_mp_req_start_rxtx(struct rte_eth_dev *dev); void hns3_mp_req_stop_rxtx(struct rte_eth_dev *dev); int hns3_mp_init_primary(void); -void hns3_mp_uninit_primary(void); +void hns3_mp_uninit(void); int hns3_mp_init_secondary(void); #endif /* _HNS3_MP_H_ */ -- 2.33.0