<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Georgia;
panose-1:2 4 5 2 5 4 5 2 3 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
h3
{mso-style-priority:9;
mso-style-link:"Heading 3 Char";
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:13.5pt;
font-family:"Calibri",sans-serif;
font-weight:bold;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.Heading3Char
{mso-style-name:"Heading 3 Char";
mso-style-priority:9;
mso-style-link:"Heading 3";
font-family:"Calibri",sans-serif;
font-weight:bold;}
span.kt
{mso-style-name:kt;}
span.o
{mso-style-name:o;}
span.n
{mso-style-name:n;}
span.p
{mso-style-name:p;}
span.cm
{mso-style-name:cm;}
span.k
{mso-style-name:k;}
span.pre
{mso-style-name:pre;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1829010818;
mso-list-template-ids:1729027120;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:2.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:2.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:3.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:3.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:4.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:4.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p>>Ok, the naming convention used by me is `CamelCase`. One suggested from your end is `snake_case`.<o:p></o:p></p>
<p>>Does DPDK has a constrain it can not use CamelCase.<o:p></o:p></p>
<p><o:p> </o:p></p>
<p>Please refer to:<o:p></o:p></p>
<p><a href="https://doc.dpdk.org/guides/contributing/coding_style.html">https://doc.dpdk.org/guides/contributing/coding_style.html</a><o:p></o:p></p>
<p>In particular:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-bottom-alt:auto;background:#FCFCFC"><b><span style="font-size:15.0pt;font-family:"Georgia",serif;color:#404040">1.5.4. Variable Declarations<o:p></o:p></span></b></p>
<p class="MsoNormal" style="margin-bottom:.25in;line-height:18.0pt;background:#FCFCFC">
<span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#404040">In declarations, do not put any whitespace between asterisks and adjacent tokens, except for tokens that are identifiers related to types. (These identifiers are the names of basic
types, type qualifiers, and typedef-names other than the one being declared.) Separate these identifiers from asterisks using a single space.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:.25in;line-height:18.0pt;background:#FCFCFC">
<span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#404040">For example:<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#F8F8F8"><span style="font-size:9.0pt;font-family:Consolas;color:#B00040">int</span><span style="font-size:9.0pt;font-family:Consolas;color:#404040">
</span><span style="font-size:9.0pt;font-family:Consolas;color:#666666">*</span><span style="font-size:9.0pt;font-family:Consolas;color:#404040">x;
</span><i><span style="font-size:9.0pt;font-family:Consolas;color:#408080">/* no space after asterisk */</span></i><span style="font-size:9.0pt;font-family:Consolas;color:#404040"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:#F8F8F8"><span style="font-size:9.0pt;font-family:Consolas;color:#B00040">int</span><span style="font-size:9.0pt;font-family:Consolas;color:#404040">
</span><span style="font-size:9.0pt;font-family:Consolas;color:#666666">*</span><span style="font-size:9.0pt;font-family:Consolas;color:#404040">
</span><b><span style="font-size:9.0pt;font-family:Consolas;color:green">const</span></b><span style="font-size:9.0pt;font-family:Consolas;color:#404040"> x;
</span><i><span style="font-size:9.0pt;font-family:Consolas;color:#408080">/* space after asterisk when using a type qualifier */</span></i><span style="font-size:9.0pt;font-family:Consolas;color:#404040"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.25in;text-indent:-.25in;line-height:18.0pt;mso-list:l0 level1 lfo1;background:#FCFCFC">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#404040"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#404040">All externally-visible variables should have an </span><span style="font-size:9.0pt;font-family:Consolas;color:#E74C3C;border:solid #E1E4E5 1.0pt;padding:2.0pt;background:white">rte_</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#404040"> prefix
in the name to avoid namespace collisions.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.25in;text-indent:-.25in;line-height:18.0pt;mso-list:l0 level1 lfo1;background:#FCFCFC">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#404040"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#404040">Do not use uppercase letters - either in the form of ALL_UPPERCASE, or CamelCase - in variable names. Lower-case letters and underscores only.<o:p></o:p></span></p>
<p><o:p> </o:p></p>
<p><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Varghese, Vipin <vipin.varghese@amd.com> <br>
<b>Sent:</b> Tuesday, March 12, 2024 3:48 AM<br>
<b>To:</b> Fengchengwen <fengchengwen@huawei.com>; dev@dpdk.org<br>
<b>Cc:</b> ferruh.yigit@amd.com; neerav.parikh@amd.com<br>
<b>Subject:</b> Re: [PATCH v2] app/dma-perf: calrify incorrect NUMA config<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><snipped> <o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c<o:p></o:p></pre>
<pre>index 9b1f58c78c..b6d0dbe4c0 100644<o:p></o:p></pre>
<pre>--- a/app/test-dma-perf/benchmark.c<o:p></o:p></pre>
<pre>+++ b/app/test-dma-perf/benchmark.c<o:p></o:p></pre>
<pre>@@ -311,9 +311,14 @@ setup_memory_env(struct test_configure *cfg, struct rte_mbuf ***srcs,<o:p></o:p></pre>
<pre> uint32_t nr_buf = cfg->nr_buf;<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> nr_sockets = rte_socket_count();<o:p></o:p></pre>
<pre>- if (cfg->src_numa_node >= nr_sockets ||<o:p></o:p></pre>
<pre>- cfg->dst_numa_node >= nr_sockets) {<o:p></o:p></pre>
<pre>- printf("Error: Source or destination numa exceeds the acture numa nodes.\n");<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+ bool isSrcNumaIncorrect = (cfg->src_numa_node >= nr_sockets);<o:p></o:p></pre>
<pre>+ bool isDstNumaIncorrect = (cfg->dst_numa_node >= nr_sockets);<o:p></o:p></pre>
</blockquote>
<pre><o:p> </o:p></pre>
<pre>The naming style needs to be adjusted, how about<o:p></o:p></pre>
<pre>bool is_src_numa_exceed, is_dst_numa_exceed;<o:p></o:p></pre>
</blockquote>
<p>Ok, the naming convention used by me is `CamelCase`. One suggested from your end is `snake_case`.<o:p></o:p></p>
<p>Does DPDK has a constrain it can not use CamelCase.<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>And predefine the variable at the beginning of function, sort by length, some like:<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> bool is_src_numa_exceed, is_dst_numa_exceed;<o:p></o:p></pre>
<pre> unsigned int buf_size = cfg->buf_size.cur;<o:p></o:p></pre>
<pre> uint32_t nr_buf = cfg->nr_buf;<o:p></o:p></pre>
<pre> unsigned int nr_sockets;<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> nr_sockets = rte_socket_count();<o:p></o:p></pre>
<pre> is_src_numa_exceed =<o:p></o:p></pre>
<pre> is_dst_numa_exceed =<o:p></o:p></pre>
<pre> if (xxx)<o:p></o:p></pre>
<pre> ...<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>+<o:p></o:p></pre>
<pre>+ if (isSrcNumaIncorrect || isDstNumaIncorrect) {<o:p></o:p></pre>
<pre>+ PRINT_ERR("Error: NUMA config exceeds the actual numa nodes for %s.\n",<o:p></o:p></pre>
<pre>+ (isSrcNumaIncorrect && isDstNumaIncorrect) ? "Source & Destination" :<o:p></o:p></pre>
<pre>+ (isSrcNumaIncorrect) ? "Source" : "Destination");<o:p></o:p></pre>
</blockquote>
<pre><o:p> </o:p></pre>
<pre>Please don't capitalize the first letter of "Source" and "Destination"<o:p></o:p></pre>
</blockquote>
<p>Can you please explain why?<o:p></o:p></p>
<p><o:p> </o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Thanks<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre> return -1;<o:p></o:p></pre>
<pre> }<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
</blockquote>
</blockquote>
</div>
</div>
</body>
</html>