> -----Original Message-----
> From: Maxime Coquelin <maxime.coque...@redhat.com>
> Sent: Thursday, September 23, 2021 4:50 PM
> To: Xia, Chenbo <chenbo....@intel.com>; Eugenio Pérez <epere...@redhat.com>
> Cc: dev@dpdk.org; Pei Zhang <pezh...@redhat.com>; Jason Wang
> <jasow...@redhat.com>
> Subject: Re: [PATCH] vhost: Clean iotlb cache on vring stop
> 
> 
> 
> On 9/23/21 10:48, Xia, Chenbo wrote:
> > Hi Maxime,
> >
> >> -----Original Message-----
> >> From: Maxime Coquelin <maxime.coque...@redhat.com>
> >> Sent: Thursday, September 23, 2021 4:34 PM
> >> To: Eugenio Pérez <epere...@redhat.com>; Xia, Chenbo <chenbo....@intel.com>
> >> Cc: dev@dpdk.org; Pei Zhang <pezh...@redhat.com>; Jason Wang
> >> <jasow...@redhat.com>
> >> Subject: Re: [PATCH] vhost: Clean iotlb cache on vring stop
> >>
> >>
> >>
> >> On 8/27/21 18:12, Eugenio Pérez wrote:
> >>> Old IOVA cache entries are left when there is a change on virtio driver
> >>> in VM. In case that all these old entries have iova addresses lesser
> >>> than new iova entries, vhost code will need to iterate all the cache to
> >>> find the new ones. In case of just a new iova entry needed for the new
> >>> translations, this condition will last forever.
> >>>
> >>> This has been observed in virtio-net to testpmd's vfio-pci driver
> >>> transition, reducing the performance from more than 10Mpps to less than
> >>> 0.07Mpps if the hugepage address was higher than the networking
> >>> buffers. Since all new buffers are contained in this new gigantic page,
> >>> vhost needs to scan IOTLB_CACHE_SIZE - 1 for each translation at worst.
> >>>
> >>> Signed-off-by: Eugenio Pérez <epere...@redhat.com>
> >>> Reported-by: Pei Zhang <pezh...@redhat.com>
> >>> ---
> >>>    lib/vhost/vhost_user.c | 2 ++
> >>>    1 file changed, 2 insertions(+)
> >>>
> >>> diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
> >>> index 29a4c9af60..7de48f5333 100644
> >>> --- a/lib/vhost/vhost_user.c
> >>> +++ b/lib/vhost/vhost_user.c
> >>> @@ -2113,6 +2113,8 @@ vhost_user_get_vring_base(struct virtio_net **pdev,
> >>>           msg->size = sizeof(msg->payload.state);
> >>>           msg->fd_num = 0;
> >>>
> >>> + vhost_user_iotlb_flush_all(vq);
> >>> +
> >>>           vring_invalidate(dev, vq);
> >>>
> >>>           return RTE_VHOST_MSG_RESULT_REPLY;
> >>>
> >>
> >> Reviewed-by: Maxime Coquelin <maxime.coque...@redhat.com>
> >
> > So you will fix title and add fix tag when applying, right?
> 
> Yes, I will. Thanks for the heads-up!

Cool! With both fixed:

Reviewed-by: Chenbo Xia <chenbo....@intel.com>

> 
> Maxime
> 
> > /Chenbo
> >
> >>
> >> Thanks,
> >> Maxime
> >

Reply via email to