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 D9373A034F for ; Wed, 10 Nov 2021 07:42:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CDE934014D; Wed, 10 Nov 2021 07:42:10 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2082.outbound.protection.outlook.com [40.107.92.82]) by mails.dpdk.org (Postfix) with ESMTP id EFD37410F2 for ; Wed, 10 Nov 2021 07:42:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eIVA9OCcW8tBTjCghwkuF/XlzsX9nWQ8welvp8Lu+YLi9rv772xy5RvREWhk2F9rvHUZRAKzd+5yjVbvXIARNND48lO5fczMHlp1N1uhYkbrcyYXxlWtaT/UQm0mslnnXxgUuKF6GeZ1z7g36eI/MZqmEhL/wym/NplR8TWhXAKntKVwMvruzefjT6GLygwkC6dRKPykHaMAr6RkIq84/ozIksg++vmVeNWhVP+iBVIJBE7qPzZi0vRa+bnAaMUB8RpDQn/X3h4nMTfN14xHnuLdTXQeXVCJOa3/EZsAFmvWKLQLrxmYYa2iGxqKDox2irsMtOKEQEnca+WeotBqpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M6CvET0fROPGmQ/r6mqnklWl07LfkVNR0p1iSpOF/UU=; b=T1twDPAURHFWd6Oo5411pMTw38n9tT8UlVAf2o1TTl2Gxl5IUD47t7WfXl07dBIgWg6A4z9LNQYBQZOEcgIBXZgqaW2RBHTYUi0oJbDeG43o6/dxQSAZFC8CeHl3kWxdOu/PW9bUJVNX6D7Nc6/hTTHX+HkehjN1xo+/6mvAnmhGGbFcwc7UEb/65Mx6zoG+zf5aYViJSwcy5Vux5gSTlbZcKdtr+TWW3+eFN1JUCaXSjBZm67ILNtY88Cfoj7IBxL24T+dRXDiaMGRJcTL7HmzqM4kRHGaGghZz4g85bvVE15QsZWsfh2ChrMzBRqEK27JQhjZnspmRfBNCihGR4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M6CvET0fROPGmQ/r6mqnklWl07LfkVNR0p1iSpOF/UU=; b=ljna+w/9Lz6YfTMMGDt7WrIZ83GP+Knei39RjPRZPVBGGhbEL4bsoUP56EGKm2eK7MQdlyyqDcAAv/SzAgIzLMvTAFKCrVM8FigkA/dPKS2z7G6B73qV5crT8IEuXiliEYaonfQle9+YmYLJwHXAETavB2aNpiW2aRyhteTSiknCM+g715GSk/9rs4O52Lja6XZLkmzRnYdEk71+EMOtRqyAKKv9tDzhpls/qYEm8YSKtbRNxAuB8haIHMJ1Xi614GBgwXBFy55RnVEKQBoiB21m/8RsEQsGVIZH4E4DHB5ZcMiuywBXH3zO4fnU2Ow+ctNpQOctXSlgr4Xz/XXaBQ== Received: from DS7PR03CA0015.namprd03.prod.outlook.com (2603:10b6:5:3b8::20) by DM6PR12MB3977.namprd12.prod.outlook.com (2603:10b6:5:1ce::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:42:07 +0000 Received: from DM6NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::9b) by DS7PR03CA0015.outlook.office365.com (2603:10b6:5:3b8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:42:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT032.mail.protection.outlook.com (10.13.173.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:42:07 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:42:03 +0000 From: Xueming Li To: =?UTF-8?q?Eugenio=20P=C3=A9rez?= CC: Luca Boccassi , Pei Zhang , Maxime Coquelin , Chenbo Xia , dpdk stable Date: Wed, 10 Nov 2021 14:29:32 +0800 Message-ID: <20211110063216.2744012-89-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c7a45d0a-05e1-4c12-0bb1-08d9a4153701 X-MS-TrafficTypeDiagnostic: DM6PR12MB3977: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vRH4QYalYqEKzS+fuFtLimXVvnNTv6ctuMsGNWCndbSpgvsyU0d8qmXFJUjtfKnTdd49NIy5OL2Gya1gdzAA2yfGXwtlcYwrf5DLpx11wYen1bTJL3682mRKKgdmPuMCgFG6FoN5Z6TYG+XpTmoxQgsUvtA2wlBlqy1PlWbktFQh2TLeR7AhRpECq3aVwwllHtaAJjcevAIwKM6AOeJ3KNZhVL7A5R/6Y9U5SJ/5dD9iLe1Nrr/Y3PAyu/QPkxuVjkJG7Wd2NlgYvSLTZ2XORPiYrVSX7uWUSjLsmu0OreIgH7YD9gfHLcvzzWh6qqUQ3Erp6vPzeIFgC2jlVqt33LQnV2T/oXh6MnC1rN/LK1GUYKH8ueq8iu50/Yg0CtMhevtMjZ6VKvlTzOt2+OS1QvyR34sx1xivQBBo1XtNh+jcXK9lt+iVvvmFzTPYCmy5J7Bo5V40VptH4VYSh+U08Rx2APgTwQyPz4u/9wfgczXa6IL0I9T7e7FBTbD/BEtsaJmA6xIN0rC6XnhM439EgJW0lPklJIiQIle5D4yPXJhEdWXw0RVhg9zPGO+D6vbgcxarSJjvx4FCAjLkKa0MTv9Pc+pNrFekan0TRN8rgXxEuI+YG2kIuEju8s71+93B+U+O/bog6liFFFIX+L5kNYJEf7aKsfqCLniCYL6O86Q+iI1m2vLtrUZik4OTdtxGbdtGSNgXvBo25CW+yD0DTCnnf+UiuwhvEeqsBS4xXEOGfHqJvAp/afxJ3FQcphsic5i2Xk4PAjsih3422USIpe1Bf0GFd54/+AH7IRZyXsCc9tbcnUJi0a7va1Y1OZtfAJKkJW41Gp2FAPYI8zDk4Q== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(2616005)(16526019)(186003)(7696005)(508600001)(6286002)(83380400001)(426003)(36756003)(70586007)(336012)(4001150100001)(8936002)(4326008)(1076003)(70206006)(966005)(26005)(316002)(2906002)(86362001)(47076005)(66574015)(5660300002)(7636003)(356005)(54906003)(6916009)(36860700001)(53546011)(55016002)(82310400003)(6666004)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:42:07.2600 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7a45d0a-05e1-4c12-0bb1-08d9a4153701 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3977 Subject: [dpdk-stable] patch 'vhost: clean IOTLB cache on vring stop' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/9786a89ed40dbbbdc5a2162a57b5a3937dc43fae Thanks. Xueming Li --- >From 9786a89ed40dbbbdc5a2162a57b5a3937dc43fae 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 Cc: Xueming Li [ 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 8a2a3e9ab5..843bfbbfd9 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2012,6 +2012,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.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:05.949770386 +0800 +++ 0088-vhost-clean-IOTLB-cache-on-vring-stop.patch 2021-11-10 14:17:01.847412948 +0800 @@ -1 +1 @@ -From e7cb7fdf5471d96edd586dd318511d8a892c41ca Mon Sep 17 00:00:00 2001 +From 9786a89ed40dbbbdc5a2162a57b5a3937dc43fae Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit e7cb7fdf5471d96edd586dd318511d8a892c41ca ] @@ -22 +24,0 @@ -Cc: stable@dpdk.org @@ -29 +31 @@ - lib/vhost/vhost_user.c | 2 ++ + lib/librte_vhost/vhost_user.c | 2 ++ @@ -32,5 +34,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 8a2a3e9ab5..843bfbbfd9 100644 +--- a/lib/librte_vhost/vhost_user.c ++++ b/lib/librte_vhost/vhost_user.c +@@ -2012,6 +2012,8 @@ vhost_user_get_vring_base(struct virtio_net **pdev,