[v6,2/8] vdpa/ifc: add multi-queue support
Checks
Commit Message
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>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
drivers/vdpa/ifc/base/ifcvf.c | 9 +++++++++
drivers/vdpa/ifc/base/ifcvf.h | 2 ++
drivers/vdpa/ifc/ifcvf_vdpa.c | 1 +
3 files changed, 12 insertions(+)
@@ -90,6 +90,15 @@
if (!hw->lm_cfg)
WARNINGOUT("HW support live migration not support!\n");
+ /* For some hardware implementation, for example:
+ * the BAR 4 of PF is NULL, while BAR 4 of VF is not.
+ * This code makes sure hw->mq_cfg is a valid address.
+ */
+ 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");
@@ -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;
@@ -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 \