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 E50D343B86 for ; Tue, 5 Mar 2024 10:53:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE5914026B; Tue, 5 Mar 2024 10:53:52 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2056.outbound.protection.outlook.com [40.107.223.56]) by mails.dpdk.org (Postfix) with ESMTP id DAE944014F for ; Tue, 5 Mar 2024 10:53:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h9XZm/lryb8GvFvmnXPGCN9sT+Rbt3MTl9y1W3h9LF8cIEc7kAqZHnRxwqrUQHY/Eu2OZzzk6qfGsDXKJFWinHZhoNZKi6Y90UWTQj1zEAdH2xdZgCFLdYCCaMTq/cC3g4i0vAaALMlnAPiHWSfbx37JOK2QMkZxuKQoUca6oC2LgV0hzW6lhRxwCtNWV9veo1WXON7ldkvipKF2Zrm4tRTbWFhnAh5hlnJG//aD9dp3VnIUhy4yzXO4myOmIiBIA5LsMzVGWTZaEY4V6kYNqK9o5RMmjXnuXCUfnBN0AKyYNMk/8N5tok7dIb8erVXBOLVRVg4oDLls2A3ZF9H9bw== 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=PgH+KmuSUgrhGSMDQcQqk3w5572hFPRi1W0AHFmTkAc=; b=ScybJu2FDnZNvKrPDzOy/2DyD7ssYG6T2q1PwzeAsDMTbUBZzAUpBlBoe3grkpQUdzLfgM57FFnIvhNCNAskxJQEDeR7MbbikJgQ14P66kwDaWbWIrav7KQzPtGccvUasHFdDAFRPJJKfn/bwQLxtkB9V4/Z5n2Cp4X7s8yZX6E9Ik/2R3iEeJAAyCNU1Uk84dRaic5k0XV0TGt52QvjGUl5aX6o1Gy8TAzhvHR5Vt+x+ukL524w5GwOIcNNq+uesuW3mtao4L7et5I5L25GGBMKMGj1HbJyeEHxdYPHqFaCX4LqLogiVpxf9135/Z6KYglakgQqmu0+efvCKtWKfQ== 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=PgH+KmuSUgrhGSMDQcQqk3w5572hFPRi1W0AHFmTkAc=; b=iKl7YrxwYOP3FOq1jyHtSJ7HdXLjElh9n8QqmhIyvIMmEgHk7MQB7waOkLuqA8YuGJyQHGB0bw/j5+ir1/9jV0gkSJBXVd2D+OMRqWJ42iPQSRCItOAa8JzJiX7Cf/KKF+YlURxYxyAH2FO8Pa4G/QVyq/l+NY6LkD0wdtLS7dqpI+CZ9C9P1BJuXPwsGh3rN6Q1mzoxT1j3ndPTShFwr1vkHOm8sUAUy1Kqw904y3nV6J0DKY3/9zMJ1eryBNMPd74qsp4RG4umyVGxjZwlUxKq6dLCBaDwkCAVAvWmKrZU0zh70I8+EhiKe26DXPQHOOYhvJSJcSeB4HQI8LMYlQ== Received: from BYAPR08CA0058.namprd08.prod.outlook.com (2603:10b6:a03:117::35) by CH3PR12MB8903.namprd12.prod.outlook.com (2603:10b6:610:17a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Tue, 5 Mar 2024 09:53:48 +0000 Received: from SJ5PEPF000001D4.namprd05.prod.outlook.com (2603:10b6:a03:117:cafe::b0) by BYAPR08CA0058.outlook.office365.com (2603:10b6:a03:117::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.38 via Frontend Transport; Tue, 5 Mar 2024 09:53:48 +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 SJ5PEPF000001D4.mail.protection.outlook.com (10.167.242.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:53:48 +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; Tue, 5 Mar 2024 01:53:34 -0800 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; Tue, 5 Mar 2024 01:53:32 -0800 From: Xueming Li To: Yajun Wu CC: Matan Azrad , Maxime Coquelin , dpdk stable Subject: patch 'vdpa/mlx5: fix queue enable drain CQ' has been queued to stable release 23.11.1 Date: Tue, 5 Mar 2024 17:46:41 +0800 Message-ID: <20240305094757.439387-61-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com> References: <20240305094757.439387-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001D4:EE_|CH3PR12MB8903:EE_ X-MS-Office365-Filtering-Correlation-Id: 0765c734-deb1-4872-5f8d-08dc3cfa277d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6u+2RLCVGmWEFrVN6tmqWJDWfY9ApK0tD/xKn9ZreZ64aeRXZN8RCBjWP5FCUAscaU39wsBNESHatKoETJ2ObZEqXj2TsChqeqHuUNfwyt506dWIDHTpIaFw+xLyqkQuRXKWjermwS441SCqD7jP7bhod/D6KdBoeNRrWOVMkSjGP6OO0z54i382HX29E02ApoWZxzo3MaROsgMyZrFMkMmAodeQP460E9NPHRNn1hMapQlFwcKyq+s0pN976NejNk36vs3Dgb2oct2JX+fLc9Lwj4z3LKBr0hDtWx3ZYIupRgNGO+smRWafNV8bdmF4c8iCeQLb89eCxWUIrDWoN+dwvr9VJaKQ2lJrdgAlpNpLagroCs/3blqLRPY9PpLvITW/BOabf/RyxP4MGJRJBn3qSoX0bafXPNANYYnHvXzhfTsTZR2/lsyZixGN+4WJXdsGpe4NRIlh5XiWQVSIpRBJNIzB0pdGc9dxvGDk0I70yAwd313+I0CztskRDl6FYcf0vo3B8+bil1T2AHVc1D+dWLCGanrcHLD4Y9XMf3Zqy9ZmABpO1QgOTzqMWgkD9qVqg2Au1/voV4oi2ScxH/theyJAZKcUT4hpb6BkkeAKtd+nPrW1KHJDfsAFRYeND659TnSUSIq0w74o4D7QgS2iDIUWwub0hMIqBSxiM7IDq8Mo3Ox8LisaZVbdEcE7jOiOvc4FhBzx6pbcF5grA1NUfV5Zh6uTuUyOdw2+F/CRwMnbfM4OhUch8ApUfPB1 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)(82310400014)(376005)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:53:48.1473 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0765c734-deb1-4872-5f8d-08dc3cfa277d 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: SJ5PEPF000001D4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8903 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 03/31/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=19f0cf0927c7171c0fe06526388f51c17c5ce62b Thanks. Xueming Li --- >From 19f0cf0927c7171c0fe06526388f51c17c5ce62b Mon Sep 17 00:00:00 2001 From: Yajun Wu Date: Thu, 25 Jan 2024 11:17:55 +0800 Subject: [PATCH] vdpa/mlx5: fix queue enable drain CQ Cc: Xueming Li [ upstream commit 32fbcf3139fbff04651b3fe173e9f3457f105221 ] For the case: `ethtool -L eth0 combined xxx` in VM, VQ will disable and enable without calling device close. In such case, need add drain CQ before reuse/reset event QP. Fixes: 24969c7b6224 ("vdpa/mlx5: reuse event queues") Signed-off-by: Yajun Wu Acked-by: Matan Azrad Reviewed-by: Maxime Coquelin --- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c index 9557c1042e..32430614d5 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c @@ -244,22 +244,30 @@ mlx5_vdpa_queues_complete(struct mlx5_vdpa_priv *priv) return max; } +static void +mlx5_vdpa_drain_cq_one(struct mlx5_vdpa_priv *priv, + struct mlx5_vdpa_virtq *virtq) +{ + struct mlx5_vdpa_cq *cq = &virtq->eqp.cq; + + mlx5_vdpa_queue_complete(cq); + if (cq->cq_obj.cq) { + cq->cq_obj.cqes[0].wqe_counter = rte_cpu_to_be_16(UINT16_MAX); + virtq->eqp.qp_pi = 0; + if (!cq->armed) + mlx5_vdpa_cq_arm(priv, cq); + } +} + void mlx5_vdpa_drain_cq(struct mlx5_vdpa_priv *priv) { + struct mlx5_vdpa_virtq *virtq; unsigned int i; for (i = 0; i < priv->caps.max_num_virtio_queues; i++) { - struct mlx5_vdpa_cq *cq = &priv->virtqs[i].eqp.cq; - - mlx5_vdpa_queue_complete(cq); - if (cq->cq_obj.cq) { - cq->cq_obj.cqes[0].wqe_counter = - rte_cpu_to_be_16(UINT16_MAX); - priv->virtqs[i].eqp.qp_pi = 0; - if (!cq->armed) - mlx5_vdpa_cq_arm(priv, cq); - } + virtq = &priv->virtqs[i]; + mlx5_vdpa_drain_cq_one(priv, virtq); } } @@ -632,6 +640,7 @@ mlx5_vdpa_event_qp_prepare(struct mlx5_vdpa_priv *priv, uint16_t desc_n, if (eqp->cq.cq_obj.cq != NULL && log_desc_n == eqp->cq.log_desc_n) { /* Reuse existing resources. */ eqp->cq.callfd = callfd; + mlx5_vdpa_drain_cq_one(priv, virtq); /* FW will set event qp to error state in q destroy. */ if (reset && !mlx5_vdpa_qps2rst2rts(eqp)) rte_write32(rte_cpu_to_be_32(RTE_BIT32(log_desc_n)), -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 17:39:32.765921359 +0800 +++ 0060-vdpa-mlx5-fix-queue-enable-drain-CQ.patch 2024-03-05 17:39:30.773566493 +0800 @@ -1 +1 @@ -From 32fbcf3139fbff04651b3fe173e9f3457f105221 Mon Sep 17 00:00:00 2001 +From 19f0cf0927c7171c0fe06526388f51c17c5ce62b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 32fbcf3139fbff04651b3fe173e9f3457f105221 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org