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 9955C45610 for ; Fri, 12 Jul 2024 12:51:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 939DC42F04; Fri, 12 Jul 2024 12:51:25 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2070.outbound.protection.outlook.com [40.107.243.70]) by mails.dpdk.org (Postfix) with ESMTP id AE9AE40261 for ; Fri, 12 Jul 2024 12:51:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FiQKaWkHaoqVzgsk+1rQuJ1sDsCGLzEseV1GtrN2Y5L2alZ8X5hBYVWX28yq8hG3gaPKW5nBivW8GQWFxY102PnMSLs9VejyS3fMyrlDSjlgF/CZGtA26EOdY84+n5X5GBL5gdWptAMio/sTFzIfRplRATPt9OgjqEXrg+tySRPKdSBDi691S8TG2t1X2FsMaO7E+SobQHtjBqMfNxAq6t/FicWnqNJFR3kGR9OxONJKCB2rPLdXDjGPLi7mgrU735PbGs0d4Ly4uJfpWIEzCM/2SP6ClGzc9GTm86IxSZk+7DlnL9xCgr88uTZM+GapFq0mL8jyHAA6TlXOo/ci7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=CJKSeIzbi+Iqzb+/sbHv1HZagV0QBPAJe+8aE/VYE2U=; b=nWs8DOfxgszDfsc4R1GVNc8wZyww5Wv7japsJ5P66EmIoBqBbCJBRp9d8qzZR153p8LDjmrxLoiVgi7JVftMavcRxMQCM2FgPh4lqAylKp1hICx1sQaqlMDPYc68+5bfojG/50v+QI02t13A105CalwklikM/9QFZN6AhwjTIQQXHLtdCLOfT1NdotONai1A5dH/4aCVNiIKxdz19frlpRnWtIfjWZoDPyYwHTfYL4NGe8K0MVx9nL6Rk1E2fLBE7NgXShYA4zioJAX+Vk49767rNHn/phOtY7AvLF34FGT/NPftAGngOm0ZHOZFzdcWl2yj1wgepZ97n3zgGa98fA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=CJKSeIzbi+Iqzb+/sbHv1HZagV0QBPAJe+8aE/VYE2U=; b=LAA6SKAYjEPGfKmyFrBUxODM1clxvR77aYkEp1iGA0eNJQgppnB3hTtUGWwjYiiAKS6KUNXhorO72gY/juyFZegH1f6iqeVYMmmHbj/6+8BnFGP1ccemN2j4O2JHh1PREHPslxOd0WRxPv6KPemctQIiqv7c99CqXTyOYe5oFtOTb9hiUXnVvQBuQsEHm7TMaxXnwYFf9A4U4icJ9ntF4cE3Zg8VOA4Z0FOO5KzGDNYGjj95ghWGc7EEPFLmCfopDy4u6mJscAQSjhimK7pKh+MGBWBRQQOrsdTchDJhkYsf7TBJPeFAQg1ivNoZr/AU3jfx2D1u7MaJfGsRQB1HoQ== Received: from DM6PR02CA0144.namprd02.prod.outlook.com (2603:10b6:5:332::11) by PH8PR12MB6796.namprd12.prod.outlook.com (2603:10b6:510:1c7::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Fri, 12 Jul 2024 10:51:16 +0000 Received: from DS1PEPF00017098.namprd05.prod.outlook.com (2603:10b6:5:332:cafe::91) by DM6PR02CA0144.outlook.office365.com (2603:10b6:5:332::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23 via Frontend Transport; Fri, 12 Jul 2024 10:51:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS1PEPF00017098.mail.protection.outlook.com (10.167.18.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Fri, 12 Jul 2024 10:51:15 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 12 Jul 2024 03:51:01 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 12 Jul 2024 03:50:59 -0700 From: Xueming Li To: Maxime Coquelin CC: David Marchand , dpdk stable Subject: patch 'net/virtio-user: fix control queue destruction' has been queued to stable release 23.11.2 Date: Fri, 12 Jul 2024 18:44:39 +0800 Message-ID: <20240712104528.308638-54-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240712104528.308638-1-xuemingl@nvidia.com> References: <20240712104528.308638-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017098:EE_|PH8PR12MB6796:EE_ X-MS-Office365-Filtering-Correlation-Id: 04c50c40-8ce0-4f56-a4e2-08dca2608dc8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?azjxeoMFK6KElT1mp9EzQ6XZWSTy2tc79RMGPnp6GEzi/DSe/YdsJU9XEzav?= =?us-ascii?Q?uZSaqMIsq+YrO7pGX8DE+xaV6x7bOhakAfGkI3ho5OPnNdBuyNPapYsViBLw?= =?us-ascii?Q?mWsuxyKowHFvjfUftj5jVDlYfTr2dGixStpTvBlSVqpDAr9HM5HGEjkQZNeF?= =?us-ascii?Q?LKmOMgYli3ax/13uLsTLw/4PVWeH5LUQMxXm5gt4V4fQDuOJyLPwy+30xYS4?= =?us-ascii?Q?07VjtcIVSYd/IERwKU5ZIWDQaW+H9BOl3MzraPIHJFNqoRfTNPU9aGgJLzXR?= =?us-ascii?Q?veRvnYc5hZCVx3RE25SEJ6Ya1e+n4OkQpEzrAybx+Fyf9B/klOLpgT7bEItd?= =?us-ascii?Q?PKSbFLrIhnuFWRrokPu3J67E+nqpvKAOAS9U9H209MMAyA4ApkbkKTNeX59k?= =?us-ascii?Q?IxRw3vDrW5nRQq/fFqLjX+KDAT3y/Xl5v8YNFvRtUgxlqgsbCM0LBQoeHABY?= =?us-ascii?Q?g/b9PtdFSGcVU/wHfXrRc4jR/JM9cMlt1iIXm+/h7unjc1f3nKl8A5TBbCpt?= =?us-ascii?Q?xLYRV2UqxQncKT+H+V0rf/9yWoozYtJp/MI0xWPe5Ud7O6I/XvKjnvOcOIIn?= =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efront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 10:51:15.7346 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04c50c40-8ce0-4f56-a4e2-08dca2608dc8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017098.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6796 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 23.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9f5bb6deb44b1f930706cae2af544fa05a2fe7d3 Thanks. Xueming Li --- >From 9f5bb6deb44b1f930706cae2af544fa05a2fe7d3 Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Thu, 28 Mar 2024 14:08:11 +0100 Subject: [PATCH] net/virtio-user: fix control queue destruction Cc: Xueming Li [ upstream commit bffcdad5ecaf1e1030271357cd9871f87857b1e4 ] This patch uses the freshly renamed iterator to destroy queues at stop time. Doing this, we fix the missing control queue destruction. Fixes: 90966e8e5b67 ("net/virtio-user: send shadow virtqueue info to the backend") Signed-off-by: Maxime Coquelin Acked-by: David Marchand --- .../net/virtio/virtio_user/virtio_user_dev.c | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 4fd89a8e97..ce9e73493d 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -32,6 +32,22 @@ const char * const virtio_user_backend_strings[] = { [VIRTIO_USER_BACKEND_VHOST_VDPA] = "VHOST_VDPA", }; +static int +virtio_user_destroy_queue(struct virtio_user_dev *dev, uint32_t queue_sel) +{ + struct vhost_vring_state state; + int ret; + + state.index = queue_sel; + ret = dev->ops->get_vring_base(dev, &state); + if (ret < 0) { + PMD_DRV_LOG(ERR, "(%s) Failed to destroy queue %u", dev->path, queue_sel); + return -1; + } + + return 0; +} + static int virtio_user_create_queue(struct virtio_user_dev *dev, uint32_t queue_sel) { @@ -127,6 +143,22 @@ err: return -1; } +static int +virtio_user_foreach_queue(struct virtio_user_dev *dev, int (*fn)(struct virtio_user_dev *, uint32_t)) +{ + uint32_t i, nr_vq; + + nr_vq = dev->max_queue_pairs * 2; + if (dev->hw_cvq) + nr_vq++; + + for (i = 0; i < nr_vq; i++) + if (fn(dev, i) < 0) + return -1; + + return 0; +} + static int virtio_user_queue_setup(struct virtio_user_dev *dev, int (*fn)(struct virtio_user_dev *, uint32_t)) @@ -239,7 +271,6 @@ error: int virtio_user_stop_device(struct virtio_user_dev *dev) { - struct vhost_vring_state state; uint32_t i; int ret; @@ -260,14 +291,8 @@ int virtio_user_stop_device(struct virtio_user_dev *dev) } /* Stop the backend. */ - for (i = 0; i < dev->max_queue_pairs * 2; ++i) { - state.index = i; - ret = dev->ops->get_vring_base(dev, &state); - if (ret < 0) { - PMD_DRV_LOG(ERR, "(%s) get_vring_base failed, index=%u", dev->path, i); - goto err; - } - } + if (virtio_user_foreach_queue(dev, virtio_user_destroy_queue) < 0) + goto err; dev->started = false; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-12 18:40:16.623225225 +0800 +++ 0053-net-virtio-user-fix-control-queue-destruction.patch 2024-07-12 18:40:14.096594228 +0800 @@ -1 +1 @@ -From bffcdad5ecaf1e1030271357cd9871f87857b1e4 Mon Sep 17 00:00:00 2001 +From 9f5bb6deb44b1f930706cae2af544fa05a2fe7d3 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit bffcdad5ecaf1e1030271357cd9871f87857b1e4 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -16,2 +18,2 @@ - .../net/virtio/virtio_user/virtio_user_dev.c | 27 ++++++++++++------- - 1 file changed, 18 insertions(+), 9 deletions(-) + .../net/virtio/virtio_user/virtio_user_dev.c | 43 +++++++++++++++---- + 1 file changed, 34 insertions(+), 9 deletions(-) @@ -20 +22 @@ -index 5e998750ae..07f45984fe 100644 +index 4fd89a8e97..ce9e73493d 100644 @@ -23 +25 @@ -@@ -33,6 +33,22 @@ const char * const virtio_user_backend_strings[] = { +@@ -32,6 +32,22 @@ const char * const virtio_user_backend_strings[] = { @@ -46 +48,24 @@ -@@ -237,7 +253,6 @@ error: +@@ -127,6 +143,22 @@ err: + return -1; + } + ++static int ++virtio_user_foreach_queue(struct virtio_user_dev *dev, int (*fn)(struct virtio_user_dev *, uint32_t)) ++{ ++ uint32_t i, nr_vq; ++ ++ nr_vq = dev->max_queue_pairs * 2; ++ if (dev->hw_cvq) ++ nr_vq++; ++ ++ for (i = 0; i < nr_vq; i++) ++ if (fn(dev, i) < 0) ++ return -1; ++ ++ return 0; ++} ++ + static int + virtio_user_queue_setup(struct virtio_user_dev *dev, + int (*fn)(struct virtio_user_dev *, uint32_t)) +@@ -239,7 +271,6 @@ error: @@ -54 +79 @@ -@@ -258,14 +273,8 @@ int virtio_user_stop_device(struct virtio_user_dev *dev) +@@ -260,14 +291,8 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)