DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jens Freimann <jfreimann@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: jianfeng.tan@intel.com, stefanha@redhat.com, tiwei.bie@intel.com,
	dev@dpdk.org
Subject: Re: [dpdk-dev] [RFC 1/3] vhost: invalidate vring addresses in cleanup_vq()
Date: Tue, 27 Feb 2018 12:22:29 +0100	[thread overview]
Message-ID: <20180227112229.dkt6fy6feqlbbjay@dhcp-192-241.str.redhat.com> (raw)
In-Reply-To: <20180222181910.23134-2-maxime.coquelin@redhat.com>

On Thu, Feb 22, 2018 at 07:19:08PM +0100, Maxime Coquelin wrote:
>When cleaning-up the virtqueue, we also need to invalidate its
>addresses to be sure outdated addresses won't be used later.
>
>Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>---
> lib/librte_vhost/vhost.c      | 6 ++++--
> lib/librte_vhost/vhost.h      | 4 +++-
> lib/librte_vhost/vhost_user.c | 2 +-
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
>diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
>index f6f12a03b..e4281cf67 100644
>--- a/lib/librte_vhost/vhost.c
>+++ b/lib/librte_vhost/vhost.c
>@@ -69,12 +69,14 @@ __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,
> }
>
> void
>-cleanup_vq(struct vhost_virtqueue *vq, int destroy)
>+cleanup_vq(struct virtio_net *dev, struct vhost_virtqueue *vq, int destroy)
> {
> 	if ((vq->callfd >= 0) && (destroy != 0))
> 		close(vq->callfd);
> 	if (vq->kickfd >= 0)
> 		close(vq->kickfd);
>+
>+	vring_invalidate(dev, vq);
> }
>
> /*
>@@ -89,7 +91,7 @@ cleanup_device(struct virtio_net *dev, int destroy)
> 	vhost_backend_cleanup(dev);
>
> 	for (i = 0; i < dev->nr_vring; i++)
>-		cleanup_vq(dev->virtqueue[i], destroy);
>+		cleanup_vq(dev, dev->virtqueue[i], destroy);
> }
>
> void
>diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
>index 58aec2e0d..4ebf84bec 100644
>--- a/lib/librte_vhost/vhost.h
>+++ b/lib/librte_vhost/vhost.h
>@@ -241,6 +241,7 @@ struct virtio_net {
> 	struct guest_page       *guest_pages;
>
> 	int			slave_req_fd;
>+	uint8_t		virtio_status;

Belongs into other patch?

Apart from that 
Reviewed-by: Jens Freimann <jfreimann@redhat.com> 

regards,
Jens 

  reply	other threads:[~2018-02-27 11:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 18:19 [dpdk-dev] [RFC 0/3] vhost: multiqueue improvements Maxime Coquelin
2018-02-22 18:19 ` [dpdk-dev] [RFC 1/3] vhost: invalidate vring addresses in cleanup_vq() Maxime Coquelin
2018-02-27 11:22   ` Jens Freimann [this message]
2018-02-27 11:44     ` Maxime Coquelin
2018-02-27 11:54       ` Jens Freimann
2018-02-22 18:19 ` [dpdk-dev] [RFC 2/3] vhost: add SET_VIRTIO_STATUS support Maxime Coquelin
2018-02-27 13:10   ` Jens Freimann
2018-02-27 14:04     ` Maxime Coquelin
2018-02-22 18:19 ` [dpdk-dev] [RFC 3/3] vhost_user: work around invalid rings addresses sent by QEMU Maxime Coquelin

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=20180227112229.dkt6fy6feqlbbjay@dhcp-192-241.str.redhat.com \
    --to=jfreimann@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=tiwei.bie@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).