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

Message ID 1445435436-19581-1-git-send-email-ciara.loftus@intel.com
State Accepted
Headers show

Commit Message

Ciara Loftus Oct. 21, 2015, 1:50 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 | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Daniele Di Proietto Oct. 22, 2015, 7:49 p.m. UTC | #1
I applied this to master, thanks

On 21/10/2015 06:50, "Ciara Loftus" <ciara.loftus@intel.com> wrote:

>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 | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
>index 93b0589..f0f3cda 100644
>--- a/lib/netdev-dpdk.c
>+++ b/lib/netdev-dpdk.c
>@@ -749,6 +749,10 @@ 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);
>-- 
>1.9.3
>
>_______________________________________________
>dev mailing list
>dev@openvswitch.org
>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailma
>n_listinfo_dev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Sm
>B5nZacmXNq0gKCC1s_Cw5yUNjxgD4v5kJqZ2uWLlE&m=5dubWRleZ-YLCcyJR2a6e06vRuJP_3
>TqENxmWypNna4&s=bkVqfxE4qptVzfeLcthZIkqAvo-b2hX5RQINTWjnRbU&e=

Patch
diff mbox

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 93b0589..f0f3cda 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -749,6 +749,10 @@  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);