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 9DD4843CA5; Thu, 14 Mar 2024 12:44:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4393342ECE; Thu, 14 Mar 2024 12:43:38 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id C7BBC42ED6 for ; Thu, 14 Mar 2024 12:43:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P9cHaaL4DpTTJsZ29CVQHl0ev6thzDAG3knuNkpOQ+aYvUzE9AH4omOkIEgUai3AV0DERdEAXkgQ43puy69fIho6I7fQn1TtLI68We3SaLITX4DrnWL8F6UICKSiyV1CT7tooShPfO8GwP166g4vmVVNqheocey3ShvNVEzNLq+wrB5cHs3uw+ojwlMq/Gvb3qDB7AzpofDa0QHxu96GaAEk62a1ecqSPueZvk9Xntk7dkxr8Mp3a2div8U389OQX8FPG0SunW6iuSKx1XwCe6ubZuyvnsTSlQyzKRSXyPX1Uvm9OaN/WGTk6/V2ou7zm/vr+/VrFnEpsPAJv7p8+w== 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=1RxP9ZFL5dYilofDsNEiziT7c8u0vExtHQFnD8chL80=; b=OXJfMetFWhJpSZr+RmEF/f8QbuwRf53ae30HxGBuZHxErbgAJZvwsSyDJtjlU9u6GyY743dPjKxvWdDCEqGIRO3LPvDPP8EurYT5ias5DbIDazFN5HFO7Piy6UsQHwojFJRJ+3leXImS/nf7Wk2PCFMw2bxap91LJL2A4k6T/his6PbtGW/eI5i7zhp6QPU0s0IrIMgepcVlOkSvL6O2x4W6nrdcaj+J0hguasp5AyeyD8bCcux/ccJcg4l4mEFS0Hu4zTU8pFf8XgWwLQLwx7xv6XjjUJ0niEqNBKBskYYcAKc7/YemtCQqRP0OATZEARXshGQoNohJLrdA+Qn0SA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net 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=1RxP9ZFL5dYilofDsNEiziT7c8u0vExtHQFnD8chL80=; b=XlU4bydQWkqTaKoNvBsHUEVbnkjipgYNeqKEUaK8iSIwK6iIkWRJfKJgK7o7CTEJe95Ft3w8rIt/BTvkBk8YZ+kO9umt1gbSAvitOT3GiTpGBu7Rzu85L3Vy3/CqRSgIh1vmvpbaDwBXqBEVnZPQHdqKew+5WY0Qi/6aKTNGyAzKP9g4//SZMDfBR3Adtg5oDwkC3opBXSELmGac1kma5ks/jCtFOOpfg2Tk/0b2D1qSWu4Wz1M9sAdD6dQeuFad2uHjFC3Cx902XG0eFTQa7e3iMm8Th4bXi+ILXyalnPIr/Iff8/DU4AdSJB/X4DVo1hwKckumK2udi5iiiKmEow== Received: from DM6PR07CA0102.namprd07.prod.outlook.com (2603:10b6:5:337::35) by IA1PR12MB6652.namprd12.prod.outlook.com (2603:10b6:208:38a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.35; Thu, 14 Mar 2024 11:43:29 +0000 Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com (2603:10b6:5:337:cafe::45) by DM6PR07CA0102.outlook.office365.com (2603:10b6:5:337::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.21 via Frontend Transport; Thu, 14 Mar 2024 11:43:28 +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 CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.12 via Frontend Transport; Thu, 14 Mar 2024 11:43:28 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Thu, 14 Mar 2024 04:43:18 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Thu, 14 Mar 2024 04:43:18 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12 via Frontend Transport; Thu, 14 Mar 2024 04:43:15 -0700 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Suanming Mou , Matan Azrad CC: , Subject: [PATCH 09/13] net/mlx5/hws: simplify code for updating CQ doorbell record Date: Thu, 14 Mar 2024 13:42:16 +0200 Message-ID: <20240314114220.203241-9-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240314114220.203241-1-igozlan@nvidia.com> References: <20240314114220.203241-1-igozlan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DA:EE_|IA1PR12MB6652:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ea0e43d-5dbb-4737-1747-08dc441bf74f X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p/tsuGWD9hIvSiv197RdB0+BSeVoFd0rX/qir9bjpWhfv0uw3fN5kA8VO8w4NhWLy3CF2uEbpQ8Vhzpzg4n5jmhHM2oKSjQKx6JvFH0or56Uj/ZXM/9+PbyaenUbkHU13H457X2o91XvVBKoOJ0mA/9eIitDfY9bNMRLNZLzOfU54z0RYGXczkL21Xvy9MzNl1Yh7aLjFPlPAqC0bKPrlR+ZPu4bmuipWi0tthXkn5CbiCDP9nz/RU6Vgynz57ghmOJrjXrVTQ3YJAym2LC4BqLGL9Md+WcaZlP7ysJVsWx6f3k8J7tYT+R1OBV262QlQ33EgE0W/fzb+z4XN20hPCU2AlaMOlBwgKe+YwXmfF6to1Gz71zq5hbE3qbegDjd9WL7PfzVGzfE+vgTbWTDQ+lSCVTNLsuF3MrEBT4xxmebNHMANsm9ccwKVtJT0CSvKza4QErlXn7icg0Ok2NNdG8bubTplxWpDF/blxMEqWJ6CoYeXx1BChmNMFwFYyHsRr9CB5mAh6KiJ5AnKsfooayskdLfId6aZ+vKkj73Mh28lW7+5QcoDMe+BdcnDWXNgh/nEVTTlsZlg4yP61XdSDR+tLKE17+Wa0Ilnyk2CWeM++SmI0lRd3oinxYpYYp53SLxmqlyjM10XQfxVApyjoaMl3QjyeNprefqSH673nnOqK0b01dzcHfSlH73vnbP0EvGo418LwAIogB54XL0xQvKxwhSssBVQn0EIcEvcqpUxtbnTMU1jKzXSNeJ//VD5khpImLg2Ppl9uTfLzgcjw== 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)(376005)(36860700004)(1800799015)(82310400014)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2024 11:43:28.2635 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ea0e43d-5dbb-4737-1747-08dc441bf74f 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: CY4PEPF0000E9DA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6652 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Yevgeny Kliteynik Simplify the code that does CQ poll - have DB record update as part of CQ polling. Signed-off-by: Yevgeny Kliteynik Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_send.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_send.c b/drivers/net/mlx5/hws/mlx5dr_send.c index d61862f074..2942668e76 100644 --- a/drivers/net/mlx5/hws/mlx5dr_send.c +++ b/drivers/net/mlx5/hws/mlx5dr_send.c @@ -594,7 +594,7 @@ static void mlx5dr_send_engine_poll_cq(struct mlx5dr_send_engine *queue, cqe_owner != sw_own) return; - if (unlikely(mlx5dv_get_cqe_opcode(cqe) != MLX5_CQE_REQ)) + if (unlikely(cqe_opcode != MLX5_CQE_REQ)) queue->err = true; rte_io_rmb(); @@ -611,6 +611,7 @@ static void mlx5dr_send_engine_poll_cq(struct mlx5dr_send_engine *queue, cq->poll_wqe = (wqe_cnt + priv->num_wqebbs) & sq->buf_mask; mlx5dr_send_engine_update(queue, cqe, priv, res, i, res_nb, wqe_cnt); cq->cons_index++; + *cq->db = htobe32(cq->cons_index & 0xffffff); } static void mlx5dr_send_engine_poll_cqs(struct mlx5dr_send_engine *queue, @@ -620,13 +621,9 @@ static void mlx5dr_send_engine_poll_cqs(struct mlx5dr_send_engine *queue, { int j; - for (j = 0; j < MLX5DR_NUM_SEND_RINGS; j++) { + for (j = 0; j < MLX5DR_NUM_SEND_RINGS; j++) mlx5dr_send_engine_poll_cq(queue, &queue->send_ring[j], res, polled, res_nb); - - *queue->send_ring[j].send_cq.db = - htobe32(queue->send_ring[j].send_cq.cons_index & 0xffffff); - } } static void mlx5dr_send_engine_poll_list(struct mlx5dr_send_engine *queue, -- 2.39.3