DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tetsuya Mukawa <mukawa@igel.co.jp>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/3] vhost: Fix RESET_OWNER handling not to free virtqueue
Date: Wed, 19 Aug 2015 18:51:09 +0900	[thread overview]
Message-ID: <1439977869-28091-3-git-send-email-mukawa@igel.co.jp> (raw)
In-Reply-To: <1439977869-28091-1-git-send-email-mukawa@igel.co.jp>

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@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

  parent reply	other threads:[~2015-08-19  9:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19  9:51 [dpdk-dev] [PATCH 1/3] vhost: Fix return value of GET_VRING_BASE message Tetsuya Mukawa
2015-08-19  9:51 ` [dpdk-dev] [PATCH 2/3] vhost: Fix RESET_OWNER handling not to close callfd Tetsuya Mukawa
2015-10-08  6:19   ` Yuanhan Liu
2015-08-19  9:51 ` Tetsuya Mukawa [this message]
2015-09-25 13:12 ` [dpdk-dev] [PATCH 1/3] vhost: Fix return value of GET_VRING_BASE message Thomas Monjalon
2015-09-28  6:38   ` Xie, Huawei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439977869-28091-3-git-send-email-mukawa@igel.co.jp \
    --to=mukawa@igel.co.jp \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).