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

Zhang, Qi Z qi.z.zhang at intel.com
Tue Sep 27 04:07:10 CEST 2022



> -----Original Message-----
> From: Yang, Qiming <qiming.yang at intel.com>
> Sent: Monday, September 26, 2022 9:44 PM
> To: dev at dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang at intel.com>; Yang, Qiming
> <qiming.yang at 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 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;
> +

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



More information about the dev mailing list