From 27052cd63f90c516737e4c617df3874197279765 Mon Sep 17 00:00:00 2001 From: Yuanhan Liu Date: Sat, 1 Apr 2017 15:22:59 +0800 Subject: [PATCH] vhost: do not destroy device on repeat mem table message It doesn't make any sense to invoke destroy_device() callback at while handling SET_MEM_TABLE message. From the vhost-user spec, it's the GET_VRING_BASE message indicates the end of a vhost device: the destroy_device() should be invoked from there (luckily, we already did that). Signed-off-by: Yuanhan Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost_user.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 8b12ebb9c2..5c8058b62c 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -504,12 +504,6 @@ vhost_user_set_mem_table(struct virtio_net *dev, struct VhostUserMsg *pmsg) uint32_t i; int fd; - /* Remove from the data plane. */ - if (dev->flags & VIRTIO_DEV_RUNNING) { - dev->flags &= ~VIRTIO_DEV_RUNNING; - dev->notify_ops->destroy_device(dev->vid); - } - if (dev->mem) { free_mem_region(dev); rte_free(dev->mem); -- 2.20.1