net/ice: check process type in reset operation
PATCH 1/1 net/ice: check process type in reset operation
The secondary processes are not allowed to release shared resources. so the stop and reset operation are forbidden in a secondary process.
--- drivers/net/ice/ice_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ice/ice_ethdev.c +6 -0
@@ -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 ;
Signature · 1 line
2.25.1
Quoted 23 lines
-----Original Message-----
From: Yang, Qiming <[email protected]>
Sent: Monday, September 26, 2022 9:44 PM
To: [email protected]
Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>
Subject: [PATCH] net/ice: check process type in reset operationThe 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 <[email protected]>--- drivers/net/ice/ice_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/net/ice/ice_ethdev.c index renamed from drivers/net/ice/ice_ethdev.c +0
-0
cf63ce1f32..d855e9ebe1100644
drivers/net/ice/ice_ethdev.c ice_dev_stop(struct rte_eth_dev *dev) · line 2509
Quoted 6 lines
drivers/net/ice/ice_ethdev.c +3
-0@@ -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 ; +
If we didn't explicitly deny dev_start from secondary process, then we'd better keep same for dev_stop Any conflict should be handled inside the PMD.
Quoted 14 lines
drivers/net/ice/ice_ethdev.c +3
-1/* 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