* [PATCH] net/cpfl: reset devargs during the first probe
@ 2023-10-11 16:47 beilei.xing
2023-10-12 1:24 ` Zhang, Qi Z
2023-10-12 6:54 ` Wu, Jingjing
0 siblings, 2 replies; 5+ messages in thread
From: beilei.xing @ 2023-10-11 16:47 UTC (permalink / raw)
To: jingjing.wu; +Cc: dev, Beilei Xing
From: Beilei Xing <beilei.xing@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.xing@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));
+
kvlist = rte_kvargs_parse(devargs->args,
first ? cpfl_valid_args_first : cpfl_valid_args_again);
if (kvlist == NULL) {
@@ -1628,7 +1629,6 @@ cpfl_parse_devargs(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *adap
return -EINVAL;
}
- cpfl_args->repr_args_num = 0;
ret = rte_kvargs_process(kvlist, CPFL_REPRESENTOR, &parse_repr, cpfl_args);
if (ret != 0)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] net/cpfl: reset devargs during the first probe
2023-10-11 16:47 [PATCH] net/cpfl: reset devargs during the first probe beilei.xing
@ 2023-10-12 1:24 ` Zhang, Qi Z
2023-10-12 6:54 ` Wu, Jingjing
1 sibling, 0 replies; 5+ messages in thread
From: Zhang, Qi Z @ 2023-10-12 1:24 UTC (permalink / raw)
To: Xing, Beilei, Wu, Jingjing; +Cc: dev, Xing, Beilei
> -----Original Message-----
> From: beilei.xing@intel.com <beilei.xing@intel.com>
> Sent: Thursday, October 12, 2023 12:47 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH] net/cpfl: reset devargs during the first probe
>
> From: Beilei Xing <beilei.xing@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.xing@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));
> +
> kvlist = rte_kvargs_parse(devargs->args,
> first ? cpfl_valid_args_first : cpfl_valid_args_again);
> if (kvlist == NULL) {
> @@ -1628,7 +1629,6 @@ cpfl_parse_devargs(struct rte_pci_device *pci_dev,
> struct cpfl_adapter_ext *adap
> return -EINVAL;
> }
>
> - cpfl_args->repr_args_num = 0;
> ret = rte_kvargs_process(kvlist, CPFL_REPRESENTOR, &parse_repr,
> cpfl_args);
>
> if (ret != 0)
> --
> 2.34.1
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
As the target patch has not been merged into main stream, squashed this patch in dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] net/cpfl: reset devargs during the first probe
2023-10-11 16:47 [PATCH] net/cpfl: reset devargs during the first probe beilei.xing
2023-10-12 1:24 ` Zhang, Qi Z
@ 2023-10-12 6:54 ` Wu, Jingjing
2023-10-12 7:42 ` Xing, Beilei
1 sibling, 1 reply; 5+ messages in thread
From: Wu, Jingjing @ 2023-10-12 6:54 UTC (permalink / raw)
To: Xing, Beilei; +Cc: dev
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Thursday, October 12, 2023 12:47 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH] net/cpfl: reset devargs during the first probe
>
> From: Beilei Xing <beilei.xing@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.xing@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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] net/cpfl: reset devargs during the first probe
2023-10-12 6:54 ` Wu, Jingjing
@ 2023-10-12 7:42 ` Xing, Beilei
2023-10-16 3:57 ` Zhang, Qi Z
0 siblings, 1 reply; 5+ messages in thread
From: Xing, Beilei @ 2023-10-12 7:42 UTC (permalink / raw)
To: Wu, Jingjing; +Cc: dev
> -----Original Message-----
> From: Wu, Jingjing <jingjing.wu@intel.com>
> Sent: Thursday, October 12, 2023 2:54 PM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH] net/cpfl: reset devargs during the first probe
>
>
>
> > -----Original Message-----
> > From: Xing, Beilei <beilei.xing@intel.com>
> > Sent: Thursday, October 12, 2023 12:47 AM
> > To: Wu, Jingjing <jingjing.wu@intel.com>
> > Cc: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>
> > Subject: [PATCH] net/cpfl: reset devargs during the first probe
> >
> > From: Beilei Xing <beilei.xing@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.xing@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.
But 'struct cpfl_devargs devargs' is the member of adapter, if 'memset to 0' happens before probe again, adapter->devargs will only save the last devargs.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] net/cpfl: reset devargs during the first probe
2023-10-12 7:42 ` Xing, Beilei
@ 2023-10-16 3:57 ` Zhang, Qi Z
0 siblings, 0 replies; 5+ messages in thread
From: Zhang, Qi Z @ 2023-10-16 3:57 UTC (permalink / raw)
To: Xing, Beilei, Wu, Jingjing; +Cc: dev
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Thursday, October 12, 2023 3:42 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH] net/cpfl: reset devargs during the first probe
>
>
>
> > -----Original Message-----
> > From: Wu, Jingjing <jingjing.wu@intel.com>
> > Sent: Thursday, October 12, 2023 2:54 PM
> > To: Xing, Beilei <beilei.xing@intel.com>
> > Cc: dev@dpdk.org
> > Subject: RE: [PATCH] net/cpfl: reset devargs during the first probe
> >
> >
> >
> > > -----Original Message-----
> > > From: Xing, Beilei <beilei.xing@intel.com>
> > > Sent: Thursday, October 12, 2023 12:47 AM
> > > To: Wu, Jingjing <jingjing.wu@intel.com>
> > > Cc: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>
> > > Subject: [PATCH] net/cpfl: reset devargs during the first probe
> > >
> > > From: Beilei Xing <beilei.xing@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.xing@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.
>
> But 'struct cpfl_devargs devargs' is the member of adapter, if 'memset to 0'
> happens before probe again, adapter->devargs will only save the last devargs.
Reverted from dpdk-next-net-intel.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-10-16 3:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-11 16:47 [PATCH] net/cpfl: reset devargs during the first probe beilei.xing
2023-10-12 1:24 ` Zhang, Qi Z
2023-10-12 6:54 ` Wu, Jingjing
2023-10-12 7:42 ` Xing, Beilei
2023-10-16 3:57 ` 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).