[4/8] vdpa/ifc: write queue count to MQ register
Checks
Commit Message
Write queue count to IFCVF_MQ_OFFSET register
to enable multi queue feature.
Signed-off-by: Andy Pei <andy.pei@intel.com>
Signed-off-by: Huang Wei <wei_huang@intel.com>
---
drivers/vdpa/ifc/base/ifcvf.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
@@ -198,6 +198,19 @@
IFCVF_WRITE_REG32(val >> 32, hi);
}
+STATIC void
+ifcvf_enable_multiqueue(struct ifcvf_hw *hw, u16 nr_queue_pair)
+{
+ u8 *mq_cfg;
+
+ if (hw->device_type == IFCVF_NET)
+ nr_queue_pair = (nr_queue_pair + 1) / 2;
+
+ mq_cfg = hw->mq_cfg;
+ if (mq_cfg)
+ *(u32 *)mq_cfg = nr_queue_pair;
+}
+
STATIC int
ifcvf_hw_enable(struct ifcvf_hw *hw)
{
@@ -215,6 +228,7 @@
return -1;
}
+ ifcvf_enable_multiqueue(hw, hw->nr_vring);
for (i = 0; i < hw->nr_vring; i++) {
IFCVF_WRITE_REG16(i, &cfg->queue_select);
io_write64_twopart(hw->vring[i].desc, &cfg->queue_desc_lo,