X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_vhost%2Fvhost_user.c;h=6039a8fdb9cb9eaa6a47f232a631204e58d1617c;hb=35a7fe80c29446eab49ffd7e81a4f610fd1f98ce;hp=4ca872842b6ea7e5c6178fc09b1c92399a4beb33;hpb=d0fcc38f5fa41778968b6f39777a61edb3aef813;p=dpdk.git diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 4ca872842b..6039a8fdb9 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1070,6 +1070,13 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg, } if (dev->mem) { + if (dev->flags & VIRTIO_DEV_VDPA_CONFIGURED) { + struct rte_vdpa_device *vdpa_dev = dev->vdpa_dev; + + if (vdpa_dev && vdpa_dev->ops->dev_close) + vdpa_dev->ops->dev_close(dev->vid); + dev->flags &= ~VIRTIO_DEV_VDPA_CONFIGURED; + } free_mem_region(dev); rte_free(dev->mem); dev->mem = NULL; @@ -1612,6 +1619,12 @@ vhost_user_set_vring_call(struct virtio_net **pdev, struct VhostUserMsg *msg, "vring call idx:%d file:%d\n", file.index, file.fd); vq = dev->virtqueue[file.index]; + + if (vq->ready) { + vhost_user_notify_queue_state(dev, file.index, 0); + vq->ready = 0; + } + if (vq->callfd >= 0) close(vq->callfd); @@ -1870,6 +1883,11 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg, dev->vid, file.index, 1); } + if (vq->ready) { + vhost_user_notify_queue_state(dev, file.index, 0); + vq->ready = 0; + } + if (vq->kickfd >= 0) close(vq->kickfd); vq->kickfd = file.fd;