From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C62E6A0C43; Thu, 23 Sep 2021 10:50:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A1F741225; Thu, 23 Sep 2021 10:50:28 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 91DA8410DD for ; Thu, 23 Sep 2021 10:50:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632387026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VZI6ggyCFnnQwFDAsKdy3WNilveDJLbAZuJwZaGvh8Q=; b=KygLBSixpuQK+MJfSVDt0lT/AitrweADgENIYQ48V4FsggG1YngiCgatHNE2YwxiaQ/4El IBn+T04AHiqrOnY4UtkvPVTTjsQpmQGLBzY1id+MjmgU+2mC3yytmT2X3UG7a7v1H8Hnmr S/2dFq6xd0DK3ZZmq+kPkDa+RCzgC/U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-297-wC8nKXdmOYquKCqJibVcig-1; Thu, 23 Sep 2021 04:50:24 -0400 X-MC-Unique: wC8nKXdmOYquKCqJibVcig-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 868D41084694; Thu, 23 Sep 2021 08:50:23 +0000 (UTC) Received: from [10.39.208.17] (unknown [10.39.208.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 65D236060F; Thu, 23 Sep 2021 08:50:04 +0000 (UTC) Message-ID: Date: Thu, 23 Sep 2021 10:50:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 To: "Xia, Chenbo" , =?UTF-8?Q?Eugenio_P=c3=a9rez?= Cc: "dev@dpdk.org" , Pei Zhang , Jason Wang References: <20210827161231.579968-1-eperezma@redhat.com> From: Maxime Coquelin In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] vhost: Clean iotlb cache on vring stop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 9/23/21 10:48, Xia, Chenbo wrote: > Hi Maxime, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Thursday, September 23, 2021 4:34 PM >> To: Eugenio Pérez ; Xia, Chenbo >> Cc: dev@dpdk.org; Pei Zhang ; Jason Wang >> >> 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 >>> Reported-by: Pei Zhang >>> --- >>> 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 > > So you will fix title and add fix tag when applying, right? Yes, I will. Thanks for the heads-up! Maxime > /Chenbo > >> >> Thanks, >> Maxime >