[PATCH v4 1/1] ethdev: parsing multiple representor devargs string

Chaoyong He chaoyong.he at corigine.com
Mon Jan 22 11:10:38 CET 2024


> 
> Hi Chaoyong,
> 
> Please see responses inline
> 
> 
> <snip>
> 
> > >                         return ret;
> > >         }
> > >
> > ...
> > > a/drivers/net/nfp/flower/nfp_flower_representor.c
> > > b/drivers/net/nfp/flower/nfp_flower_representor.c
> > > index 5f7c1fa737..63fe37c8d7 100644
> > > --- a/drivers/net/nfp/flower/nfp_flower_representor.c
> > > +++ b/drivers/net/nfp/flower/nfp_flower_representor.c
> > > @@ -792,8 +792,8 @@ nfp_flower_repr_create(struct
> nfp_app_fw_flower
> > > *app_fw_flower)
> > >
> > >         /* Now parse PCI device args passed for representor info */
> > >         if (pci_dev->device.devargs != NULL) {
> > > -               ret = rte_eth_devargs_parse(pci_dev->device.devargs->args,
> > > &eth_da);
> > > -               if (ret != 0) {
> > > +               ret =
> > > + rte_eth_devargs_parse(pci_dev->device.devargs->args,
> > > &eth_da, 1);
> > > +               if (ret < 0) {
> > >                         PMD_INIT_LOG(ERR, "devarg parse failed");
> > >                         return -EINVAL;
> > >                 }
> >
> > Sorry, I don't quite understand why change 'ret != 0' to 'ret < 0'?
> > Compare return value with 0 or NULL is the specification for our PMD,
> > we prefer not to change it if don't have a good reason.
> > Thanks.
> 
> To support multiple representors under one PCI BDF, "eth_devargs args"
> parameter passed to rte_eth_devargs_parse() is now an array which gets
> populated with multiple "struct rte_eth_devargs" elements viz different pfvf
> representor devargs.
> 
> We are proposing a change to the return value of this API, I.e. negative means
> error condition and positive value refers to no of "struct rte_eth_devargs"
> elements populated. So it can't be zero, else we wont know how many
> elements were populated in the array.
> 
> Thanks
> Harman
> 

Got it, thanks to make it clear.
Then it looks good to me.

> >
> > > --
> > > 2.18.0



More information about the dev mailing list