From 8fda27b181ff71c4deea9a2fa2c4a9ea93af2175 Mon Sep 17 00:00:00 2001 From: Xiao Wang Date: Mon, 15 Apr 2019 15:56:24 +0800 Subject: [PATCH] net/ifc: fix mediated vring initialization The mediated vring's index should be set as initial value before enabling HW datapath. Fixes: 4bb531e152d3 ("net/ifc: support SW assisted VDPA live migration") Cc: stable@dpdk.org Signed-off-by: Xiao Wang --- drivers/net/ifc/ifcvf_vdpa.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c index 619cdc245c..9e729ff723 100644 --- a/drivers/net/ifc/ifcvf_vdpa.c +++ b/drivers/net/ifc/ifcvf_vdpa.c @@ -631,6 +631,10 @@ m_ifcvf_start(struct ifcvf_internal *internal) hw->vring[i].size = vq.size; + rte_vhost_get_vring_base(vid, i, + &internal->m_vring[i].avail->idx, + &internal->m_vring[i].used->idx); + rte_vhost_get_vring_base(vid, i, &hw->vring[i].last_avail_idx, &hw->vring[i].last_used_idx); @@ -702,11 +706,6 @@ vring_relay(void *arg) vid = internal->vid; q_num = rte_vhost_get_vring_num(vid); - /* prepare the mediated vring */ - for (qid = 0; qid < q_num; qid++) - rte_vhost_get_vring_base(vid, qid, - &internal->m_vring[qid].avail->idx, - &internal->m_vring[qid].used->idx); /* add notify fd and interrupt fd to epoll */ epfd = epoll_create(IFCVF_MAX_QUEUES * 2); -- 2.20.1