* [PATCH] net/ice: check process type in reset operation
@ 2022-09-26 13:44 Qiming Yang
2022-09-27 2:07 ` Zhang, Qi Z
0 siblings, 1 reply; 2+ messages in thread
From: Qiming Yang @ 2022-09-26 13:44 UTC (permalink / raw)
To: dev; +Cc: qi.z.zhang, Qiming Yang
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@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
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] net/ice: check process type in reset operation
2022-09-26 13:44 [PATCH] net/ice: check process type in reset operation Qiming Yang
@ 2022-09-27 2:07 ` Zhang, Qi Z
0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2022-09-27 2:07 UTC (permalink / raw)
To: Yang, Qiming, dev
> -----Original Message-----
> From: Yang, Qiming <qiming.yang@intel.com>
> Sent: Monday, September 26, 2022 9:44 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>
> Subject: [PATCH] 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.
>
> Signed-off-by: Qiming Yang <qiming.yang@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;
> +
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.
> /* 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-27 2:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 13:44 [PATCH] net/ice: check process type in reset operation Qiming Yang
2022-09-27 2:07 ` Zhang, Qi Z
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).