DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerome Jutteau <jerome.jutteau@outscale.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 4/4] vhost: change method to get device in reset_owner
Date: Mon, 19 Oct 2015 11:44:29 +0200	[thread overview]
Message-ID: <1445247869-713-5-git-send-email-jerome.jutteau@outscale.com> (raw)
In-Reply-To: <1445247869-713-1-git-send-email-jerome.jutteau@outscale.com>

Using get_config_ll_entry in reset_owner don't show any error when the
device is not found. This patch fix this by using get_device instead
instead of get_config_ll_entry.

Signed-off-by: Jerome Jutteau <jerome.jutteau@outscale.com>
---
 lib/librte_vhost/virtio-net.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c
index ec6a575..a6ab245 100644
--- a/lib/librte_vhost/virtio-net.c
+++ b/lib/librte_vhost/virtio-net.c
@@ -398,18 +398,17 @@ set_owner(struct vhost_device_ctx ctx)
 static int
 reset_owner(struct vhost_device_ctx ctx)
 {
-	struct virtio_net_config_ll *ll_dev;
+	struct virtio_net *dev;
 	uint64_t device_fh;
 
-	ll_dev = get_config_ll_entry(ctx);
-	if (ll_dev == NULL)
+	dev = get_device(ctx);
+	if (dev == NULL)
 		return -1;
-	device_fh = ll_dev->dev.device_fh;
-
-	cleanup_device(&ll_dev->dev);
-	init_device(&ll_dev->dev);
-	ll_dev->dev.device_fh = device_fh;
 
+	device_fh = dev->device_fh;
+	cleanup_device(dev);
+	init_device(dev);
+	dev->device_fh = device_fh;
 	return 0;
 }
 
-- 
jerome

  parent reply	other threads:[~2015-10-19  9:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19  9:44 [dpdk-dev] [PATCH v2 0/4] vhost: Fix virtio-net on VHOST_USER_RESET_OWNER Jerome Jutteau
2015-10-19  9:44 ` [dpdk-dev] [PATCH v2 1/4] vhost: avoid device identifier to be reset to 0 in reset_owner Jerome Jutteau
2015-10-19  9:44 ` [dpdk-dev] [PATCH v2 2/4] vhost: check that a device exists during reset_owner Jerome Jutteau
2015-10-19  9:44 ` [dpdk-dev] [PATCH v2 3/4] vhost: protect user_get_vring_base from unknown devices Jerome Jutteau
2015-10-19  9:44 ` Jerome Jutteau [this message]
2015-10-20  8:25 ` [dpdk-dev] [PATCH v2 0/4] vhost: Fix virtio-net on VHOST_USER_RESET_OWNER Yuanhan Liu
2015-10-21 10:26   ` 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=1445247869-713-5-git-send-email-jerome.jutteau@outscale.com \
    --to=jerome.jutteau@outscale.com \
    --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).