<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<snipped> <span style="white-space: pre-wrap">
</span>
<blockquote type="cite" cite="mid:6ee9b198-4419-2016-a05b-4e1711d946a7@huawei.com">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">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);
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
The naming style needs to be adjusted, how about
bool is_src_numa_exceed, is_dst_numa_exceed;</pre>
</blockquote>
<p>Ok, the naming convention used by me is `CamelCase`. One
suggested from your end is `snake_case`.</p>
<p>Does DPDK has a constrain it can not use CamelCase.</p>
<blockquote type="cite" cite="mid:6ee9b198-4419-2016-a05b-4e1711d946a7@huawei.com">
<pre class="moz-quote-pre" wrap="">
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)
...
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">+
+ if (isSrcNumaIncorrect || isDstNumaIncorrect) {
+ PRINT_ERR("Error: NUMA config exceeds the actual numa nodes for %s.\n",
+ (isSrcNumaIncorrect && isDstNumaIncorrect) ? "Source & Destination" :
+ (isSrcNumaIncorrect) ? "Source" : "Destination");
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Please don't capitalize the first letter of "Source" and "Destination"</pre>
</blockquote>
<p>Can you please explain why?<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:6ee9b198-4419-2016-a05b-4e1711d946a7@huawei.com">
<pre class="moz-quote-pre" wrap="">
Thanks
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""> return -1;
}
</pre>
</blockquote>
</blockquote>
</body>
</html>