[PATCH v7 08/18] vdpa/ifc: add get device type ops to ifc driver
Xia, Chenbo
chenbo.xia at intel.com
Thu May 12 15:40:37 CEST 2022
> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia at intel.com>
> Sent: Thursday, May 12, 2022 9:22 PM
> To: Pei, Andy <andy.pei at intel.com>; dev at dpdk.org
> Cc: maxime.coquelin at redhat.com; Cao, Gang <gang.cao at intel.com>; Liu,
> Changpeng <changpeng.liu at intel.com>
> Subject: RE: [PATCH v7 08/18] vdpa/ifc: add get device type ops to ifc
> driver
>
> > -----Original Message-----
> > From: Pei, Andy <andy.pei at intel.com>
> > Sent: Wednesday, April 27, 2022 4:30 PM
> > To: dev at dpdk.org
> > Cc: Xia, Chenbo <chenbo.xia at intel.com>; maxime.coquelin at redhat.com; Cao,
> > Gang <gang.cao at intel.com>; Liu, Changpeng <changpeng.liu at intel.com>
> > Subject: [PATCH v7 08/18] vdpa/ifc: add get device type ops to ifc
> driver
> >
> > Add get device type ops to ifc driver.
> >
> > Signed-off-by: Andy Pei <andy.pei at intel.com>
> > ---
> > drivers/vdpa/ifc/ifcvf_vdpa.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c
> b/drivers/vdpa/ifc/ifcvf_vdpa.c
> > index 8a260b7..99a6ab0 100644
> > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> > @@ -1300,6 +1300,15 @@ struct rte_vdpa_dev_info {
> > return 0;
> > }
> >
> > +static int
> > +ifcvf_blk_get_device_type(struct rte_vdpa_device *vdev,
> > + uint32_t *type)
> > +{
> > + RTE_SET_USED(vdev);
> > + *type = VDPA_DEVICE_TYPE_BLK;
> > + return 0;
>
> This is not right. Remember net and blk are both using the driver?
> This will lead to using net also returns BLK.
Correct a bit for above: will lead to net not working. So implement
callback for both (although in the API, NULL callback can return NET type)
Thanks,
Chenbo
>
> And I suggest the patch-set validated with both blk and net...
>
> Besides, ifcvf_blk_get_device_type should be ifcvf_get_device_type
>
> Thanks,
> Chenbo
>
> > +}
> > +
> > static struct rte_vdpa_dev_ops ifcvf_blk_ops = {
> > .get_queue_num = ifcvf_get_queue_num,
> > .get_features = ifcvf_get_vdpa_features,
> > @@ -1313,6 +1322,7 @@ struct rte_vdpa_dev_info {
> > .get_vfio_device_fd = ifcvf_get_vfio_device_fd,
> > .get_notify_area = ifcvf_get_notify_area,
> > .get_config = ifcvf_blk_get_config,
> > + .get_dev_type = ifcvf_blk_get_device_type,
> > };
> >
> > struct rte_vdpa_dev_info dev_info[] = {
> > --
> > 1.8.3.1
More information about the dev
mailing list