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 DE3D0A0C41 for ; Tue, 30 Nov 2021 17:38:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D52614118F; Tue, 30 Nov 2021 17:38:38 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 0CA60410F7 for ; Tue, 30 Nov 2021 17:38:37 +0100 (CET) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id E09733FFF1 for ; Tue, 30 Nov 2021 16:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290316; bh=P53oKImhGd7YUdiKS/rXkcwAwFDoQkwL5VDdMcQxooQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=LJw5oZBd8/anAyM08NBjQdSJjqXaz2a6QcN0j2V6Y+uAEiiHRd/KVQa2lmZgmnBp4 WhQcX/xB26bfAcOI7sSVh1czrLA/nXQFeeGD5gZfIQATBYAknd6UqdTKv30MeJl67V TjW1uYAYAPsFnKsNvtQjs8BixS1q9WK0n+VlZDdc8HOr0rPfEelptAuKb759XSTuVW EkkY1j0DAGYVxro8GXMqWjG9DX+ZBEmns5Z+nmB6JNB5NgzyuGCONEuOcip8/nmPiL th6hJV32Z7fiTPfZh5xNJhh1QcFNFD57KIk+dJYCpQiSBUdmbycgvDmjhNMvw4He5C EcxvZ8sDfGwbA== Received: by mail-ed1-f70.google.com with SMTP id v10-20020aa7d9ca000000b003e7bed57968so17405010eds.23 for ; Tue, 30 Nov 2021 08:38:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P53oKImhGd7YUdiKS/rXkcwAwFDoQkwL5VDdMcQxooQ=; b=BjZVuh7FbyF/qia4N1LpVoOc3i7kDSbeuS/CMRtoee78b/Hx/XrEIbYbk6xCLK1bZL xUuBsZogPcwSo4eU91wZUh9y8Va2EPHWQJAzkkbdPSM0YKQ4oCL5/zbHQvPE0GSF71m0 MsLVjBDqmUq1dQhlqnctW3qhybpAz0FmgTcCfa0sBNaFEseEHMEg57uDXEqfCu9A66Fp XZPGiG3lHTzxszlsBd3Qaffz6STXpGG68KTnKW8oz8rJxlanr2U+eWSztCa4N6RM+UOw iMU7055u9x7jvRnKS0BVdWWIsEI7ktJxMxh1ndlgsbOTuoHFiuZbOJeaO+yuy9kIbuCz V7kA== X-Gm-Message-State: AOAM530HdvGXZB6NbxTWI6P2G3y2Tex5IqJAIakYIeAEvgeZiMbE0D+6 VKwhd0A6ybmCa5ZFup063BPDjYm/H3NDVZJLL8BTLC4MELVM2JMFgLqtecwWn1UYmVtIhxh3OAB HsqDEYngtxAIRsFQQXzSERCYB X-Received: by 2002:a05:6402:350a:: with SMTP id b10mr105597edd.184.1638290316586; Tue, 30 Nov 2021 08:38:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaW6l3/yzHaqXzGmCxkSTkgWnWxP+CAc0RG6RoSKlj8yOKs7N1RflLY2xJKvTUusp++UZ79w== X-Received: by 2002:a05:6402:350a:: with SMTP id b10mr105579edd.184.1638290316458; Tue, 30 Nov 2021 08:38:36 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id hd15sm9784708ejc.69.2021.11.30.08.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:38:35 -0800 (PST) From: christian.ehrhardt@canonical.com To: =?UTF-8?q?Eugenio=20P=C3=A9rez?= Cc: Pei Zhang , Maxime Coquelin , Chenbo Xia , dpdk stable Subject: patch 'vhost: clean IOTLB cache on vring stop' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:34:11 +0100 Message-Id: <20211130163605.2460997-47-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/70146f4f241e0af41ab12661adf35c4523ccb144 Thanks. Christian Ehrhardt --- >From 70146f4f241e0af41ab12661adf35c4523ccb144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= Date: Fri, 27 Aug 2021 18:12:31 +0200 Subject: [PATCH] vhost: clean IOTLB cache on vring stop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit e7cb7fdf5471d96edd586dd318511d8a892c41ca ] 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. Fixes: 69c90e98f483 ("vhost: enable IOMMU support") Signed-off-by: Eugenio PĂ©rez Reported-by: Pei Zhang Reviewed-by: Maxime Coquelin Reviewed-by: Chenbo Xia --- lib/librte_vhost/vhost_user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index f35b6423d7..7c16d2fc12 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1997,6 +1997,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; -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:08.800344244 +0100 +++ 0047-vhost-clean-IOTLB-cache-on-vring-stop.patch 2021-11-30 16:50:05.662872591 +0100 @@ -1 +1 @@ -From e7cb7fdf5471d96edd586dd318511d8a892c41ca Mon Sep 17 00:00:00 2001 +From 70146f4f241e0af41ab12661adf35c4523ccb144 Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit e7cb7fdf5471d96edd586dd318511d8a892c41ca ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -29 +30 @@ - lib/vhost/vhost_user.c | 2 ++ + lib/librte_vhost/vhost_user.c | 2 ++ @@ -32,5 +33,5 @@ -diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c -index 7b9f26b656..5a894ca0cc 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, +diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c +index f35b6423d7..7c16d2fc12 100644 +--- a/lib/librte_vhost/vhost_user.c ++++ b/lib/librte_vhost/vhost_user.c +@@ -1997,6 +1997,8 @@ vhost_user_get_vring_base(struct virtio_net **pdev,