From: Xiao Wang Date: Mon, 15 Apr 2019 07:56:24 +0000 (+0800) Subject: net/ifc: fix mediated vring initialization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8fda27b181ff71c4deea9a2fa2c4a9ea93af2175;p=dpdk.git 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 --- 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);