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 CB3B443C8A; Tue, 12 Mar 2024 04:48:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A063402E6; Tue, 12 Mar 2024 04:48:11 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2047.outbound.protection.outlook.com [40.107.243.47]) by mails.dpdk.org (Postfix) with ESMTP id C043340282 for ; Tue, 12 Mar 2024 04:48:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZIMd1TMRRECp4epkGfw9aiqAVMuNCasD+xSH3TiuYVR+H4uJSM0EqVZQnBuLFl1iKUjgzYHQUvqn4V2Ztq4mWcU1Z11bb7eu4rRrTxj8yC6F9n9QnaNJBFj+CPauebrBGP5uITF3gHU6v6kqD41w+am8kx4I2+ChqksjJpvyC+p3gxwfppQal5wcxdib0qGJCkTWp0AGVo8nea4KWmY6QLwlzB+7qiHbqNYUCmSZ1TRbeWaOgOFJVq6prvbUlqowlcUTVWo4J1rtuHezMdOxfaZsGIxOgDr1QreXxfObJ3qbCmCMOsuFS5HbVLmDAG1TZ5Y5VfbnCgHEupq00Gse/Q== 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=TwgcFSN5H9XNYCHDlIfvSpG/4AmwBQWjczjELm1qGak=; b=XTzCvZ+lzIoen6xbJPZj/BFt0A73hp2T+darIAsdhX+07dHA8/T4onUJ+3WyXT5jV0TduL2bag7zL94clByJm/FBFSjyxS6POmke4n4O9vu6QcNpTHuy27TrTVsgvcGyqbPpik5tvYaqT1qhYL5nZKjHQu3gk6hMIziw4NdZ4NysnNso6RHN+lZ/TVqYZuxVTrUAk0Wo8lAszCV4VQeQarLl0BSh1UjxXMJg35CTP2+igIPk2q3RFLx53V4VT74nZFVYRdcQFI5UOTpToHxSpvct4zbJoIsEm6Xe//h8tXUzzlRG/dqFMeQQ5djASUEv3aSEZkXQEJBTAGuk0jfB0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none 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=TwgcFSN5H9XNYCHDlIfvSpG/4AmwBQWjczjELm1qGak=; b=uILZ2OBqDwIzCOwEKsSjujRHv3lOipmgG2DZue1lAJNCvLyDRZPKBGrdEZhgMCqf5utxINR0LDD0pagOUdTUl728QsyiJ/tQjfA309na9ROjVcpT6HS1tKf/1sE+UeI0/bcT2PTT83VLKTVIkdG6AQ6dkGSBHEc137DDGP05UfM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB8596.namprd12.prod.outlook.com (2603:10b6:510:1b7::6) by SJ2PR12MB7846.namprd12.prod.outlook.com (2603:10b6:a03:4c9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.34; Tue, 12 Mar 2024 03:48:07 +0000 Received: from PH7PR12MB8596.namprd12.prod.outlook.com ([fe80::5f0d:af7:7f6b:9b9c]) by PH7PR12MB8596.namprd12.prod.outlook.com ([fe80::5f0d:af7:7f6b:9b9c%5]) with mapi id 15.20.7362.035; Tue, 12 Mar 2024 03:48:07 +0000 Content-Type: multipart/alternative; boundary="------------jdTebBWJdHE0ITgQQ0G9sr4p" Message-ID: Date: Tue, 12 Mar 2024 09:18:00 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] app/dma-perf: calrify incorrect NUMA config To: fengchengwen , dev@dpdk.org Cc: ferruh.yigit@amd.com, neerav.parikh@amd.com References: <20240306150204.1375-1-vipin.varghese@amd.com> <20240311060053.137-1-vipin.varghese@amd.com> <6ee9b198-4419-2016-a05b-4e1711d946a7@huawei.com> Content-Language: en-US From: "Varghese, Vipin" In-Reply-To: <6ee9b198-4419-2016-a05b-4e1711d946a7@huawei.com> X-ClientProxiedBy: PN2PR01CA0247.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:21a::14) To PH7PR12MB8596.namprd12.prod.outlook.com (2603:10b6:510:1b7::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB8596:EE_|SJ2PR12MB7846:EE_ X-MS-Office365-Filtering-Correlation-Id: b6c3349f-b212-4677-c726-08dc42473a89 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o5h/JvQ8jT0oqV9Gjom0Zm9qOYqYgXOvh6lhp3UBUs4LlewZuJ4SnUibTuC3yzF5nZzKaDod0OrjRQfH9WYdGi4dq49lfVEyrqITncrrOmE7SUkRSU+913Kv4jf94pBy93aiHECXs9/8+GJ1RLWv8conWCYxSud3wxmfer0Bt4o6OFh0VMftoFH5CNDJyphkO79pl6uXf/vpPennnmPc2iFYDrpKC6xG4kYuifPbv6U+3VzYVaDA4OtgAXzJMHahARA2qw7XZUDYi3JfyvanEk4uBYqfynb+PjcCKX3MAhQtJcmi/rHA4tSPT11mnJXCWeZfZpIV09c2/TIghfGZEJMDfT2XatZ9iEzvwOh2arYZ/x5XumFg335oxWojrO2/p/4ow7b9NJ9AsTD/iVdASf6v3BT7TLqYnpZVzdsdv1obECcQQ7rvB35KN92/RSAHlOFYLEmRQ+EGTl/wgiXREcQWrOhsVXqgRDnmxlX14VOrs00DeT+Pp1DgtS+YYFnkV5r0b5OJcF5EDR6nOuN+lqRUqNZBdJzUZ9ZmNhG5D4mXDjCgeW7xFshjLYNLJKeJYN+rShKPCuOP84jwE5DCN+NPeZqxdKrrXLK+roHW1X5BNymRU9Go+EZsgJUUS4t7PsEN3sH2W8D/JRTn8qDcPa10LbjnOuQgBsH33QEQaeQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR12MB8596.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MitpVDVtNXB2K0F4NDNNSFNqMUxTbWVVc3hONWdveVNndXJ2V2ZLbkdNYzlx?= =?utf-8?B?OXpCeDFVUFNPeWtPZlpqUFdVT3RrYUtRbzEwdDVjV2xjUVVWbnRRWjBUNEh6?= =?utf-8?B?N1JJNy9PSCtTRVlhMTMyRktmcXBZYWxHZURSR21IQ2U3b0pKeE1DUEFrcnNG?= =?utf-8?B?azlxNExHRkN1bGF4RUNuSitKU0kzeTVvNnBSZEIraG8xWTF2RG9GT01NMElC?= =?utf-8?B?Y1JYUkxLVm0vbDlsdWFaYnFsYkVZNHpxRm83MEQyeDZqSmdQT0pxK0lvUWc0?= =?utf-8?B?Q0JSNW9peWJEdENGWTlDR2Qwd1ZFRU1YOHVOdEllSmdZUzkwTFdhdHBtUlFJ?= =?utf-8?B?cjRWYXJDN2VvUytOYTFVKzBVYmlQKzNTSzdMeE9XdE5pRE1COWVEK2NMMThP?= =?utf-8?B?Y1RTUERkWmxyZ1VzTW5YeHRMZnlJMVFDcWVJV1F5MVZRWms3WXRxUGJQUjBx?= =?utf-8?B?UDB5dXptODl2UE85OUlDR01QSUxzeXRSbE16TVZYLytIMHlYZG5MTE5YZTVh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QXMvRVpCWTdGWC81eUsr?= =?utf-8?B?aXhNTEVGdzE1YVRrcEhvTG5wZktwek9Pb2pEd3N3c01OUW1hTTRJS0x1TGFm?= =?utf-8?B?MXZManUyaEdTeERTSWw2cUhjZm5nNm43QkhRVEU3NDFZZ3VLOG1Xajh3akNL?= =?utf-8?B?bXFPRU5YSnJsV2I1RFN4VDNONHFvUU44aVNBdFF0aVFmdFZKVDBjQUtPL2g3?= =?utf-8?B?SHNiQ3hkeThBTGkva282WS9YemMvUjR5L3d5WnpKNGh6N2VyeDhYNkFlYXhB?= =?utf-8?B?RTNPYUZnckY3T2hJV1p6eFBpSmdIcXptVjV6T2hDT3hmb0NvSVJvOFpPZDV0?= =?utf-8?B?c2YrRlF5UnBUclJOSXBabytraUY5QVhHUUtVQXF0OHdIYURUQUs2aUlyaGpB?= =?utf-8?B?aEJ6NENqZWZsNElrNDJPdU85c1hBbytmeWJ0QWt0MStjQ0pVc1drSlRqbU0w?= =?utf-8?B?SERraXpSRzZXTjdvZkREQjROd0NVWGw1WlVUMzBqTGFRa3liTFgzNDBGTzJL?= =?utf-8?B?U0tWeko3emRybi81UDJSQnJzdWhzNnlVVW1NMENoSm91Y2hsWFI1bHRVM1dV?= =?utf-8?B?NFdhM0xIUXNsLzNMUnRzd2YzTXZhczFqTFVwNENBQnd2THQ1eFFPbmNBenRr?= =?utf-8?B?MnpIYXQ2K25HQXlPMFdPNGRRNS9JbjIwR0JaZGxPVkdqU2NZcFpQOVBZdFlk?= =?utf-8?Q?9RB8kLIiEJY9rU3eW7fXJkSg/?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6c3349f-b212-4677-c726-08dc42473a89 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB8596.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2024 03:48:07.5569 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ByF13lLMB4IVbRC2r7Q5FANf3O1+hrrrCONBUi1YRjfN8Y3DB5ymR9n2e1h8xhOkOcwrd22/YRBbyhPR3/5G9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7846 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 --------------jdTebBWJdHE0ITgQQ0G9sr4p Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit >> diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c >> index 9b1f58c78c..b6d0dbe4c0 100644 >> --- a/app/test-dma-perf/benchmark.c >> +++ b/app/test-dma-perf/benchmark.c >> @@ -311,9 +311,14 @@ setup_memory_env(struct test_configure *cfg, struct rte_mbuf ***srcs, >> uint32_t nr_buf = cfg->nr_buf; >> >> 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"); >> + >> + bool isSrcNumaIncorrect = (cfg->src_numa_node >= nr_sockets); >> + bool isDstNumaIncorrect = (cfg->dst_numa_node >= nr_sockets); > The naming style needs to be adjusted, how about > bool is_src_numa_exceed, is_dst_numa_exceed; Ok, the naming convention used by me is `CamelCase`. One suggested from your end is `snake_case`. Does DPDK has a constrain it can not use CamelCase. > > And predefine the variable at the beginning of function, sort by length, some like: > > bool is_src_numa_exceed, is_dst_numa_exceed; > unsigned int buf_size = cfg->buf_size.cur; > uint32_t nr_buf = cfg->nr_buf; > unsigned int nr_sockets; > > nr_sockets = rte_socket_count(); > is_src_numa_exceed = > is_dst_numa_exceed = > if (xxx) > ... > >> + >> + if (isSrcNumaIncorrect || isDstNumaIncorrect) { >> + PRINT_ERR("Error: NUMA config exceeds the actual numa nodes for %s.\n", >> + (isSrcNumaIncorrect && isDstNumaIncorrect) ? "Source & Destination" : >> + (isSrcNumaIncorrect) ? "Source" : "Destination"); > Please don't capitalize the first letter of "Source" and "Destination" Can you please explain why? > > Thanks > >> return -1; >> } >> >> --------------jdTebBWJdHE0ITgQQ0G9sr4p Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit <snipped> 
diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
index 9b1f58c78c..b6d0dbe4c0 100644
--- a/app/test-dma-perf/benchmark.c
+++ b/app/test-dma-perf/benchmark.c
@@ -311,9 +311,14 @@ setup_memory_env(struct test_configure *cfg, struct rte_mbuf ***srcs,
      uint32_t nr_buf = cfg->nr_buf;

      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");
+
+     bool isSrcNumaIncorrect = (cfg->src_numa_node >= nr_sockets);
+     bool isDstNumaIncorrect = (cfg->dst_numa_node >= nr_sockets);
The naming style needs to be adjusted, how about
bool is_src_numa_exceed, is_dst_numa_exceed;

Ok, the naming convention used by me is `CamelCase`. One suggested from your end is `snake_case`.

Does DPDK has a constrain it can not use CamelCase.


And predefine the variable at the beginning of function, sort by length, some like:

        bool is_src_numa_exceed, is_dst_numa_exceed;
        unsigned int buf_size = cfg->buf_size.cur;
        uint32_t nr_buf = cfg->nr_buf;
        unsigned int nr_sockets;

        nr_sockets = rte_socket_count();
        is_src_numa_exceed =
        is_dst_numa_exceed =
        if (xxx)
                ...

+
+     if (isSrcNumaIncorrect || isDstNumaIncorrect) {
+             PRINT_ERR("Error: NUMA config exceeds the actual numa nodes for %s.\n",
+                     (isSrcNumaIncorrect && isDstNumaIncorrect) ? "Source & Destination" :
+                             (isSrcNumaIncorrect) ? "Source" : "Destination");
Please don't capitalize the first letter of "Source" and "Destination"

Can you please explain why?



Thanks

              return -1;
      }


--------------jdTebBWJdHE0ITgQQ0G9sr4p--