DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] test/graph: fix graph autotest second test failure
@ 2024-10-22 11:28 Huichao cai
  2024-10-22 13:38 ` [EXTERNAL] " Kiran Kumar Kokkilagadda
  0 siblings, 1 reply; 4+ messages in thread
From: Huichao cai @ 2024-10-22 11:28 UTC (permalink / raw)
  To: jerinj, kirankumark, ndabilpuram, yanzhirun_163; +Cc: dev

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>
---
 app/test/test_graph.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/app/test/test_graph.c b/app/test/test_graph.c
index 2840a25..16a1a90 100644
--- a/app/test/test_graph.c
+++ b/app/test/test_graph.c
@@ -552,7 +552,7 @@ struct test_node_register {
 	tm->test_node[0].idx = node_id;
 
 	dummy_id = rte_node_clone(node_id, "test_node00");
-	if (rte_node_is_invalid(dummy_id)) {
+	if (rte_node_is_invalid(dummy_id) && (rte_errno != EEXIST)) {
 		printf("Got invalid id when clone, Expecting fail\n");
 		return -1;
 	}
@@ -565,12 +565,14 @@ struct test_node_register {
 	}
 
 	for (i = 1; i < MAX_NODES; i++) {
-		tm->test_node[i].idx =
-			rte_node_clone(node_id, tm->test_node[i].node.name);
-		if (rte_node_is_invalid(tm->test_node[i].idx)) {
+		dummy_id = rte_node_clone(node_id, tm->test_node[i].node.name);
+		if (rte_node_is_invalid(dummy_id) && (rte_errno != EEXIST)) {
 			printf("Got invalid node id\n");
 			return -1;
 		}
+
+		if (!rte_node_is_invalid(dummy_id))
+			tm->test_node[i].idx = dummy_id;
 	}
 
 	/* Clone from cloned node should fail */
@@ -640,7 +642,7 @@ struct test_node_register {
 
 	node_id = rte_node_from_name("test_node00");
 	dummy_node_id = rte_node_clone(node_id, "dummy_node");
-	if (rte_node_is_invalid(dummy_node_id)) {
+	if (rte_node_is_invalid(dummy_node_id) && (rte_errno != EEXIST)) {
 		printf("Got invalid node id\n");
 		return -1;
 	}
@@ -672,7 +674,7 @@ struct test_node_register {
 	main_graph_id = rte_graph_from_name("worker0");
 	if (main_graph_id == RTE_GRAPH_ID_INVALID) {
 		printf("Must create main graph first\n");
-		ret = -1;
+		return -1;
 	}
 
 	graph_conf.dispatch.mp_capacity = 1024;
@@ -682,7 +684,7 @@ struct test_node_register {
 
 	if (cloned_graph_id == RTE_GRAPH_ID_INVALID) {
 		printf("Graph creation failed with error = %d\n", rte_errno);
-		ret = -1;
+		return -1;
 	}
 
 	if (strcmp(rte_graph_id_to_name(cloned_graph_id), "worker0-cloned-test0")) {
@@ -787,7 +789,7 @@ struct test_node_register {
 	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", &graph_conf);
 	node = rte_graph_node_get(cloned_graph_id, nid);
 
-	if (node->dispatch.lcore_id != worker_lcore) {
+	if (!node || node->dispatch.lcore_id != worker_lcore) {
 		printf("set node affinity failed\n");
 		ret = -1;
 	}
@@ -859,7 +861,8 @@ struct test_node_register {
 	}
 
 	graph = rte_graph_lookup("worker0-cloned-test3");
-	if (rte_graph_worker_model_get(graph) != RTE_GRAPH_MODEL_MCORE_DISPATCH) {
+	if (!graph || rte_graph_worker_model_get(graph) !=
+		    RTE_GRAPH_MODEL_MCORE_DISPATCH) {
 		printf("Get graph worker model failed\n");
 		ret = -1;
 	}
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [EXTERNAL] [PATCH] test/graph: fix graph autotest second test failure
  2024-10-22 11:28 [PATCH] test/graph: fix graph autotest second test failure Huichao cai
@ 2024-10-22 13:38 ` Kiran Kumar Kokkilagadda
  2024-10-23  2:44   ` Huichao Cai
  0 siblings, 1 reply; 4+ messages in thread
From: Kiran Kumar Kokkilagadda @ 2024-10-22 13:38 UTC (permalink / raw)
  To: Huichao cai, Jerin Jacob, Nithin Kumar Dabilpuram, yanzhirun_163; +Cc: dev

[-- Attachment #1: Type: text/plain, Size: 5196 bytes --]



From: Huichao cai <chcchc88@163.com>
Sent: Tuesday, October 22, 2024 4:58 PM
To: Jerin Jacob <jerinj@marvell.com>; Kiran Kumar Kokkilagadda <kirankumark@marvell.com>; Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; yanzhirun_163@163.com
Cc: dev@dpdk.org
Subject: [EXTERNAL] [PATCH] test/graph: fix graph autotest second test failure

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>


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<mailto:chcchc88@163.com>>

---

 app/test/test_graph.c | 21 ++++++++++++---------

 1 file changed, 12 insertions(+), 9 deletions(-)



diff --git a/app/test/test_graph.c b/app/test/test_graph.c

index 2840a25..16a1a90 100644

--- a/app/test/test_graph.c

+++ b/app/test/test_graph.c

@@ -552,7 +552,7 @@ struct test_node_register {

              tm->test_node[0].idx = node_id;



              dummy_id = rte_node_clone(node_id, "test_node00");

-            if (rte_node_is_invalid(dummy_id)) {

+           if (rte_node_is_invalid(dummy_id) && (rte_errno != EEXIST)) {

                             printf("Got invalid id when clone, Expecting fail\n");

                             return -1;

              }



I think cloned nodes are not being added to any graph, so, not being freed. So, we are seeing this issue.

Instead of suppressing the errors, could you create a dummy graph and add the nodes to graph and call graph destroy.

This will free the cloned nodes and we don’t see this problem.







@@ -565,12 +565,14 @@ struct test_node_register {

              }



              for (i = 1; i < MAX_NODES; i++) {

-                            tm->test_node[i].idx =

-                                           rte_node_clone(node_id, tm->test_node[i].node.name);

-                            if (rte_node_is_invalid(tm->test_node[i].idx)) {

+                           dummy_id = rte_node_clone(node_id, tm->test_node[i].node.name);

+                           if (rte_node_is_invalid(dummy_id) && (rte_errno != EEXIST)) {

                                            printf("Got invalid node id\n");

                                            return -1;

                             }

+

+                           if (!rte_node_is_invalid(dummy_id))

+                                          tm->test_node[i].idx = dummy_id;

              }



              /* Clone from cloned node should fail */

@@ -640,7 +642,7 @@ struct test_node_register {



              node_id = rte_node_from_name("test_node00");

              dummy_node_id = rte_node_clone(node_id, "dummy_node");

-            if (rte_node_is_invalid(dummy_node_id)) {

+           if (rte_node_is_invalid(dummy_node_id) && (rte_errno != EEXIST)) {

                             printf("Got invalid node id\n");

                             return -1;

              }

@@ -672,7 +674,7 @@ struct test_node_register {

              main_graph_id = rte_graph_from_name("worker0");

              if (main_graph_id == RTE_GRAPH_ID_INVALID) {

                             printf("Must create main graph first\n");

-                            ret = -1;

+                           return -1;

              }



              graph_conf.dispatch.mp_capacity = 1024;

@@ -682,7 +684,7 @@ struct test_node_register {



              if (cloned_graph_id == RTE_GRAPH_ID_INVALID) {

                             printf("Graph creation failed with error = %d\n", rte_errno);

-                            ret = -1;

+                           return -1;

              }



              if (strcmp(rte_graph_id_to_name(cloned_graph_id), "worker0-cloned-test0")) {

@@ -787,7 +789,7 @@ struct test_node_register {

              cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", &graph_conf);

              node = rte_graph_node_get(cloned_graph_id, nid);



-            if (node->dispatch.lcore_id != worker_lcore) {

+           if (!node || node->dispatch.lcore_id != worker_lcore) {

                             printf("set node affinity failed\n");

                             ret = -1;

              }

@@ -859,7 +861,8 @@ struct test_node_register {

              }



              graph = rte_graph_lookup("worker0-cloned-test3");

-            if (rte_graph_worker_model_get(graph) != RTE_GRAPH_MODEL_MCORE_DISPATCH) {

+           if (!graph || rte_graph_worker_model_get(graph) !=

+                               RTE_GRAPH_MODEL_MCORE_DISPATCH) {

                             printf("Get graph worker model failed\n");

                             ret = -1;

              }

--

1.8.3.1



[-- Attachment #2: Type: text/html, Size: 23371 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re:RE: [EXTERNAL] [PATCH] test/graph: fix graph autotest second test failure
  2024-10-22 13:38 ` [EXTERNAL] " Kiran Kumar Kokkilagadda
@ 2024-10-23  2:44   ` Huichao Cai
  2024-10-23 12:42     ` Kiran Kumar Kokkilagadda
  0 siblings, 1 reply; 4+ messages in thread
From: Huichao Cai @ 2024-10-23  2:44 UTC (permalink / raw)
  To: Kiran Kumar Kokkilagadda
  Cc: Jerin Jacob, Nithin Kumar Dabilpuram, yanzhirun_163, dev

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

At present rte_graph_destroy will only clean up the struct rte_node and struct graph_node,

not the struct node, rte_node_clone creates the struct node, inserts the global node_list linked list,

there is no function to clean up the node_list linked list, if you want to clean up the node

created by rte_node_clone, Perhaps a new function needs to be added to clean up node_list linked lists.

Or write a test case function to clean up the nodes that are cloned by this test case.

[-- Attachment #2: Type: text/html, Size: 2351 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Re:RE: [EXTERNAL] [PATCH] test/graph: fix graph autotest second test failure
  2024-10-23  2:44   ` Huichao Cai
@ 2024-10-23 12:42     ` Kiran Kumar Kokkilagadda
  0 siblings, 0 replies; 4+ messages in thread
From: Kiran Kumar Kokkilagadda @ 2024-10-23 12:42 UTC (permalink / raw)
  To: Huichao Cai; +Cc: Jerin Jacob, Nithin Kumar Dabilpuram, yanzhirun_163, dev



> -----Original Message-----
> From: Huichao Cai <chcchc88@163.com>
> Sent: Wednesday, October 23, 2024 8:15 AM
> To: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
> Cc: Jerin Jacob <jerinj@marvell.com>; Nithin Kumar Dabilpuram
> <ndabilpuram@marvell.com>; yanzhirun_163@163.com; dev@dpdk.org
> Subject: Re:RE: [EXTERNAL] [PATCH] test/graph: fix graph autotest second test
> failure
> 
> At present rte_graph_destroy will only clean up the struct rte_node and struct
> graph_node, not the struct node, rte_node_clone creates the struct node,
> inserts the global node_list linked list, there is no function to clean up the
> node_list 
> 
> At present rte_graph_destroy will only clean up the struct rte_node and struct
> graph_node,
> 
> not the struct node, rte_node_clone creates the struct node, inserts the global
> node_list linked list,
> 
> there is no function to clean up the node_list linked list, if you want to clean up
> the node
> 
> created by rte_node_clone, Perhaps a new function needs to be added to
> clean up node_list linked lists.
> 
> Or write a test case function to clean up the nodes that are cloned by this test
> case.

It makes sense to have an API to clean up the nodes. Are you planning to add this?
If not, we can plan and add new API.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-23 12:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-22 11:28 [PATCH] test/graph: fix graph autotest second test failure Huichao cai
2024-10-22 13:38 ` [EXTERNAL] " Kiran Kumar Kokkilagadda
2024-10-23  2:44   ` Huichao Cai
2024-10-23 12:42     ` Kiran Kumar Kokkilagadda

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).