[ovs-dev] netdev-dpdk: Clean-up after vHost User port delete
diff mbox

Message ID 1445433519-13095-1-git-send-email-ciara.loftus@intel.com
State Superseded
Headers show

Commit Message

Loftus, Ciara Oct. 21, 2015, 1:18 p.m. UTC
Unregister and delete the socket associated with a vhost-user
port when the port is deleted and/or the switch is brought down.
Do not delete the socket if the vhost-user device is still attached
to the guest.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 lib/netdev-dpdk.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 93b0589..131e23d 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -749,6 +749,9 @@  netdev_dpdk_vhost_destruct(struct netdev *netdev_)
                 return;
     }
 
+    if (rte_vhost_driver_unregister(dev->vhost_id))
+        VLOG_ERR("Unable to remove vhost-user socket %s", dev->vhost_id);
+
     ovs_mutex_lock(&dpdk_mutex);
     list_remove(&dev->list_node);
     dpdk_mp_put(dev->dpdk_mp);