[dpdk-stable] patch 'net/hns3: unregister MP action on close for secondary' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:31:50 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/04633406305865d907991c45507bbc4b64397cea

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 04633406305865d907991c45507bbc4b64397cea Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Tue, 2 Nov 2021 09:38:28 +0800
Subject: [PATCH] net/hns3: unregister MP action on close for secondary
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 <lihuisong at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 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 46dfbe5d69..0cce6e6561 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5201,6 +5201,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
+		hns3_mp_uninit();
 		return 0;
 	}
 
@@ -5217,7 +5218,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
 	hns3_uninit_pf(eth_dev);
 	hns3_free_all_queues(eth_dev);
 	rte_free(hw->reset.wait_data);
-	hns3_mp_uninit_primary();
+	hns3_mp_uninit();
 	hns3_warn(hw, "Close port %u finished", hw->data->port_id);
 
 	return ret;
@@ -6371,7 +6372,7 @@ err_init_pf:
 	rte_free(hw->reset.wait_data);
 
 err_init_reset:
-	hns3_mp_uninit_primary();
+	hns3_mp_uninit();
 
 err_mp_init_primary:
 err_mp_init_secondary:
@@ -6392,6 +6393,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 		__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 87859c45a4..b47b0b2bf9 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1993,6 +1993,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 		__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
+		hns3_mp_uninit();
 		return 0;
 	}
 
@@ -2008,7 +2009,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
 	hns3vf_uninit_vf(eth_dev);
 	hns3_free_all_queues(eth_dev);
 	rte_free(hw->reset.wait_data);
-	hns3_mp_uninit_primary();
+	hns3_mp_uninit();
 	hns3_warn(hw, "Close port %u finished", hw->data->port_id);
 
 	return ret;
@@ -2846,7 +2847,7 @@ err_init_vf:
 	rte_free(hw->reset.wait_data);
 
 err_init_reset:
-	hns3_mp_uninit_primary();
+	hns3_mp_uninit();
 
 err_mp_init_primary:
 err_mp_init_secondary:
@@ -2868,6 +2869,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
 		__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 6461ded2d2..8d7fb93065 100644
--- a/drivers/net/hns3/hns3_mp.c
+++ b/drivers/net/hns3/hns3_mp.c
@@ -212,10 +212,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 758ffa70ac..94c0c957e0 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

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:11.874678014 +0800
+++ 0226-net-hns3-unregister-MP-action-on-close-for-secondary.patch	2021-11-10 14:17:02.050744618 +0800
@@ -1 +1 @@
-From 443242212baeb67d298c54cc927553c92aa29bec Mon Sep 17 00:00:00 2001
+From 04633406305865d907991c45507bbc4b64397cea Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 443242212baeb67d298c54cc927553c92aa29bec ]
@@ -22 +25 @@
-index 874854da61..88abbb84ea 100644
+index 46dfbe5d69..0cce6e6561 100644
@@ -25 +28 @@
-@@ -5852,6 +5852,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
+@@ -5201,6 +5201,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
@@ -33 +36 @@
-@@ -5868,7 +5869,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
+@@ -5217,7 +5218,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
@@ -42 +45 @@
-@@ -7463,7 +7464,7 @@ err_init_pf:
+@@ -6371,7 +6372,7 @@ err_init_pf:
@@ -51 +54 @@
-@@ -7486,6 +7487,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
+@@ -6392,6 +6393,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
@@ -60 +63 @@
-index 91acd1f5dd..f7f615bf72 100644
+index 87859c45a4..b47b0b2bf9 100644
@@ -63 +66 @@
-@@ -1895,6 +1895,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
+@@ -1993,6 +1993,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
@@ -71 +74 @@
-@@ -1910,7 +1911,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
+@@ -2008,7 +2009,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
@@ -80 +83 @@
-@@ -2769,7 +2770,7 @@ err_init_vf:
+@@ -2846,7 +2847,7 @@ err_init_vf:
@@ -89 +92 @@
-@@ -2793,6 +2794,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
+@@ -2868,6 +2869,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
@@ -98 +101 @@
-index 1a79d249b8..6d33bf49cd 100644
+index 6461ded2d2..8d7fb93065 100644
@@ -101 +104 @@
-@@ -244,10 +244,7 @@ int hns3_mp_init_primary(void)
+@@ -212,10 +212,7 @@ int hns3_mp_init_primary(void)
@@ -114 +117 @@
-index b49532f985..5738ab74a5 100644
+index 758ffa70ac..94c0c957e0 100644
@@ -117,3 +120,3 @@
-@@ -18,7 +18,7 @@ void hns3_mp_req_start_tx(struct rte_eth_dev *dev);
- void hns3_mp_req_stop_tx(struct rte_eth_dev *dev);
- 
+@@ -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);


More information about the stable mailing list