From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 85A332082 for ; Tue, 27 Feb 2018 12:22:37 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C50D717CEDA; Tue, 27 Feb 2018 11:22:36 +0000 (UTC) Received: from localhost (dhcp-192-241.str.redhat.com [10.33.192.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 233F71C724; Tue, 27 Feb 2018 11:22:30 +0000 (UTC) Date: Tue, 27 Feb 2018 12:22:29 +0100 From: Jens Freimann To: Maxime Coquelin Cc: jianfeng.tan@intel.com, stefanha@redhat.com, tiwei.bie@intel.com, dev@dpdk.org Message-ID: <20180227112229.dkt6fy6feqlbbjay@dhcp-192-241.str.redhat.com> References: <20180222181910.23134-1-maxime.coquelin@redhat.com> <20180222181910.23134-2-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180222181910.23134-2-maxime.coquelin@redhat.com> User-Agent: NeoMutt/20171215 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 27 Feb 2018 11:22:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 27 Feb 2018 11:22:36 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jfreimann@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [RFC 1/3] vhost: invalidate vring addresses in cleanup_vq() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 11:22:37 -0000 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 >--- > 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 regards, Jens