[PATCH] net/ice: check process type in reset operation

Qiming Yang qiming.yang at intel.com
Mon Sep 26 15:44:05 CEST 2022


The secondary processes are not allowed to release shared resources.
so the stop and reset operation are forbidden in a secondary process.

Signed-off-by: Qiming Yang <qiming.yang at intel.com>
---
 drivers/net/ice/ice_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index cf63ce1f32..d855e9ebe1 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2504,6 +2504,9 @@ ice_dev_stop(struct rte_eth_dev *dev)
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
 	uint16_t i;
 
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return 0;
+
 	/* avoid stopping again */
 	if (pf->adapter_stopped)
 		return 0;
@@ -3742,6 +3745,9 @@ ice_dev_reset(struct rte_eth_dev *dev)
 {
 	int ret;
 
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+                return -ENOTSUP;
+
 	if (dev->data->sriov.active)
 		return -ENOTSUP;
 
-- 
2.25.1



More information about the dev mailing list