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 9C94343E57 for ; Sat, 13 Apr 2024 14:57:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 969FD402CB; Sat, 13 Apr 2024 14:57:06 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) by mails.dpdk.org (Postfix) with ESMTP id 8AF48400D6 for ; Sat, 13 Apr 2024 14:57:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EG1ugKgPsI/Mqr+lp8v3NNt+h17090jPZ/6ZZ9n+MTb+sfT019jS4rB4lG9O00ZoS2WViAjIB5dHOzot+znLT+3H1IYBNdNuaKYhN0gs4TptU3QDg1RpAhds81/pBpRu69zBs9Z1MasKe/JamGjN0d5inaq7lXiVYsP2tnIw4uhldHv2GCw+88PEu/4hWvkEyljN5vJ0QQsTuybVhonFDhZhgRMYhQlN2l7vbr+gFoTfIi7k+B5oA8m2dUNsfU3Y/rotsK98ZCNNNPH1iO0f7Gw2DqM1+A/uNLV2V9/nznrVL0V9GQofJABtvpUbWt94LFW5XvmcOP2UeQUAKkBLPA== 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=3Nl9jz2NbefVKSZ6u4NOgHCetgSncOcfKVw1qOLU9AA=; b=T/GxquNDIPpj81PlpcK0zm6Pq7XYm8RUJi9wbk0xWmJqrs18z5XC9uHiN6w0qWTxhUMfOBknzhKP2M80xAGI/BuD38n7hm6lDY0ENEeE3kJFW8jK87jLz2bu5JXW0oEttW8dOpfZErhZVUy/lWri7IjlvQ4Jx6ZgS7bsCOceYhU+IQPo9YxWU+lWkpnc45sgxdQi5+g+Aa50AJvrjTrpUW0tlugbNeWFRnAUwpOHAjHNvDPXc3vv+Y6626LCuiyLNEU2YFFoh70P7+H6WY7EslV4CxPAX5DLXtgLZ0B9kwI7ne9L+iuud+DO3wg+U/mLmE/sDw8QZreOAc3U63VRaA== 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=3Nl9jz2NbefVKSZ6u4NOgHCetgSncOcfKVw1qOLU9AA=; b=uZhNuJyZ2cth6CtesSZyDTTKweA66T74zClXw0Idr+TgdAi0pksaSKVzg5d0aSD/p9Gs1etfPIaVQ4OX9kxDIAcP0M++z+xKp1nxGQUYtCcBtjJqLn419zdzt6BOAfs5Bomr06Aphgk76awhpUhqhRwTQIPElSztUulCX2cqinG4MNhyh3RygiZP9ZdGL0d0NgI+ZfdgwHIJuv/ZugdZfOZIAtQNRZFkrSxC4cE4KqkCLWz5NqS2/YLXYbRdWeye1zT4NBlpH5b8ySzPa1aUiAJrPxFPefD8IZ31lcuTl7UfQVzAiwvJy4y/zi7ewV4wZe34skfQMZd7EQHcJDTg3A== Received: from CH5P222CA0001.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::15) by IA1PR12MB6113.namprd12.prod.outlook.com (2603:10b6:208:3eb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Sat, 13 Apr 2024 12:56:55 +0000 Received: from DS3PEPF0000C37D.namprd04.prod.outlook.com (2603:10b6:610:1ee:cafe::72) by CH5P222CA0001.outlook.office365.com (2603:10b6:610:1ee::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.31 via Frontend Transport; Sat, 13 Apr 2024 12:56:55 +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 DS3PEPF0000C37D.mail.protection.outlook.com (10.167.23.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Sat, 13 Apr 2024 12:56:55 +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.986.41; Sat, 13 Apr 2024 05:56:43 -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.1258.12; Sat, 13 Apr 2024 05:56:41 -0700 From: Xueming Li To: Maxime Coquelin CC: David Marchand , dpdk stable Subject: patch 'net/virtio: fix vDPA device init advertising control queue' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:49:13 +0800 Message-ID: <20240413125005.725659-73-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240413125005.725659-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> <20240413125005.725659-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: 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: DS3PEPF0000C37D:EE_|IA1PR12MB6113:EE_ X-MS-Office365-Filtering-Correlation-Id: c18552b7-6f1d-453d-e14c-08dc5bb93275 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x9x8jY4m1KFmCTajpm4l65f9tspCJRpfHqMSsY2qQeTCkq+Adg/3ezmoInT1yQgktrIXvOyulyGHmrEC8bM++uLFjkLpKHBXNDvWPiFihS+94T8bnNF7wDvC18VWB2uQ/UALz3X22wp1VnlSn5iS8FdAVTOgNDsxoCUrakwoZFkTKIamPyEUTyWdEuBu8pmzW4XkdfnrU23WSiLZpNyaUr6i4dOZRBxsLJaePM+Z2uZA0eQDGA0w4/IkYiqqRu6TDr26MFgL8SO1lEHOzISn751yAbpq7IaJJrcvmKB4zkWLXHWQpqqwJc7qL/PjUfe3FhuhdxcXss4EAaHPvlcY+j1JVftvwwnHl5t2YuA9XChkXeqXhuHnamcxVhIhB+LCGH4DDfylQq8eV+X1MXVQ0O2PZekF0IvdRmOmC2+JZoYC4S84loHPB/AerrDanf6uACpnt/z7yy6khS0VLnmKLE/7UNfVA+voDh0unfzNVatkrSeI19jcXEPwwKFkjhCmrL580ORUASMj0qrxBBf4BiEGLJmcW6b6AKkkfr52DRiLVg/iKow5V5vn1oL7tZjis5rFV7AsPYwrgshFeed7qaXMXun5JzQib0dpM2zPOnEIgLvdw+TPrD2YepL6ZSoJ8qo1UrjNZ9hPscFpSq02Ki/rvpKtN9BCli3+GbtDyzWo6YUu94lpxudO4/e2xzeteeiYak1G+Cfn3fjplS2qFMdhVtXsGcS4nn1UN+/cZm4VGplDeYA42dSTxfwc3H/s X-Forefront-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:(13230031)(1800799015)(82310400014)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:56:55.1868 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c18552b7-6f1d-453d-e14c-08dc5bb93275 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: DS3PEPF0000C37D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6113 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/15/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=7105c8a2997b364313c06f7d4cbc62a64eb61dec Thanks. Xueming Li --- >From 7105c8a2997b364313c06f7d4cbc62a64eb61dec Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Wed, 13 Mar 2024 13:59:31 +0100 Subject: [PATCH] net/virtio: fix vDPA device init advertising control queue Cc: Xueming Li [ upstream commit 58c894154165f24de8344383e2d1d5cccf4a42bc ] If the vDPA device advertises control queue support, but the user neither passes "cq=1" as devarg nor requests multiple queues, the initialization fails because the driver tries to setup the control queue without negotiating related feature. This patch enables the control queue at driver level as soon as the device claims to support it, and not only when multiple queue pairs are requested. Also, enable the control queue event if multiqueue feature has not been negotiated and device start time, and disable it at device stop time. Fixes: b277308e8868 ("net/virtio-user: advertise control VQ support with vDPA") Signed-off-by: Maxime Coquelin Reviewed-by: David Marchand --- .../net/virtio/virtio_user/virtio_user_dev.c | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index af1f8c8237..4fd89a8e97 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -215,6 +215,12 @@ virtio_user_start_device(struct virtio_user_dev *dev) if (ret < 0) goto error; + if (dev->scvq) { + ret = dev->ops->cvq_enable(dev, 1); + if (ret < 0) + goto error; + } + dev->started = true; pthread_mutex_unlock(&dev->mutex); @@ -247,6 +253,12 @@ int virtio_user_stop_device(struct virtio_user_dev *dev) goto err; } + if (dev->scvq) { + ret = dev->ops->cvq_enable(dev, 0); + if (ret < 0) + goto err; + } + /* Stop the backend. */ for (i = 0; i < dev->max_queue_pairs * 2; ++i) { state.index = i; @@ -725,7 +737,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, if (virtio_user_dev_init_max_queue_pairs(dev, queues)) dev->unsupported_features |= (1ull << VIRTIO_NET_F_MQ); - if (dev->max_queue_pairs > 1) + if (dev->max_queue_pairs > 1 || dev->hw_cvq) cq = 1; if (!mrg_rxbuf) @@ -743,8 +755,9 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, dev->unsupported_features |= (1ull << VIRTIO_NET_F_MAC); if (cq) { - /* device does not really need to know anything about CQ, - * so if necessary, we just claim to support CQ + /* Except for vDPA, the device does not really need to know + * anything about CQ, so if necessary, we just claim to support + * control queue. */ dev->frontend_features |= (1ull << VIRTIO_NET_F_CTRL_VQ); } else { @@ -844,9 +857,6 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs) for (i = q_pairs; i < dev->max_queue_pairs; ++i) ret |= dev->ops->enable_qp(dev, i, 0); - if (dev->scvq) - ret |= dev->ops->cvq_enable(dev, 1); - dev->queue_pairs = q_pairs; return ret; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:07.252100287 +0800 +++ 0073-net-virtio-fix-vDPA-device-init-advertising-control-.patch 2024-04-13 20:43:05.027753892 +0800 @@ -1 +1 @@ -From 58c894154165f24de8344383e2d1d5cccf4a42bc Mon Sep 17 00:00:00 2001 +From 7105c8a2997b364313c06f7d4cbc62a64eb61dec Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 58c894154165f24de8344383e2d1d5cccf4a42bc ] @@ -20 +22,0 @@ -Cc: stable@dpdk.org @@ -29 +31 @@ -index d395fc1676..54187fedf5 100644 +index af1f8c8237..4fd89a8e97 100644 @@ -32 +34 @@ -@@ -216,6 +216,12 @@ virtio_user_start_device(struct virtio_user_dev *dev) +@@ -215,6 +215,12 @@ virtio_user_start_device(struct virtio_user_dev *dev) @@ -45 +47 @@ -@@ -248,6 +254,12 @@ int virtio_user_stop_device(struct virtio_user_dev *dev) +@@ -247,6 +253,12 @@ int virtio_user_stop_device(struct virtio_user_dev *dev) @@ -58 +60 @@ -@@ -752,7 +764,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, +@@ -725,7 +737,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, @@ -67 +69 @@ -@@ -770,8 +782,9 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, +@@ -743,8 +755,9 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, @@ -79 +81 @@ -@@ -871,9 +884,6 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs) +@@ -844,9 +857,6 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs)