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 6A26543C5D; Tue, 12 Mar 2024 03:10:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF5D840633; Tue, 12 Mar 2024 03:10:45 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id 4A417402E6 for ; Tue, 12 Mar 2024 03:10:43 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4TtxrG1vWpz1Z1bt; Tue, 12 Mar 2024 10:08:14 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id A904B1A0172; Tue, 12 Mar 2024 10:10:40 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 12 Mar 2024 10:10:40 +0800 Subject: Re: [PATCH v2] app/dma-perf: calrify incorrect NUMA config To: Vipin Varghese , CC: , References: <20240306150204.1375-1-vipin.varghese@amd.com> <20240311060053.137-1-vipin.varghese@amd.com> From: fengchengwen Message-ID: <6ee9b198-4419-2016-a05b-4e1711d946a7@huawei.com> Date: Tue, 12 Mar 2024 10:10:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20240311060053.137-1-vipin.varghese@amd.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) 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 Hi Vipin, On 2024/3/11 14:00, Vipin Varghese wrote: > 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` > > Current changes helps to rectify the same by using `PRINT_ERR` instead > of printf. > > Signed-off-by: Vipin Varghese > > 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 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; 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" Thanks > return -1; > } > >