DPDK patches and discussions
 help / color / mirror / Atom feed
From: Vipin Varghese <vipin.varghese@amd.com>
To: <dev@dpdk.org>, <fengchengwen@huawei.com>,
	<konstantin.ananyev@huawei.com>
Cc: <ferruh.yigit@amd.com>, <neerav.parikh@amd.com>
Subject: [PATCH v3] app/dma-perf: calrify incorrect NUMA config
Date: Wed, 20 Mar 2024 07:10:53 +0530	[thread overview]
Message-ID: <20240320014053.1040-1-vipin.varghese@amd.com> (raw)
In-Reply-To: <20240311060053.137-1-vipin.varghese@amd.com>

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 <vipin.varghese@amd.com>
---

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;
 	}
 
-- 
2.39.3


      parent reply	other threads:[~2024-03-20  1:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 15:02 [PATCH] " Vipin Varghese
2024-03-07 13:19 ` fengchengwen
2024-03-07 16:06   ` Varghese, Vipin
2024-03-11  6:00 ` [PATCH v2] " Vipin Varghese
2024-03-12  2:10   ` fengchengwen
2024-03-12  3:48     ` Varghese, Vipin
2024-03-13  9:37       ` Konstantin Ananyev
2024-03-20  1:14       ` Varghese, Vipin
2024-03-20  1:40   ` Vipin Varghese [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240320014053.1040-1-vipin.varghese@amd.com \
    --to=vipin.varghese@amd.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=ferruh.yigit@amd.com \
    --cc=konstantin.ananyev@huawei.com \
    --cc=neerav.parikh@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).