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") Signed-off-by: Xiao Wang <xiao.w.w...@intel.com> --- 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 619cdc245..9e729ff72 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.15.1