From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 08FD545B9F; Tue, 22 Oct 2024 13:28:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98BF44029A; Tue, 22 Oct 2024 13:28:33 +0200 (CEST) Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) by mails.dpdk.org (Postfix) with ESMTP id D14C040273 for ; Tue, 22 Oct 2024 13:28:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=BKChtOeL+tBLCcKRNA 6v+ZV1lCmfp+Sh5AmMXG6vTV4=; b=LXTPseXOXR73S+OljC+mXo6sxZkwOBIAHQ mUm0kqNRAEcDP6kFGKf6uoogdk/UeerLuesQlu9jZtb5W8yIBQYSfidYlcZRwwtG L+BOM2IOrJLGUntYqjujC85hj9FeusgV/bPpgH1mBXfKRw5lvglmzaGHignzpo5w sDptBVuME= Received: from bogon.localdomain (unknown [124.127.58.139]) by gzga-smtp-mtada-g0-2 (Coremail) with SMTP id _____wDX_vRSjBdnLim7Cg--.9899S2; Tue, 22 Oct 2024 19:28:27 +0800 (CST) From: Huichao cai To: jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com, yanzhirun_163@163.com Cc: dev@dpdk.org Subject: [PATCH] test/graph: fix graph autotest second test failure Date: Tue, 22 Oct 2024 19:28:05 +0800 Message-Id: <1729596485-65675-1-git-send-email-chcchc88@163.com> X-Mailer: git-send-email 1.8.3.1 X-CM-TRANSID: _____wDX_vRSjBdnLim7Cg--.9899S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxAFW7Kw47Kr1xKFW3uFyUWrg_yoW5AFyxpa 13KayYv3yftw1rWrZYqF48GFW3Kr18Jw42qr95J3W2yFZxJryxCr17WryYqFy3JrWkZws5 ua1UGw17KrnrWaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jYnmiUUUUU= X-Originating-IP: [124.127.58.139] X-CM-SenderInfo: pfkfuxrfyyqiywtou0bp/1tbiMR+AF2cXiNk-DQAAsq X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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