From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 69B651B5CE; Sun, 5 Aug 2018 01:49:26 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C8D9F21F24; Sat, 4 Aug 2018 19:49:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 04 Aug 2018 19:49:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=FhH37c0UDOOU/BPyn7jOO+bGO2 cCIU3G4rDnzpNbtGQ=; b=SwHTpWA+g56XUkVOHr4pz42ARorFCre6yZQzZS0EIm nEVQLvWTQd4kO9080ZHqHv6dGx9qHyMTmXr22G2V8GgJ9sis8fL1e3q7qNQB5C9+ A3xNlD/nt/q63qg2x9PE/a3eC+M7QFv66XThNkAh0DXKx5gYj17L+sSNm/7ESmxN k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=FhH37c 0UDOOU/BPyn7jOO+bGO2cCIU3G4rDnzpNbtGQ=; b=HOjBV/gaUsdLWIcWWveWUh J19MESc7XwRAubB9Rjg2FbomldXh8r9tYL57zsHeEjm7E+BKcUBsboCobc+/5j6Q w9XBknKlE8dJcctou8FRzhA6aLih1+Ywt47mgH6G3Ef8qbXs/dHkFu7g6//Qv1IK r3WmO4AL3XtPjTV7N4FWJ2sSlKVTir+tHKOfs8VH1xDFEcaQUFRLM5WaeDW56Q0+ dGrJjZS1N91s+pi0v+cDPprjYZ7L0eBEkqXnK6lI/BIdyTS036XfUwiLxOukmoT6 DgX+wQLmB+MpbTklBJplPOoST/TwxwWpv8n6DOzMf/mPV95RHeQAl3VSsKtkJkYw == X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (247.15.136.77.rev.sfr.net [77.136.15.247]) by mail.messagingengine.com (Postfix) with ESMTPA id 93AFC10276; Sat, 4 Aug 2018 19:49:23 -0400 (EDT) From: Thomas Monjalon To: Maxime Coquelin Cc: dev@dpdk.org, Tiwei Bie , zhihong.wang@intel.com, jfreimann@redhat.com, stable@dpdk.org Date: Sun, 05 Aug 2018 01:49:16 +0200 Message-ID: <10745847.ZKOuvd1ovp@xps> In-Reply-To: <20180803083731.GA46621@debian.sh.intel.com> References: <20180802172122.25923-1-maxime.coquelin@redhat.com> <20180803083731.GA46621@debian.sh.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Sat, 04 Aug 2018 23:49:26 -0000 03/08/2018 10:37, Tiwei Bie: > 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 Applied, thanks