[dpdk-dev,v3,21/22] vhost: do not destroy device on repeat mem table message

Message ID 1490705142-893-22-git-send-email-yuanhan.liu@linux.intel.com (mailing list archive)
State Superseded, archived
Delegated to: Yuanhan Liu
Headers

Checks

Context Check Description
ci/Intel-compilation fail apply patch file failure
ci/checkpatch success coding style OK

Commit Message

Yuanhan Liu March 28, 2017, 12:45 p.m. UTC
  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 <yuanhan.liu@linux.intel.com>
---
 lib/librte_vhost/vhost_user.c | 6 ------
 1 file changed, 6 deletions(-)
  

Comments

Maxime Coquelin March 31, 2017, 9:26 a.m. UTC | #1
On 03/28/2017 02:45 PM, Yuanhan Liu wrote:
> 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 <yuanhan.liu@linux.intel.com>
> ---
>  lib/librte_vhost/vhost_user.c | 6 ------
>  1 file changed, 6 deletions(-)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  

Patch

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 40cc973..079c55e 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -496,12 +496,6 @@ 
 	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);