From patchwork Wed Mar 20 01:40:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varghese, Vipin" X-Patchwork-Id: 138486 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0A65143CEC; Wed, 20 Mar 2024 02:41:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D0DE4029F; Wed, 20 Mar 2024 02:41:47 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2046.outbound.protection.outlook.com [40.107.96.46]) by mails.dpdk.org (Postfix) with ESMTP id A4D9240298 for ; Wed, 20 Mar 2024 02:41:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MidmYMEY2j2GJnWEdG9WP8z3nFIR8JHDwjLtE8m0cga1K2YAw/nrB+1D75X/LG8BtwMMQrxt3SGg4wMsFLSa9wLIbXvXtvQitA3qN+TIBZ2qhjmCcH/X0FMWpXMdLLwkqy+jLjxXP0+2Z03gnxVg2qF7pL+zYX0Ap6OOFkdqRstQKPFtyS0wxKoWkHHhBQFkxKCebAKYkj+upfBUBRrEZZJyyOvB8J7y4ngLzdSaISK+BNSFNby5f+6WRx4BtVWlUql0UIZU/qTlfaMQPGu07Aw5Uik6Au6JPdTJSfFxZNg/1h5aPgT5J1kE2X+hqYMgvtaSoxk2UsSwsXa6KtJ6hQ== 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=zcMgMxny6zvnoxyrTAdyesRGZlIDmWag/KnubeQYmPg=; b=fSAG1zu7m0f7XovJCNnsg1GAu0JKr1IVLAuhFIhpPJ2IAczcJMgRXBrwVM+zOZGV/rvLlYqKiMvavJuiqCY8Lv8k38j4nCTKuJqs7UadIscM+NZQtblu0ZMAk6AwifRSMspeVidAzmggrXnLulrX3hNcfMN7J2ODiviFgPVVm6tNu1F4P/VHO0DKki8yQDv6er1SNHbRbYNaRGZMKh3LYaJK0imY3l+uR4cvP65PLIVQrFyWQV1lYUJcfaPEzMA4orgbi2kqBsZr6lKZjo6gMSsNYXQMFOstlDyZLDE8T1XzCAlkProdbSd/sFPxr3cw6jeBE4iwuVkvABowUxD91Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zcMgMxny6zvnoxyrTAdyesRGZlIDmWag/KnubeQYmPg=; b=ksDmJWySQi7YxqEv3UI9X55mHmQ2L3620fEvIdwk2lai4FZJCwUdlDLxh/A2j1aKR1ouZYMujve82ZMSPKIQ8KPQQo0gtSq+uXK8JRiF2vkVNgK+Q+5/VWTkkzLe4FYmz8vnKhmegM1uGATKdChSgi8tXBSmFLZjDKpYInvMPwA= Received: from BN1PR13CA0012.namprd13.prod.outlook.com (2603:10b6:408:e2::17) by PH0PR12MB7885.namprd12.prod.outlook.com (2603:10b6:510:28f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.30; Wed, 20 Mar 2024 01:41:42 +0000 Received: from BN2PEPF000044A6.namprd04.prod.outlook.com (2603:10b6:408:e2:cafe::c8) by BN1PR13CA0012.outlook.office365.com (2603:10b6:408:e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.12 via Frontend Transport; Wed, 20 Mar 2024 01:41:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000044A6.mail.protection.outlook.com (10.167.243.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7409.10 via Frontend Transport; Wed, 20 Mar 2024 01:41:42 +0000 Received: from BLR-5CG134626B.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 19 Mar 2024 20:41:40 -0500 From: Vipin Varghese To: , , CC: , Subject: [PATCH v3] app/dma-perf: calrify incorrect NUMA config Date: Wed, 20 Mar 2024 07:10:53 +0530 Message-ID: <20240320014053.1040-1-vipin.varghese@amd.com> X-Mailer: git-send-email 2.41.0.windows.3 In-Reply-To: <20240311060053.137-1-vipin.varghese@amd.com> References: <20240311060053.137-1-vipin.varghese@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A6:EE_|PH0PR12MB7885:EE_ X-MS-Office365-Filtering-Correlation-Id: ad1f2618-beac-4885-a5c0-08dc487ee4f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /axUDwEqzBZ6QqF0bzvUmR2DgHtFv8ZVZst3/GbuHmVBdLbnxZbxLgHIVdTIOk0Q5r5FmNe35QpUsCQbyzmWHk2B8v30QTvzsaafxvynLtoFiXCtQNkSphrB1SHDeGOO9PlfhBp3Dk3GU4kKtqx9fcAssuDony1chdyGx7PJm0Cw+ESaad6j2aaH7uo6znVa8xKteVIR1AMedBV5E5BrPJYqL2n6ML0qOLnlQPNEuutx8crsKDslsrAqYY0LR2Rs7OUsv+fL1t273C4U2JCoPwvnAUy3UTBVeUKbjwDaJ3lJBjwQM/5zXc47S/ZQ1V5pUpw1xu81DnDQ6Ayn7Qmm1x182wz9yyhJsVXCW7pxFtZeT7nzImiUuF9kJGt4sn7yOOLWOxiCBiRf2ziJOsfi33EJF1JE5NKBqbAMU+Ik7ZJyQiNrzX0HyVmeyS0OGYoGt2S/expM42PV/XXIoEIGBp/g+T1Mw8fPFYI1EQcQdAeyY9wl41kcjVri6mfl7wk4w5eN7sVnR37198rU1rcLl9XgoAWwB5uyG/DKBfneXV9DimYX/sPGrjYHSjljD/k75vFFTNkuvFrSyTVgJ5MuMyMPwJXdefDQotDkTZ83NdmIGTBkZIeIH9J4JPYuyiUN6OiU3D+HA1ehKqxvl4etrf+kab4Ckng1cZnS48PJhmu46ZEryFX2yvglUTa+BXLbcoxNekeC9nV3c2UAKm2HF93vjl3SMsiPoJzaZ0xDliIqGTv1jQwBSdFkXrWfgd0G X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(1800799015)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2024 01:41:42.3707 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ad1f2618-beac-4885-a5c0-08dc487ee4f3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044A6.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7885 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 In case incorrect NUMA configuration, the current commit shares 1) either `source or destination numa is greater` 2) instead of `actual NUMA` it is `acture NUMA` 3) uses `printf` instead of PRINT_ERR current patch changes the above to 1) identify if source or|and destination is incorrect 2) fix wording to incorrect 3) use PRINT_ERR macro Signed-off-by: Vipin Varghese --- V3 changes: - use snake-case instead of camel case for static scope functions. - convert console words to lower case. V2 changes: - inform incorrect numa - fix spelling from acture to actual - use PRINT_ERR instead of printf --- app/test-dma-perf/benchmark.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c index d167adc4d2..a437b715bd 100644 --- a/app/test-dma-perf/benchmark.c +++ b/app/test-dma-perf/benchmark.c @@ -442,11 +442,16 @@ setup_memory_env(struct test_configure *cfg, unsigned int nr_sockets; uint32_t nr_buf = cfg->nr_buf; uint32_t i; + bool is_src_numa_incorrect, is_dst_numa_incorrect; nr_sockets = rte_socket_count(); - if (cfg->src_numa_node >= nr_sockets || - cfg->dst_numa_node >= nr_sockets) { - printf("Error: Source or destination numa exceeds the acture numa nodes.\n"); + is_src_numa_incorrect = (cfg->src_numa_node >= nr_sockets); + is_dst_numa_incorrect = (cfg->dst_numa_node >= nr_sockets); + + if (is_src_numa_incorrect || is_dst_numa_incorrect) { + PRINT_ERR("Error: Incorrect NUMA config for %s.\n", + (is_src_numa_incorrect && is_dst_numa_incorrect) ? "source & destination" : + (is_src_numa_incorrect) ? "source" : "destination"); return -1; }