[ovs-dev] [CudaMailTagged] [PATCH] netdev-dpdk: unlink socket file when constructing vhostuser.

Binbin Xu xu.binbin1 at zte.com.cn
Thu Aug 4 20:01:38 UTC 2016


Work with DPDK 16.07, a UNIX socket will be created when we
add vhostuser port. After that, the restarting of ovs-vswitchd
leads to the failure of socket binding, so the vhostuser port
can't be created successfully.

This commit unlink socket file before creating UNIX socket to
avoid failure of socket binding.

Signed-off-by: Binbin Xu <xu.binbin1 at zte.com.cn>
---
 lib/netdev-dpdk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 lib/netdev-dpdk.c

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
old mode 100644
new mode 100755
index aaac0d1..95cf7c3
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -885,7 +885,10 @@ netdev_dpdk_vhost_user_construct(struct netdev *netdev)
      */
     snprintf(dev->vhost_id, sizeof(dev->vhost_id), "%s/%s",
              vhost_sock_dir, name);
-
+    
+    if (!(flags & RTE_VHOST_USER_CLIENT)) {
+        unlink(dev->vhost_id);
+    }
     err = rte_vhost_driver_register(dev->vhost_id, flags);
     if (err) {
         VLOG_ERR("vhost-user socket device setup failure for socket %s\n",
-- 
1.8.3.1




More information about the dev mailing list