> -----Original Message-----
> From: Xing, Beilei <beilei.x...@intel.com>
> Sent: Thursday, October 12, 2023 12:47 AM
> To: Wu, Jingjing <jingjing...@intel.com>
> Cc: dev@dpdk.org; Xing, Beilei <beilei.x...@intel.com>
> Subject: [PATCH] net/cpfl: reset devargs during the first probe
> 
> From: Beilei Xing <beilei.x...@intel.com>

> Reset devargs during the first probe. Otherwise, probe again will
> be affected.
> 
> Fixes: a607312291b3 ("net/cpfl: support probe again")
> 
> Signed-off-by: Beilei Xing <beilei.x...@intel.com>
> ---
>  drivers/net/cpfl/cpfl_ethdev.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
> index 762fbddfe6..890a027a1d 100644
> --- a/drivers/net/cpfl/cpfl_ethdev.c
> +++ b/drivers/net/cpfl/cpfl_ethdev.c
> @@ -1611,11 +1611,12 @@ cpfl_parse_devargs(struct rte_pci_device *pci_dev,
> struct cpfl_adapter_ext *adap
>       struct rte_kvargs *kvlist;
>       int ret;
> 
> -     cpfl_args->req_vport_nb = 0;
> -
>       if (devargs == NULL)
>               return 0;
> 
> +     if (first)
> +             memset(cpfl_args, 0, sizeof(struct cpfl_devargs));
> +
adapter is allocated by rte_zmalloc. It should be zero already.
If I understand correctly, memset to 0 should be happened when first probe is 
done or before probe again but not at the beginning when first probe.

Reply via email to