[dpdk-dev] [PATCH 3/3] vhost: Fix RESET_OWNER handling not to free virtqueue

Tetsuya Mukawa mukawa at igel.co.jp
Wed Aug 19 11:51:09 CEST 2015


When RESET_OWNER message is issued, vhost backend should not clear and
free virtqueue memories. This is because vhost backend should handle
GET_VRING_BASE message followed by the RESET_OWNER, so still vhost
backend need to access virtqueue memories.
These memories should be freed when SET_MEM_TABLE message is issued,
and vhost library has already had such a functionality.

Signed-off-by: Tetsuya Mukawa <mukawa at igel.co.jp>
---
 lib/librte_vhost/virtio-net.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c
index 7794e8b..9475d00 100644
--- a/lib/librte_vhost/virtio-net.c
+++ b/lib/librte_vhost/virtio-net.c
@@ -182,13 +182,6 @@ add_config_ll_entry(struct virtio_net_config_ll *new_ll_dev)
 static void
 cleanup_device(struct virtio_net *dev)
 {
-	/* Unmap QEMU memory file if mapped. */
-	if (dev->mem) {
-		munmap((void *)(uintptr_t)dev->mem->mapped_address,
-			(size_t)dev->mem->mapped_size);
-		free(dev->mem);
-	}
-
 	/* Close kickfd event notifiers opened by device. */
 	if ((int)dev->virtqueue[VIRTIO_RXQ]->kickfd >= 0)
 		close((int)dev->virtqueue[VIRTIO_RXQ]->kickfd);
-- 
2.1.4



More information about the dev mailing list