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 DC87643FB4; Mon, 6 May 2024 13:45:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7E84C4064A; Mon, 6 May 2024 13:45:14 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2068.outbound.protection.outlook.com [40.107.243.68]) by mails.dpdk.org (Postfix) with ESMTP id 0B85D4064A for ; Mon, 6 May 2024 13:45:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L+Yv/v5ao+rmeh+8PcsXX/PWiSeBGeoWei4cjF70o8uGyaO49VPnnAFwwKR6JSdmJggIzQ6w5Zf6YTrxzMGCXMZ3JaVZuyJ2v/NrGd6B19Uf7Vpe3y91Nl82i85LNR4R9sF9w0h/Q2SDMaxPZqE7t+m3NoNRdPErtd7Z5+Lhz7d4nn92Ee4jP/Hurxpz+p+UEFqylT0+Jx6YssZLYKl95ekmjB9fHAhHrUPf378JS1vSL0fijTQQIh6JNeyymwjoyWAawfPRqS+vhNQzrK/NrQ9qOux7NQZrkZUUkffcmE/+VRDW9PJfTq6tSISISMyMPBmAYWyaeRzqI+G+tb5kBw== 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=Mn99N7mlZ674oHb0dfdTGBqGrkCXvZ88IZ4szPnY79Su5d0Ze3iDB8EbzMuBxa86w8r3BKJhUpYNfQnAP9Bnzd10Y9kxBUSKDrmpYWQzoGeAOMVcbFBQ2E/wDoYZINnr/Su1bjCQnmlXVKUm6mZg5l8vzJRZbPvzSp3GyQsCft9Z44ZrsdIcnc+4ZAz6E3/ZSlvhSajoDkyIhMt3c/g38yOkbC5RV8jWFMOqzSBeSmVJjGazOaCl2FIkE1ZwPpROTzdsGG/uhvAf4NZAfnlVdDyNei7FilfTtbBoC5THJYBLD+ZMvo74s+yN7oSmSs8SvjYIG4u88azfpBr0acFTbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=cC78FM6gRJMByNkH9klG7jtbj3FK/HS8cBjsTT+EBW2epkqWi4yFYDBM2dlmfV+MqyAGg/+5zgumNTDG4FDCRpaeOLpaIyIvmMAe8Pr/dGr0jiQoFZ6SJYOmuBC1UtYLB8/3dUMEWQlZxN2QEFWojNBXaUtKHtcljwfY85piuk4ZJVbJ3Bli5lbJk8UoaphJxWRoYJM28JZEmQv3wg1aT52RDKnrcOSEDiRYUWVj3tQaOAzPP5Lc7UX4lQMoGXwomVIxbrMCUi7JM0JAP9kGj5Dis86DHQk9TOh9wXJm2xvx3lCCVzk58T2exgK9O+KX4hhjQ1AxKYUw+iisU2zNgw== Received: from BN1PR10CA0026.namprd10.prod.outlook.com (2603:10b6:408:e0::31) by PH8PR12MB6769.namprd12.prod.outlook.com (2603:10b6:510:1c4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 11:45:09 +0000 Received: from BN3PEPF0000B36F.namprd21.prod.outlook.com (2603:10b6:408:e0:cafe::6) by BN1PR10CA0026.outlook.office365.com (2603:10b6:408:e0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42 via Frontend Transport; Mon, 6 May 2024 11:45:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BN3PEPF0000B36F.mail.protection.outlook.com (10.167.243.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.0 via Frontend Transport; Mon, 6 May 2024 11:45:08 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 6 May 2024 04:44:58 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 6 May 2024 04:44:57 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Mon, 6 May 2024 04:44:55 -0700 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad CC: Subject: [v2 09/16] net/mlx5/hws: simplify code for updating CQ doorbell record Date: Mon, 6 May 2024 14:44:12 +0300 Message-ID: <20240506114419.966498-9-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240506114419.966498-1-igozlan@nvidia.com> References: <20240314114220.203241-1-igozlan@nvidia.com> <20240506114419.966498-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: BN3PEPF0000B36F:EE_|PH8PR12MB6769:EE_ X-MS-Office365-Filtering-Correlation-Id: f41fa185-1b44-4a43-e38f-08dc6dc1fafe 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; ARA:13230031|82310400017|376005|1800799015|36860700004|921011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tt5EPO8sBGZEKujpZPRDzA4a2FN/sZCzxoBkYzKyTpfSva9iT4CWIEHfk4aX?= =?us-ascii?Q?dPlr8wADqR4hHoM1zQRPWgvgiynIEKerRPlsboo20aou/WbmBQNUa9yH2Te8?= =?us-ascii?Q?BYqiOc6p3rxvviUh7HefmCbd7CRtsXxC2Nq8duRoYwdqRnkSadtILL5weWPm?= =?us-ascii?Q?RDQ2tA+lpVtNMSKCyJvhqDwgyE6bquoBIKHcwEFb0y8447dTDmFl+CCnkBzD?= =?us-ascii?Q?eSMPIfg4rMOfjrFWsqcyzRDKcMhvoHLGrzUn8VlJ8XxmOY3JjY55mENehC+5?= =?us-ascii?Q?Hkz9tK/tMzxbFSr3aSCWKw0L2eWywkGRCKipgtLSTpYt8Njk+OaFPSdOiTfS?= =?us-ascii?Q?gapKKibUX+C7spZ/4HFejDRoW4Ty5k45smOBcQKy8n5K7I3nqaqx9abjCoo3?= =?us-ascii?Q?Fe1OY83UnPgCGIxFZmVRBzxN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?z+rAqiy0+xwgYhthbZ0bXmZ8vRmUMh5YrR/tlzlDP7P/LgP8j77y0DCQ1YMq?= =?us-ascii?Q?Ferb8OvnooqgUSyibf53NcQSthbs?= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230031)(82310400017)(376005)(1800799015)(36860700004)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 11:45:08.5016 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f41fa185-1b44-4a43-e38f-08dc6dc1fafe X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B36F.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6769 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