From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id B39F61B538; Fri, 3 Aug 2018 10:40:54 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 01:40:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,437,1526367600"; d="scan'208";a="80187510" Received: from debian.sh.intel.com ([10.67.104.162]) by orsmga002.jf.intel.com with ESMTP; 03 Aug 2018 01:39:38 -0700 Date: Fri, 3 Aug 2018 16:37:31 +0800 From: Tiwei Bie To: Maxime Coquelin Cc: zhihong.wang@intel.com, jfreimann@redhat.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20180803083731.GA46621@debian.sh.intel.com> References: <20180802172122.25923-1-maxime.coquelin@redhat.com> <20180803023014.GA28910@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH v2] vhost: flush IOTLB cache on new mem table handling 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: Fri, 03 Aug 2018 08:40:55 -0000 On Fri, Aug 03, 2018 at 09:54:21AM +0200, Maxime Coquelin wrote: > On 08/03/2018 04:30 AM, Tiwei Bie wrote: > > On Thu, Aug 02, 2018 at 07:21:22PM +0200, Maxime Coquelin wrote: [...] > >> > >> #endif /* _VHOST_IOTLB_H_ */ > >> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > >> index dc53ff712..a2d4c9ffc 100644 > >> --- a/lib/librte_vhost/vhost_user.c > >> +++ b/lib/librte_vhost/vhost_user.c > >> @@ -813,6 +813,11 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *pmsg) > >> dev->mem = NULL; > >> } > >> > >> + /* Flush IOTLB cache as previous HVAs are now invalid */ > >> + if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) > >> + for (i = 0; i < dev->nr_vring; i++) > >> + vhost_user_iotlb_flush_all(dev->virtqueue[i]); > > > > Why is the pending list also flushed? > > As it might be asynchronous, I think it is better to flush the pending > list too. > > For example, the backend request a translation just before the guest > remove the driver, the IOVA requested might not be valid anymore and > so no reply will be sent by QEMU. So the request would remain in the > pending list forever. > > I don't doing that is mandatory, but it does nor hurt IMHO. Yeah, it doesn't hurt. I was just curious about why you want to do that. :) Reviewed-by: Tiwei Bie