diff mbox series

[v7,13/18] vdpa/ifc: read virtio max queues from hardware

Message ID 1651048206-282372-14-git-send-email-andy.pei@intel.com (mailing list archive)
State Superseded
Delegated to: Maxime Coquelin
Headers show
Series add virtio_blk device support to vdpa/ifc | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andy Pei April 27, 2022, 8:30 a.m. UTC
Original code max_queues is set to IFCVF_MAX_QUEUES.
New code max_queues is the min of IFCVF_MAX_QUEUES and hardware num_queues.

Signed-off-by: Andy Pei <andy.pei@intel.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Xia, Chenbo May 12, 2022, 1:55 p.m. UTC | #1
> -----Original Message-----
> From: Pei, Andy <andy.pei@intel.com>
> Sent: Wednesday, April 27, 2022 4:30 PM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; maxime.coquelin@redhat.com; Cao,
> Gang <gang.cao@intel.com>; Liu, Changpeng <changpeng.liu@intel.com>
> Subject: [PATCH v7 13/18] vdpa/ifc: read virtio max queues from hardware
> 
> Original code max_queues is set to IFCVF_MAX_QUEUES.
> New code max_queues is the min of IFCVF_MAX_QUEUES and hardware num_queues.
> 
> Signed-off-by: Andy Pei <andy.pei@intel.com>
> ---
>  drivers/vdpa/ifc/ifcvf_vdpa.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 4060a44..5a8cf1c 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -1457,6 +1457,10 @@ struct rte_vdpa_dev_info dev_info[] = {
>  			internal->hw.blk_cfg->geometry.sectors);
>  		DRV_LOG(INFO, "num_queues: 0x%08x",
>  			internal->hw.blk_cfg->num_queues);
> +
> +		/* reset max_queue here, to minimum modification */
> +		internal->max_queues = RTE_MIN(IFCVF_MAX_QUEUES,
> +			internal->hw.blk_cfg->num_queues);

MQ is not supported now in this driver, should we make this change later?

Thanks,
Chenbo

>  	}
> 
>  	list->internal = internal;
> --
> 1.8.3.1
Andy Pei May 13, 2022, 8:58 a.m. UTC | #2
Hi Chenbo,

Thanks for your reply.
This patch will be omitted in next version.

> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia@intel.com>
> Sent: Thursday, May 12, 2022 9:55 PM
> To: Pei, Andy <andy.pei@intel.com>; dev@dpdk.org
> Cc: maxime.coquelin@redhat.com; Cao, Gang <gang.cao@intel.com>; Liu,
> Changpeng <changpeng.liu@intel.com>
> Subject: RE: [PATCH v7 13/18] vdpa/ifc: read virtio max queues from
> hardware
> 
> > -----Original Message-----
> > From: Pei, Andy <andy.pei@intel.com>
> > Sent: Wednesday, April 27, 2022 4:30 PM
> > To: dev@dpdk.org
> > Cc: Xia, Chenbo <chenbo.xia@intel.com>; maxime.coquelin@redhat.com;
> > Cao, Gang <gang.cao@intel.com>; Liu, Changpeng
> > <changpeng.liu@intel.com>
> > Subject: [PATCH v7 13/18] vdpa/ifc: read virtio max queues from
> > hardware
> >
> > Original code max_queues is set to IFCVF_MAX_QUEUES.
> > New code max_queues is the min of IFCVF_MAX_QUEUES and hardware
> num_queues.
> >
> > Signed-off-by: Andy Pei <andy.pei@intel.com>
> > ---
> >  drivers/vdpa/ifc/ifcvf_vdpa.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > b/drivers/vdpa/ifc/ifcvf_vdpa.c index 4060a44..5a8cf1c 100644
> > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> > @@ -1457,6 +1457,10 @@ struct rte_vdpa_dev_info dev_info[] = {
> >  			internal->hw.blk_cfg->geometry.sectors);
> >  		DRV_LOG(INFO, "num_queues: 0x%08x",
> >  			internal->hw.blk_cfg->num_queues);
> > +
> > +		/* reset max_queue here, to minimum modification */
> > +		internal->max_queues = RTE_MIN(IFCVF_MAX_QUEUES,
> > +			internal->hw.blk_cfg->num_queues);
> 
> MQ is not supported now in this driver, should we make this change later?
> 
> Thanks,
> Chenbo
> 
> >  	}
> >
> >  	list->internal = internal;
> > --
> > 1.8.3.1
>
diff mbox series

Patch

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 4060a44..5a8cf1c 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1457,6 +1457,10 @@  struct rte_vdpa_dev_info dev_info[] = {
 			internal->hw.blk_cfg->geometry.sectors);
 		DRV_LOG(INFO, "num_queues: 0x%08x",
 			internal->hw.blk_cfg->num_queues);
+
+		/* reset max_queue here, to minimum modification */
+		internal->max_queues = RTE_MIN(IFCVF_MAX_QUEUES,
+			internal->hw.blk_cfg->num_queues);
 	}
 
 	list->internal = internal;