diff mbox series

[v3,2/8] vdpa/ifc: add multi-queue support

Message ID 1663308990-621-3-git-send-email-andy.pei@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers show
Series vdpa/ifc: add multi queue support | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andy Pei Sept. 16, 2022, 6:16 a.m. UTC
Enable VHOST_USER_PROTOCOL_F_MQ feature.
Expose IFCVF_MQ_OFFSET register to enable multi queue.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Signed-off-by: Huang Wei <wei.huang@intel.com>
---
 drivers/vdpa/ifc/base/ifcvf.c | 5 +++++
 drivers/vdpa/ifc/base/ifcvf.h | 2 ++
 drivers/vdpa/ifc/ifcvf_vdpa.c | 1 +
 3 files changed, 8 insertions(+)

Comments

Xia, Chenbo Oct. 12, 2022, 3:01 a.m. UTC | #1
> -----Original Message-----
> From: Pei, Andy <andy.pei@intel.com>
> Sent: Friday, September 16, 2022 2:16 PM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; Xu, Rosen <rosen.xu@intel.com>;
> Huang, Wei <wei.huang@intel.com>; Cao, Gang <gang.cao@intel.com>;
> maxime.coquelin@redhat.com
> Subject: [PATCH v3 2/8] vdpa/ifc: add multi-queue support
> 
> Enable VHOST_USER_PROTOCOL_F_MQ feature.
> Expose IFCVF_MQ_OFFSET register to enable multi queue.

Multi-queue

> 
> Signed-off-by: Andy Pei <andy.pei@intel.com>
> Signed-off-by: Huang Wei <wei.huang@intel.com>
> ---
>  drivers/vdpa/ifc/base/ifcvf.c | 5 +++++
>  drivers/vdpa/ifc/base/ifcvf.h | 2 ++
>  drivers/vdpa/ifc/ifcvf_vdpa.c | 1 +
>  3 files changed, 8 insertions(+)
> 
> diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c
> index f1e1474..34c8226 100644
> --- a/drivers/vdpa/ifc/base/ifcvf.c
> +++ b/drivers/vdpa/ifc/base/ifcvf.c
> @@ -90,6 +90,11 @@
>  	if (!hw->lm_cfg)
>  		WARNINGOUT("HW support live migration not support!\n");
> 
> +	if (hw->mem_resource[4].addr)
> +		hw->mq_cfg = hw->mem_resource[4].addr + IFCVF_MQ_OFFSET;
> +	else
> +		hw->mq_cfg = NULL;
> +

It will be better to add comments about the explanation that you sent before.

Thanks,
Chenbo

>  	if (hw->common_cfg == NULL || hw->notify_base == NULL ||
>  			hw->isr == NULL || hw->dev_cfg == NULL) {
>  		DEBUGOUT("capability incomplete\n");
> diff --git a/drivers/vdpa/ifc/base/ifcvf.h b/drivers/vdpa/ifc/base/ifcvf.h
> index ef7697a..d16d9ab 100644
> --- a/drivers/vdpa/ifc/base/ifcvf.h
> +++ b/drivers/vdpa/ifc/base/ifcvf.h
> @@ -50,6 +50,7 @@
> 
>  #define IFCVF_LM_CFG_SIZE		0x40
>  #define IFCVF_LM_RING_STATE_OFFSET	0x20
> +#define IFCVF_MQ_OFFSET			0x28
> 
>  #define IFCVF_LM_LOGGING_CTRL		0x0
> 
> @@ -149,6 +150,7 @@ struct ifcvf_hw {
>  	u16    *notify_base;
>  	u16    *notify_addr[IFCVF_MAX_QUEUES * 2];
>  	u8     *lm_cfg;
> +	u8     *mq_cfg;
>  	struct vring_info vring[IFCVF_MAX_QUEUES * 2];
>  	u8 nr_vring;
>  	int device_type;
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 07cc63d..3e5ffba 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -1248,6 +1248,7 @@ struct rte_vdpa_dev_info {
>  		 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD | \
>  		 1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER | \
>  		 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD | \
> +		 1ULL << VHOST_USER_PROTOCOL_F_MQ | \
>  		 1ULL << VHOST_USER_PROTOCOL_F_STATUS)
> 
>  #define VDPA_BLK_PROTOCOL_FEATURES \
> --
> 1.8.3.1
Andy Pei Oct. 12, 2022, 7:25 a.m. UTC | #2
Hi Chenbo,

Sure. I will address in next version.

> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia@intel.com>
> Sent: Wednesday, October 12, 2022 11:02 AM
> To: Pei, Andy <andy.pei@intel.com>; dev@dpdk.org
> Cc: Xu, Rosen <rosen.xu@intel.com>; Huang, Wei <wei.huang@intel.com>;
> Cao, Gang <gang.cao@intel.com>; maxime.coquelin@redhat.com
> Subject: RE: [PATCH v3 2/8] vdpa/ifc: add multi-queue support
> 
> > -----Original Message-----
> > From: Pei, Andy <andy.pei@intel.com>
> > Sent: Friday, September 16, 2022 2:16 PM
> > To: dev@dpdk.org
> > Cc: Xia, Chenbo <chenbo.xia@intel.com>; Xu, Rosen
> > <rosen.xu@intel.com>; Huang, Wei <wei.huang@intel.com>; Cao, Gang
> > <gang.cao@intel.com>; maxime.coquelin@redhat.com
> > Subject: [PATCH v3 2/8] vdpa/ifc: add multi-queue support
> >
> > Enable VHOST_USER_PROTOCOL_F_MQ feature.
> > Expose IFCVF_MQ_OFFSET register to enable multi queue.
> 
> Multi-queue
> 
> >
> > Signed-off-by: Andy Pei <andy.pei@intel.com>
> > Signed-off-by: Huang Wei <wei.huang@intel.com>
> > ---
> >  drivers/vdpa/ifc/base/ifcvf.c | 5 +++++
> > drivers/vdpa/ifc/base/ifcvf.h | 2 ++  drivers/vdpa/ifc/ifcvf_vdpa.c |
> > 1 +
> >  3 files changed, 8 insertions(+)
> >
> > diff --git a/drivers/vdpa/ifc/base/ifcvf.c
> > b/drivers/vdpa/ifc/base/ifcvf.c index f1e1474..34c8226 100644
> > --- a/drivers/vdpa/ifc/base/ifcvf.c
> > +++ b/drivers/vdpa/ifc/base/ifcvf.c
> > @@ -90,6 +90,11 @@
> >  	if (!hw->lm_cfg)
> >  		WARNINGOUT("HW support live migration not support!\n");
> >
> > +	if (hw->mem_resource[4].addr)
> > +		hw->mq_cfg = hw->mem_resource[4].addr +
> IFCVF_MQ_OFFSET;
> > +	else
> > +		hw->mq_cfg = NULL;
> > +
> 
> It will be better to add comments about the explanation that you sent before.
> 
> Thanks,
> Chenbo
> 
> >  	if (hw->common_cfg == NULL || hw->notify_base == NULL ||
> >  			hw->isr == NULL || hw->dev_cfg == NULL) {
> >  		DEBUGOUT("capability incomplete\n"); diff --git
> > a/drivers/vdpa/ifc/base/ifcvf.h b/drivers/vdpa/ifc/base/ifcvf.h index
> > ef7697a..d16d9ab 100644
> > --- a/drivers/vdpa/ifc/base/ifcvf.h
> > +++ b/drivers/vdpa/ifc/base/ifcvf.h
> > @@ -50,6 +50,7 @@
> >
> >  #define IFCVF_LM_CFG_SIZE		0x40
> >  #define IFCVF_LM_RING_STATE_OFFSET	0x20
> > +#define IFCVF_MQ_OFFSET			0x28
> >
> >  #define IFCVF_LM_LOGGING_CTRL		0x0
> >
> > @@ -149,6 +150,7 @@ struct ifcvf_hw {
> >  	u16    *notify_base;
> >  	u16    *notify_addr[IFCVF_MAX_QUEUES * 2];
> >  	u8     *lm_cfg;
> > +	u8     *mq_cfg;
> >  	struct vring_info vring[IFCVF_MAX_QUEUES * 2];
> >  	u8 nr_vring;
> >  	int device_type;
> > diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > b/drivers/vdpa/ifc/ifcvf_vdpa.c index 07cc63d..3e5ffba 100644
> > --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> > +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> > @@ -1248,6 +1248,7 @@ struct rte_vdpa_dev_info {
> >  		 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD | \
> >  		 1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER | \
> >  		 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD | \
> > +		 1ULL << VHOST_USER_PROTOCOL_F_MQ | \
> >  		 1ULL << VHOST_USER_PROTOCOL_F_STATUS)
> >
> >  #define VDPA_BLK_PROTOCOL_FEATURES \
> > --
> > 1.8.3.1
diff mbox series

Patch

diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c
index f1e1474..34c8226 100644
--- a/drivers/vdpa/ifc/base/ifcvf.c
+++ b/drivers/vdpa/ifc/base/ifcvf.c
@@ -90,6 +90,11 @@ 
 	if (!hw->lm_cfg)
 		WARNINGOUT("HW support live migration not support!\n");
 
+	if (hw->mem_resource[4].addr)
+		hw->mq_cfg = hw->mem_resource[4].addr + IFCVF_MQ_OFFSET;
+	else
+		hw->mq_cfg = NULL;
+
 	if (hw->common_cfg == NULL || hw->notify_base == NULL ||
 			hw->isr == NULL || hw->dev_cfg == NULL) {
 		DEBUGOUT("capability incomplete\n");
diff --git a/drivers/vdpa/ifc/base/ifcvf.h b/drivers/vdpa/ifc/base/ifcvf.h
index ef7697a..d16d9ab 100644
--- a/drivers/vdpa/ifc/base/ifcvf.h
+++ b/drivers/vdpa/ifc/base/ifcvf.h
@@ -50,6 +50,7 @@ 
 
 #define IFCVF_LM_CFG_SIZE		0x40
 #define IFCVF_LM_RING_STATE_OFFSET	0x20
+#define IFCVF_MQ_OFFSET			0x28
 
 #define IFCVF_LM_LOGGING_CTRL		0x0
 
@@ -149,6 +150,7 @@  struct ifcvf_hw {
 	u16    *notify_base;
 	u16    *notify_addr[IFCVF_MAX_QUEUES * 2];
 	u8     *lm_cfg;
+	u8     *mq_cfg;
 	struct vring_info vring[IFCVF_MAX_QUEUES * 2];
 	u8 nr_vring;
 	int device_type;
diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 07cc63d..3e5ffba 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1248,6 +1248,7 @@  struct rte_vdpa_dev_info {
 		 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD | \
 		 1ULL << VHOST_USER_PROTOCOL_F_HOST_NOTIFIER | \
 		 1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD | \
+		 1ULL << VHOST_USER_PROTOCOL_F_MQ | \
 		 1ULL << VHOST_USER_PROTOCOL_F_STATUS)
 
 #define VDPA_BLK_PROTOCOL_FEATURES \