<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
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";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></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="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></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><span style="font-size:11.0pt">From:</span></b><span style="font-size:11.0pt"> Huichao cai <chcchc88@163.com>
<br>
<b>Sent:</b> Tuesday, October 22, 2024 4:58 PM<br>
<b>To:</b> Jerin Jacob <jerinj@marvell.com>; Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; yanzhirun_163@163.com<br>
<b>Cc:</b> dev@dpdk.org<br>
<b>Subject:</b> [EXTERNAL] [PATCH] test/graph: fix graph autotest second test failure<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="mso-line-height-alt:.75pt"><span style="font-size:1.0pt;color:white">Start dpdk-test, execute the graph_autotest test command for the first time, the result is successful, and then test again, the result is always failing, modify
this problem to make this test command idempotent. Signed-off-by: Huichao cai <chcchc88@ 163. com><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-line-height-alt:.75pt"><span style="font-size:1.0pt;color:white"><o:p></o:p></span></p>
</div>
<div>
<pre style="white-space:pre-wrap"><span style="font-size:11.0pt;font-family:"Arial",sans-serif">Start dpdk-test, execute the graph_autotest test command for<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">the first time, the result is successful, and then test again,<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">the result is always failing, modify this problem to make this<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">test command idempotent.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">Signed-off-by: Huichao cai <<a href="mailto:chcchc88@163.com">chcchc88@163.com</a>><o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">---<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> app/test/test_graph.c | 21 ++++++++++++---------<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> 1 file changed, 12 insertions(+), 9 deletions(-)<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">diff --git a/app/test/test_graph.c b/app/test/test_graph.c<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">index 2840a25..16a1a90 100644<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">--- a/app/test/test_graph.c<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+++ b/app/test/test_graph.c<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">@@ -552,7 +552,7 @@ struct test_node_register {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> tm->test_node[0].idx = node_id;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> dummy_id = rte_node_clone(node_id, "test_node00");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">- if (rte_node_is_invalid(dummy_id)) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ if (rte_node_is_invalid(dummy_id) && (rte_errno != EEXIST)) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> printf("Got invalid id when clone, Expecting fail\n");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> return -1;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">I think cloned nodes are not being added to any graph, so, not being freed. So, we are seeing this issue.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Instead of suppressing the errors, could you create a dummy graph and add the nodes to graph and call graph destroy.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">This will free the cloned nodes and we don’t see this problem.<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">@@ -565,12 +565,14 @@ struct test_node_register {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> for (i = 1; i < MAX_NODES; i++) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">- tm->test_node[i].idx =<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">- rte_node_clone(node_id, tm->test_node[i].node.name);<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">- if (rte_node_is_invalid(tm->test_node[i].idx)) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ dummy_id = rte_node_clone(node_id, tm->test_node[i].node.name);<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ if (rte_node_is_invalid(dummy_id) && (rte_errno != EEXIST)) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> printf("Got invalid node id\n");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> return -1;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ if (!rte_node_is_invalid(dummy_id))<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ tm->test_node[i].idx = dummy_id;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> /* Clone from cloned node should fail */<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">@@ -640,7 +642,7 @@ struct test_node_register {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> node_id = rte_node_from_name("test_node00");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> dummy_node_id = rte_node_clone(node_id, "dummy_node");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">- if (rte_node_is_invalid(dummy_node_id)) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ if (rte_node_is_invalid(dummy_node_id) && (rte_errno != EEXIST)) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> printf("Got invalid node id\n");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> return -1;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">@@ -672,7 +674,7 @@ struct test_node_register {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> main_graph_id = rte_graph_from_name("worker0");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> if (main_graph_id == RTE_GRAPH_ID_INVALID) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> printf("Must create main graph first\n");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">- ret = -1;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ return -1;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> graph_conf.dispatch.mp_capacity = 1024;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">@@ -682,7 +684,7 @@ struct test_node_register {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> if (cloned_graph_id == RTE_GRAPH_ID_INVALID) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> printf("Graph creation failed with error = %d\n", rte_errno);<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">- ret = -1;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ return -1;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> if (strcmp(rte_graph_id_to_name(cloned_graph_id), "worker0-cloned-test0")) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">@@ -787,7 +789,7 @@ struct test_node_register {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", &graph_conf);<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> node = rte_graph_node_get(cloned_graph_id, nid);<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">- if (node->dispatch.lcore_id != worker_lcore) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ if (!node || node->dispatch.lcore_id != worker_lcore) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> printf("set node affinity failed\n");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> ret = -1;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">@@ -859,7 +861,8 @@ struct test_node_register {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> graph = rte_graph_lookup("worker0-cloned-test3");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">- if (rte_graph_worker_model_get(graph) != RTE_GRAPH_MODEL_MCORE_DISPATCH) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ if (!graph || rte_graph_worker_model_get(graph) !=<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">+ RTE_GRAPH_MODEL_MCORE_DISPATCH) {<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> printf("Get graph worker model failed\n");<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> ret = -1;<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> }<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">-- <o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif">1.8.3.1<o:p></o:p></span></pre>
<pre><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></pre>
</div>
</div>
</div>
</body>
</html>