1 Description: backport of dpdk 16.07 fix for LP: #1570466
3 Backported from this discussion
4 http://dpdk.org/dev/patchwork/patch/12103/
5 Not accepted yet, but likely to be accepted in some form once tested and
9 Moving to 16.04 this now applies as-is without modifications, dropping the
10 former backport changes.
12 Also along the discussion vserver-fh is now initialized with -1 to avoid
13 accidentially deleting the first connected port if we delete another not yet
16 Forwarded: yes (based on an upstream discussion)
17 Author: Christian Ehrhardt <christian.ehrhardt@canonical.com>
18 Last-Update: 2016-05-17
20 Index: dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c
21 ===================================================================
22 --- dpdk.orig/lib/librte_vhost/vhost_user/vhost-net-user.c
23 +++ dpdk/lib/librte_vhost/vhost_user/vhost-net-user.c
24 @@ -310,6 +310,7 @@ vserver_new_vq_conn(int fd, void *dat, _
29 size = strnlen(vserver->path, PATH_MAX);
30 vhost_set_ifname(vdev_ctx, vserver->path,
32 @@ -486,6 +487,7 @@ rte_vhost_driver_register(const char *pa
35 vserver->path = strdup(path);
38 ret = fdset_add(&g_vhost_server.fdset, vserver->listenfd,
39 vserver_new_vq_conn, NULL, vserver);
40 @@ -520,6 +522,11 @@ rte_vhost_driver_unregister(const char *
42 for (i = 0; i < g_vhost_server.vserver_cnt; i++) {
43 if (!strcmp(g_vhost_server.server[i]->path, path)) {
44 + struct vhost_device_ctx ctx;
46 + ctx.fh = g_vhost_server.server[i]->fh;
47 + vhost_destroy_device(ctx);
49 fdset_del(&g_vhost_server.fdset,
50 g_vhost_server.server[i]->listenfd);
52 Index: dpdk/lib/librte_vhost/vhost_user/vhost-net-user.h
53 ===================================================================
54 --- dpdk.orig/lib/librte_vhost/vhost_user/vhost-net-user.h
55 +++ dpdk/lib/librte_vhost/vhost_user/vhost-net-user.h
58 char *path; /**< The path the uds is bind to. */
59 int listenfd; /**< The listener sockfd. */
63 /* refer to hw/virtio/vhost-user.c */