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 91F80457A1 for ; Mon, 12 Aug 2024 14:52:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D2AB40669; Mon, 12 Aug 2024 14:52:49 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2074.outbound.protection.outlook.com [40.107.223.74]) by mails.dpdk.org (Postfix) with ESMTP id F3F8C4029C for ; Mon, 12 Aug 2024 14:52:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cry8DNH3BBqgJeWHYgLH1uH0VWfKmiq9oIw+G94Eo/OML1PuWOhgDIxL5enxVQY1XGw5drsWhPRlfnxtK+PmtPe49T63eQCgp6PKLgKBdhwNdMj+75jURNnRv2afT6MjOarGXgJqu3gjTcntwiluRBgBSNSMi//IuYMMOeDRPmS1glMTpecH42J0LbFb8n7+wy9QdV+PEQiJLZi15H2PeMr3cTvJSaB4ZFvLY/Da9rH8Zr24eOka7XOptMb/fG35aZ9HcBd6dNyWfq3VLWUETKxZqQYKZrMAbeBx8ohWboFZjn4oCIgxXYH68PuZDMutXU2IQ36h/jdG9lq0Hvk6/g== 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=aTIJJlfT6GZAMAVrmSHDWkLyxDjWRy049REA9PXJoco=; b=V+zx0pFKiut8vP9e1ShWYzcSeRAJD9X8Tqu5+HESuSmRANXhltEcx9OLFR8Hh3iMGOaHyedqwASculPVIy/HZar2+zjBpIAOY553rQLGL22vf/fxESXfbZpCFNZOhuWDDl+7x+mzufSfTyKzraoikWQ/qfu6DGoaQmBFoBE9+PdPfAF762La36+Ip1fw8/+Qk7Cd/F2qHP3pgwdh4mUjtS3/1edSaMFcdZIyUGsKN/WBhqOL5QGmwAcO1BjucdoA4T/OxXRZlQNzdr/0/AZbSKBEVyeVmr8Ho3KrXg7VOHR4tCYGisUFMFroukGIOvS3ypV0wZRDfk16bZFm0Co2LA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=aTIJJlfT6GZAMAVrmSHDWkLyxDjWRy049REA9PXJoco=; b=FC1RK/juYokXc/5HUJeEZprtGBkjtyC5RiEGcinEyq5JYgPG5HXYAA7XJBnRvBKT1sz78FewcElmg/dmpbKyTJ/+TYfMNtTofBvewMsDS3YPZBq2KBIZkS+s60Orb54c8NCwZQLuGflpx9gRh2/Wk6J8lnxqhxxMXNDpWLs22QxEEzPVr3grx8R8g/DmCud+3jXJpJRFzyPudh1bP/7IzYAyQizd5TDvW1e7LG0CoLbMNSqJqIFiu0rP8UUSlHkqYvXDzP+Fl87M5ukDAFMCTtPt2UsIIoLJQ0LmMRR4k57vIsxJMhaja7rTwZhsIu3HIuQ8qnIT5ggs6ggu0eVSqQ== Received: from DM5PR07CA0088.namprd07.prod.outlook.com (2603:10b6:4:ae::17) by PH7PR12MB6465.namprd12.prod.outlook.com (2603:10b6:510:1f7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Mon, 12 Aug 2024 12:52:40 +0000 Received: from DS1PEPF0001708E.namprd03.prod.outlook.com (2603:10b6:4:ae:cafe::ba) by DM5PR07CA0088.outlook.office365.com (2603:10b6:4:ae::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20 via Frontend Transport; Mon, 12 Aug 2024 12:52:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DS1PEPF0001708E.mail.protection.outlook.com (10.167.17.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Mon, 12 Aug 2024 12:52:39 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 12 Aug 2024 05:52:26 -0700 Received: from nvidia.com (10.126.230.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; Mon, 12 Aug 2024 05:52:24 -0700 From: Xueming Li To: Maxime Coquelin CC: , David Marchand , "dpdk stable" Subject: patch 'net/virtio-user: fix control queue allocation for non-vDPA' has been queued to stable release 23.11.2 Date: Mon, 12 Aug 2024 20:48:12 +0800 Message-ID: <20240812125035.389667-16-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240812125035.389667-1-xuemingl@nvidia.com> References: <20240712110153.309690-23-xuemingl@nvidia.com> <20240812125035.389667-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001708E:EE_|PH7PR12MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: c09cc115-50aa-4db3-beba-08dcbacda5ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?bTDQqJKzQ0bcf3aBt6r+CFSE24/O3NwdKzKTVsy94QYNnjRLinRh/DuekwaC?= =?us-ascii?Q?SWnYBcE942rsctAFnLqxm6YzSQpK2XEL2bsIawz2OjN2PMuX+EEO9+9Askl3?= =?us-ascii?Q?tKfru6tYWAsJSXTECF5irkbzP/dDEgTayFFnDXdC6LQ9jFeMdhH+lSrjr7Va?= =?us-ascii?Q?oqU3+/qvjHyakE2a50ZOzPKpZu42Bkc8fEylO0a0ZIuObB3yeSPeAGtme+xc?= =?us-ascii?Q?dSXeSwlBlk+I/ouPznDt+9zB6vLAD2Et3DyULeiYdaKeRdUKtn1L82x1GYXo?= =?us-ascii?Q?a+UcrTF/IcrlQYTiek2KLH4GCg3qXTo+H31Y81Rs0QmcKJjv6wvcwlxSPWAH?= =?us-ascii?Q?wJgiog4MHtVeQsjuhJR8nvbvpEHNZ8xgq5LjOJ/w1fdM+5XTcaqRTg/YfmhJ?= =?us-ascii?Q?RZQ4zxGL0BOLa31MIdN9rxE7tC28g6onYxN8uaLbMSF8cvk0cfIvMz47d59X?= =?us-ascii?Q?uJAh2qrvWFbuWXpNk1m3I0a0VDxYP4Y5G1adeMeqvfpZZWi7NsfeQg8ytdPU?= =?us-ascii?Q?/djLXbfGfdN+G4c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y6HK?= =?us-ascii?Q?vNEbNubRehwQQxfSwIH2T0ixdRQaeg/4?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 12:52:39.4268 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c09cc115-50aa-4db3-beba-08dcbacda5ff 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001708E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6465 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 08/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=ea90bc49fc49710b0a1eea6f7abd237d677f134b Thanks. Xueming Li --- >From ea90bc49fc49710b0a1eea6f7abd237d677f134b Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Wed, 3 Jul 2024 17:59:29 +0200 Subject: [PATCH] net/virtio-user: fix control queue allocation for non-vDPA Cc: Xueming Li [ upstream commit 8b04c3e52344bebf31858066204712d73fd86a75 ] For non-vDPA backends, where the backend does not support control queue, it is still emulated in the Virtio-user layer to handle multiqueue feature. The frontend setups a control queue, which is hidden to the device. It means the number of vrings metadata to allocate should be based on the frontend features and not the device features. This patch fixes out-of-range access reported by ASan, which could sometimes be noticed at exit time by a segmentation fault when disabled: Fixes: b80947743f5e ("net/virtio-user: fix control queue allocation") Reported-by: David Marchand Signed-off-by: Maxime Coquelin Reviewed-by: David Marchand --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 209435a865..1bfd6aba80 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -609,7 +609,7 @@ virtio_user_alloc_vrings(struct virtio_user_dev *dev) bool packed_ring = !!(dev->device_features & (1ull << VIRTIO_F_RING_PACKED)); nr_vrings = dev->max_queue_pairs * 2; - if (dev->device_features & (1ull << VIRTIO_NET_F_CTRL_VQ)) + if (dev->frontend_features & (1ull << VIRTIO_NET_F_CTRL_VQ)) nr_vrings++; dev->callfds = rte_zmalloc("virtio_user_dev", nr_vrings * sizeof(*dev->callfds), 0); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-08-12 20:44:03.112658452 +0800 +++ 0015-net-virtio-user-fix-control-queue-allocation-for-non.patch 2024-08-12 20:44:01.905069257 +0800 @@ -1 +1 @@ -From 8b04c3e52344bebf31858066204712d73fd86a75 Mon Sep 17 00:00:00 2001 +From ea90bc49fc49710b0a1eea6f7abd237d677f134b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 8b04c3e52344bebf31858066204712d73fd86a75 ] @@ -18 +20,0 @@ -Cc: stable@dpdk.org @@ -28 +30 @@ -index b2c6c2b7df..fed66d2ae9 100644 +index 209435a865..1bfd6aba80 100644 @@ -31 +33 @@ -@@ -624,7 +624,7 @@ virtio_user_alloc_vrings(struct virtio_user_dev *dev) +@@ -609,7 +609,7 @@ virtio_user_alloc_vrings(struct virtio_user_dev *dev)