patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Tiwei Bie <tiwei.bie@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: zhihong.wang@intel.com, jfreimann@redhat.com, dev@dpdk.org,
	stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH v2] vhost: flush IOTLB cache on new mem table handling
Date: Fri, 3 Aug 2018 16:37:31 +0800	[thread overview]
Message-ID: <20180803083731.GA46621@debian.sh.intel.com> (raw)
In-Reply-To: <eca9a6ff-6119-b17b-c993-0fe2d5da5168@redhat.com>

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 <tiwei.bie@intel.com>

  reply	other threads:[~2018-08-03  8:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02 17:21 Maxime Coquelin
2018-08-03  2:30 ` Tiwei Bie
2018-08-03  7:54   ` Maxime Coquelin
2018-08-03  8:37     ` Tiwei Bie [this message]
2018-08-04 23:49       ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2018-08-03 11:27 ` [dpdk-stable] " Jens Freimann

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=20180803083731.GA46621@debian.sh.intel.com \
    --to=tiwei.bie@intel.com \
    --cc=dev@dpdk.org \
    --cc=jfreimann@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=zhihong.wang@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).