DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Long, Thomas" <thomas.long@intel.com>
To: "Xie, Huawei" <huawei.xie@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] lib/librte_vhost: remove vhost device from data plane when receive VHOST_SET_MEM_TABLE message
Date: Wed, 4 Mar 2015 11:57:44 +0000	[thread overview]
Message-ID: <EDCDDC5F3D468742B7A0048DF68542612FE3F306@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <1425349564-30489-1-git-send-email-huawei.xie@intel.com>

Acked-by: Tommy Long  <thomas.long@intel.com>


-----Original Message-----
From: Xie, Huawei 
Sent: Tuesday, March 3, 2015 2:26 AM
To: dev@dpdk.org
Cc: haifeng.lin@huawei.com; mukawa@igel.co.jp; Long, Thomas; Xie, Huawei
Subject: [PATCH] lib/librte_vhost: remove vhost device from data plane when receive VHOST_SET_MEM_TABLE message

This patch fixes the segfault issue in the case vhost receives new VHOST_SET_MEM_TABLE message without VHOST_VRING_GET_VRING_BASE(which we uses as the stop message).

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
---
 lib/librte_vhost/vhost_user/virtio-net-user.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c
index 97c5177..aa08706 100644
--- a/lib/librte_vhost/vhost_user/virtio-net-user.c
+++ b/lib/librte_vhost/vhost_user/virtio-net-user.c
@@ -109,6 +109,10 @@ user_set_mem_table(struct vhost_device_ctx ctx, struct VhostUserMsg *pmsg)
 	if (dev == NULL)
 		return -1;
 
+	/* Remove from the data plane. */
+	if (dev->flags & VIRTIO_DEV_RUNNING)
+		notify_ops->destroy_device(dev);
+
 	if (dev->mem) {
 		free_mem_region(dev);
 		free(dev->mem);
-- 
1.8.1.4

  reply	other threads:[~2015-03-04 11:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03  2:26 Huawei Xie
2015-03-04 11:57 ` Long, Thomas [this message]
2015-03-05 21:08   ` Thomas Monjalon

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=EDCDDC5F3D468742B7A0048DF68542612FE3F306@IRSMSX104.ger.corp.intel.com \
    --to=thomas.long@intel.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@intel.com \
    /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).