git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vhost: adapt library for selective datapath
[dpdk.git]
/
lib
/
librte_vhost
/
vhost.c
diff --git
a/lib/librte_vhost/vhost.c
b/lib/librte_vhost/vhost.c
index
16b0f9a
..
b1afd69
100644
(file)
--- a/
lib/librte_vhost/vhost.c
+++ b/
lib/librte_vhost/vhost.c
@@
-296,11
+296,17
@@
void
vhost_destroy_device(int vid)
{
struct virtio_net *dev = get_device(vid);
vhost_destroy_device(int vid)
{
struct virtio_net *dev = get_device(vid);
+ struct rte_vdpa_device *vdpa_dev;
+ int did = -1;
if (dev == NULL)
return;
if (dev->flags & VIRTIO_DEV_RUNNING) {
if (dev == NULL)
return;
if (dev->flags & VIRTIO_DEV_RUNNING) {
+ did = dev->vdpa_dev_id;
+ vdpa_dev = rte_vdpa_get_device(did);
+ if (vdpa_dev && vdpa_dev->ops->dev_close)
+ vdpa_dev->ops->dev_close(dev->vid);
dev->flags &= ~VIRTIO_DEV_RUNNING;
dev->notify_ops->destroy_device(vid);
}
dev->flags &= ~VIRTIO_DEV_RUNNING;
dev->notify_ops->destroy_device(vid);
}