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 920A3454E5; Wed, 26 Jun 2024 20:15:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0943840650; Wed, 26 Jun 2024 20:15:31 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2044.outbound.protection.outlook.com [40.107.243.44]) by mails.dpdk.org (Postfix) with ESMTP id 32EEE40657 for ; Wed, 26 Jun 2024 20:15:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kwcAdCCni5w8IZPvJaMi1x7FgWdN4/Pfbwc2CUYju6KRlZucgmGeUDSU3xDNOUIIysUEXZOz3bbKHgoevK+9jjlOuFgFLqVbtrI1FesYriGDV32nS7pe5jtjBTraVUbi34u2YSeQYdXWU9H+EINEUfV1oTUh/O4+XEv6gJKrZj99XRlYFnCEsRivfiLk7Wj5T9JJ9W1YCKDqZTtLTa0xyC/VgC7pZ0YSrpzJZHX89t4WoHGr1xGrL0vg6X/Kr6x4rFPy+eJCFPG93TrZI3QWYnJhx0QrhTmOQsuo9dGVQ4X2oFxYKw4fC9S1KV4ZXltAjEgl2Ls/i6XyqvoVm/HcyQ== 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=XEXsyfR7IoJsd+fSFxHIoK5/EYa64Ey4BJJYKNphsUo=; b=MSmy5MqXO+Uj2Sppqyo5V9pKaMHOk9l2u8dOnJpiXwA+9tZ/lv7rqXcyjVNq00oHsalqVzqoRVALk6B/QK2flskaDQqO0N6n8D7nqYMMAjr22XQ7XpizDr0k3gRiVm/prFsagBFoFPniNoqOSTRt6W40dJjn6uF52ajo6+duLQQAvhYzX95VGZRgXkvROeJ3vITRLG8q+hsZzhlIxD19FLYFiUrUF1hGwDAW/G+NYMTgvM6YWIC8kVJ/E4XM7SIBD9NZugbojRBpTMSVaHhexlo1RuMVT+xRWszo5VCsRwxp2pa/77BcZGyrbFJjk9Gy5kgMg7Kf1svVOMSOcuvN8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org 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=XEXsyfR7IoJsd+fSFxHIoK5/EYa64Ey4BJJYKNphsUo=; b=QZZMdvStJ2U+fAcQ5/K69Wfr+dCh5BPNiCXm1nPhVcCo69XIcwt6LaTYBfChOMgFi/jhIouj+/DuJqWQYKfkyEFi5dDmZAFeJwPlBB1LvMUEiMEdg0UJGWTXNzGn44EgaiJGhAicOsI9HAX7NeLjbjZ5MpPIY6XBw76fw7s9yoUnNsG+ZXP28Wks1VTWSaJbao2AExAZwiqwOL69N/nbbNTtiCKf+86GU8tYf9z7Xkej6EVRCMjaU2uoh3FTLa5b8u5xPdeqF6RL8hr49lRKC//1Kk0dMUQxpW4HTtxH8h7asqvscjdo4F+tGmexbVhI7F584+iM3DdgzvTorvOolQ== Received: from SA1P222CA0034.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::7) by CH3PR12MB9080.namprd12.prod.outlook.com (2603:10b6:610:1a7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Wed, 26 Jun 2024 18:15:14 +0000 Received: from SA2PEPF00003F61.namprd04.prod.outlook.com (2603:10b6:806:2d0:cafe::ae) by SA1P222CA0034.outlook.office365.com (2603:10b6:806:2d0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.23 via Frontend Transport; Wed, 26 Jun 2024 18:15:14 +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 SA2PEPF00003F61.mail.protection.outlook.com (10.167.248.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Wed, 26 Jun 2024 18:15:14 +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; Wed, 26 Jun 2024 11:15:01 -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; Wed, 26 Jun 2024 11:14:59 -0700 From: Dariusz Sosnowski To: Viacheslav Ovsiienko , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad CC: Subject: [PATCH v3 7/8] common/mlx5: add debug mode indicator Date: Wed, 26 Jun 2024 20:14:27 +0200 Message-ID: <20240626181428.1678402-8-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240626181428.1678402-1-dsosnowski@nvidia.com> References: <20240612162426.978117-1-dsosnowski@nvidia.com> <20240626181428.1678402-1-dsosnowski@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00003F61:EE_|CH3PR12MB9080:EE_ X-MS-Office365-Filtering-Correlation-Id: eab78524-3d4f-4c10-c811-08dc960becff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230038|82310400024|376012|36860700011|1800799022; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?T4LD0yHZPvp+/tT77qyhNEdq/BtzAr5wLZ0hbsT9YDdZm6tF2wULS9Nj8Z5T?= =?us-ascii?Q?zp/fDVYRwO9f7CKUicj4UIZ3cG3DcxKCPq9nEF8DSXWBe9OF+xRFGESBQV/l?= =?us-ascii?Q?iDAH/lp0BNztb+iCqlw33jD1Ie3dvhzIdvu2RUG5QV/nBl89ebWBa5BuIVHF?= =?us-ascii?Q?OZm5GU+VuSqMxpXSFYfooctbEjfMrgR+IQjxIGIyEvJuwauyE/sWSJkyt0lU?= =?us-ascii?Q?ot77ZY7WQ2sML6jUvoiWsa+dbckWuwKJDtHp6OkIZBs2CVOSc0d3+XK6YfIw?= =?us-ascii?Q?tStGPtP4iSUFqzAA8VHjQdrp+rOiMruMJ0fNc+lEfYdFsF6zjZZ0ysnWpxUF?= =?us-ascii?Q?2YQCUxdidyhRn+Kg83GUBEJD0KDErLD5/PWfm4+BgBiTCyiCDzASGKvQf7Oy?= =?us-ascii?Q?HwJdQITka2GeIhrumngzlGlIjmhRlZKclDVybQysC/8pOxSYxVmLJfXxTMXp?= =?us-ascii?Q?z2h0t0BssL6gbXwjVrTFo0Vv8RznDgILSZMHwIbIyL34mED7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rUSCAB7tOLxaOZaE3iMqfVMxKz6CEJSRmJzVX?= =?us-ascii?Q?9boUwvrMEFmq0Q1CJHEghA4yeoOBakpp?= 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:(13230038)(82310400024)(376012)(36860700011)(1800799022); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2024 18:15:14.3666 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eab78524-3d4f-4c10-c811-08dc960becff 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: SA2PEPF00003F61.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9080 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 Add mlx5_fp_debug_enabled() function which: - returns true if RTE_LIBRTE_MLX5_DEBUG is defined, - returns false otherwise. This allows for conditional execution of code meant to be executed only when mlx5 debug mode is enabled, without adding conditional compilation guards inside source code. When mlx5 debug mode is disabled, any code running if mlx5_fp_debug_enabled() returns true will be removed by optimizing compiler due to dead code elimination. Signed-off-by: Dariusz Sosnowski Acked-by: Ori Kam --- drivers/common/mlx5/mlx5_common.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h index 14c70edbef..1abd1e8239 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -109,6 +109,19 @@ pmd_drv_log_basename(const char *s) #endif /* RTE_LIBRTE_MLX5_DEBUG */ +/** + * Returns true if debug mode is enabled for fast path operations. + */ +static inline bool +mlx5_fp_debug_enabled(void) +{ +#ifdef RTE_LIBRTE_MLX5_DEBUG + return true; +#else + return false; +#endif +} + /* Allocate a buffer on the stack and fill it with a printf format string. */ #define MKSTR(name, ...) \ int mkstr_size_##name = snprintf(NULL, 0, "" __VA_ARGS__); \ -- 2.39.2