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 D1ADB45BA2; Tue, 22 Oct 2024 15:38:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE0FE402E4; Tue, 22 Oct 2024 15:38:58 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 2A8F44029A for ; Tue, 22 Oct 2024 15:38:57 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49MCQ6xN016088; Tue, 22 Oct 2024 06:38:50 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2049.outbound.protection.outlook.com [104.47.70.49]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 42ec25057w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Oct 2024 06:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GD3I9b91p4RgfgYCyDVwSCFhacVrFDh04R4GwIoMjXVqfy/vJJzG/M2cHx8mHFT0At+Z1qk5jz3yBFqRCLVq0dOklf+jZt5mgiCu3xNSm2jheQsHdLGIHRHrwBeBdFf3RYInwDf9hmixPZNSPkYFUTgHUSPS3GGlhh5cTHWeLGkdLJLexLLaXBkDuq38+ZxebKSzFJqYtBMubpn0SgYCdp5PllsAnzsHhljezhwdnkg26SFR60uGp1K3oVf/mYMCvU6Rvv3403MKHVJ3XdSmFZhFBN88l7vS3DWrJWoN/fUJj/6cH53R75tgLMfD02kUCWbqpM5R6v+ezHN42HPJbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0EB9b0AiZpN4Qpk7EZ0kGuHkMgFxyIRvEoa63+os1lg=; b=BEf3yt3XYcEuop6e+4Gc/3lYNplYQlsT0s4OJM/PNWGRX8EnRD6C0kUifkZKXbfJZdJmhgyXyaJBVRw9J1iNPa05BoIZ6YqZY7RNuRGPuJ7OR040O6fux7JyB68UPBpofwH28LG6uMSx42j5G7Ku3O+C03wZjC197G1pF4l3nI3O2shjRlLNA4i0CoqVcoCEntbD6PdloP79yzqRbXSSZWx0VfBYMHlaKXAlFYZXTCcSCcMmDJzNTOeuFIoYIbebRrGzVKNzWhnT/HHwXnixVd8FtxN72JzzVfpEqk9gDYTx7aZwfXfu3O65g+vjGV/CL9s/eIYhAGJNp/jP7q4anA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0EB9b0AiZpN4Qpk7EZ0kGuHkMgFxyIRvEoa63+os1lg=; b=jTqPnKAZiIgJfUOWO1Lxe+hsQAp99m4CK8ZlEX1DikBXNrLvBLvdqt15qjYb3M4ihBAOW3pxPSLucIdLWmx+lVP+6mRwO8IQrvXBm4HtWMcP7XtRscry7C+JTOAbnOJmh3zMpXxHRauU3iLfTc1dDqZtguqxA75CLH5BoKis1h0= Received: from PH0PR18MB5071.namprd18.prod.outlook.com (2603:10b6:510:16b::15) by DM4PR18MB4176.namprd18.prod.outlook.com (2603:10b6:5:393::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 13:38:45 +0000 Received: from PH0PR18MB5071.namprd18.prod.outlook.com ([fe80::25e:7:91b:8f1c]) by PH0PR18MB5071.namprd18.prod.outlook.com ([fe80::25e:7:91b:8f1c%5]) with mapi id 15.20.8069.027; Tue, 22 Oct 2024 13:38:45 +0000 From: Kiran Kumar Kokkilagadda To: Huichao cai , Jerin Jacob , Nithin Kumar Dabilpuram , "yanzhirun_163@163.com" CC: "dev@dpdk.org" Subject: RE: [EXTERNAL] [PATCH] test/graph: fix graph autotest second test failure Thread-Topic: [EXTERNAL] [PATCH] test/graph: fix graph autotest second test failure Thread-Index: AQHbJHWLHeknVc3poUOWQCo25lN4fLKSxbag Date: Tue, 22 Oct 2024 13:38:45 +0000 Message-ID: References: <1729596485-65675-1-git-send-email-chcchc88@163.com> In-Reply-To: <1729596485-65675-1-git-send-email-chcchc88@163.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR18MB5071:EE_|DM4PR18MB4176:EE_ x-ms-office365-filtering-correlation-id: 3b79b133-81b3-4c40-06fe-08dcf29ed9fc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|366016|1800799024|38070700018|8096899003; x-microsoft-antispam-message-info: =?utf-8?B?QjRaZkF5ZVFlRlAxLy8yaEZ6M3lWRU1RenJMVkdsZy9VY2tyZGthd2dDWkVr?= =?utf-8?B?bUJWMEVGdlF3N0cwQ2xkZGlrL2diK3NsQmRuQXFiSmt2TlAzTlRESjJENGs2?= =?utf-8?B?bEpzcnpHb1NEOXlxQmtDZG1Pd0lxNzdVeURCMzg2NjBJMWxnYTNYcUNZa1VH?= =?utf-8?B?S1U4YVdhVHhtN1ozczdPd01GSFR0TVJoOXpMVmh6djBzaWtTd3lPME5VeTVI?= =?utf-8?B?L3ZvTXBO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kQjZMSFZibU9v?= =?utf-8?B?ek50NVA0dExUQ1RUNFg3ZTYwclYySDJrZjdhVWxYMVhDTmdDamE0OElNb0d6?= =?utf-8?B?VElkUDladEoxMGlWRjh1T1BUYXR3QUkvZjNqMU1LT3VmNDhubzRRSG9zaGM4?= =?utf-8?B?N0pSYTZpeStmbk92c0pjQnRNZy9kNUtra1VuSXhST1gyVFU3WWFoQXFWcE9j?= =?utf-8?B?STY5NjhicTZ3RDI0V3VjSndKTEpWV2tGN1FmSEtoV0E3U1ZtUXg5M2laZjhJ?= =?utf-8?B?T3Bzci9rUklCODZ5OTlNdk82ZzZkYWt2clM3SlphY0lxYlc5bzBYVTNCSTk2?= =?utf-8?B?YlFCTElhZ2pLekZ1Q2tnSUZ4aUhwdmp6amZ6V0ZPdS9rZk53N0FMQTVpOTI2?= =?utf-8?B?bnpwN25nZGJOeEpaZ1RVT1pydCs0eGFmWUVXK0hWaFovMWpPaGVKeU9JQTVV?= =?utf-8?B?UWhqN21sQXhqa2dIaVdtSG53ek1GbmFXclY4dGpqdjVCUHVzTHoxaTZpalJ1?= =?utf-8?B?NDhxdVowVkhRRTRaeEJwMW50aThrMVFiWEFmL2xsYldmZXl4ZlpNWCsrYWJy?= =?utf-8?B?TTlML2ZXb0k4N3ZpNm9Jb2dnWWppNzdKWC9xYXdsaklBTTYrc2VTcmtJR0VH?= =?utf-8?B?a0lkQ3hkNjR2VmRwZzVJK1ArUjB6d1FORnpHNURUVU1ydytLaFRuQSswWkVU?= =?utf-8?B?NHBpN1hzeCt5ejhKZ2JMZWxMclczVnpaSE9jRlAxUlliMEh4YzlycWxvbFo1?= =?utf-8?Q?H59b/vZcpItM6?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB5071.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024)(38070700018)(8096899003); DIR:OUT; SFP:1102; x-ms-exchange-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XEzYytq?= =?utf-8?B?UXp2TmJwU0Q4b0hTcWRtNCswbHpaMGd1V3U1VS9kTGJvbDJPemsvbFl3RzB5?= =?utf-8?B?VG9POGpEOGFQWE84SitGK21iV1I2ejMvUUhOTU50RnlDQzIyYytFS2s5d2tq?= =?utf-8?B?S09SL1NLN0dOOFZXSW9HRG1NejJRWHNNeTdGSmFBaFF0b2tLdzEzT2JIRmx0?= =?utf-8?B?czlUb3FyWTZKQU1JM3BFTkhnckw3M0h1R1kwQ3VTZU01aENZU1BDV2Y2b1dJ?= =?utf-8?B?V0o3Z1VPVnZ5V2VOL0ZkbXhrRzhoQkxKRWJsQ0hJRE9iV0Y1L2UzS2ZxTkZz?= =?utf-8?B?REpiT09mcUhOcS95bXI1QlF4YUlVeEJncDZwQmFBSzRvVmIxT3lJMW04cE9P?= =?utf-8?Q?oyibmeQ74G4RhmMXLGC3OEkuQ?= Content-Type: multipart/alternative; boundary="_000_PH0PR18MB507187E28ADF207715BE0FA0AC4C2PH0PR18MB5071namp_" MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB5071.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b79b133-81b3-4c40-06fe-08dcf29ed9fc X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2024 13:38:45.5512 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vDq82eIZFRus9D7S5O8lvMnY6HKarNzJy0R7z2zH3jFjOI1vlNCcsvDn6CtJU4vqPbxccluXkpePRMEBSgV02g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR18MB4176 X-Proofpoint-GUID: cchS5HxsHDRgpJXsYw8qmm3c2moZfoEc X-Proofpoint-ORIG-GUID: cchS5HxsHDRgpJXsYw8qmm3c2moZfoEc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 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 --_000_PH0PR18MB507187E28ADF207715BE0FA0AC4C2PH0PR18MB5071namp_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Huichao cai Sent: Tuesday, October 22, 2024 4:58 PM To: Jerin Jacob ; Kiran Kumar Kokkilagadda ; Nithin Kumar Dabilpuram ; yanzhirun= _163@163.com Cc: dev@dpdk.org Subject: [EXTERNAL] [PATCH] test/graph: fix graph autotest second test fail= ure 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 faili= ng, modify this problem to make this test command idempotent. Signed-off-by= : Huichao cai 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 =3D node_id; dummy_id =3D rte_node_clone(node_id, "test_node00"); - if (rte_node_is_invalid(dummy_id)) { + if (rte_node_is_invalid(dummy_id) && (rte_errno !=3D EEXIST)) { printf("Got invalid id when clone, Expecting f= ail\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 t= he nodes to graph and call graph destroy. This will free the cloned nodes and we don=E2=80=99t see this problem. @@ -565,12 +565,14 @@ struct test_node_register { } for (i =3D 1; i < MAX_NODES; i++) { - tm->test_node[i].idx =3D - rte_node_clone(node_id, tm->tes= t_node[i].node.name); - if (rte_node_is_invalid(tm->test_node[i].idx))= { + dummy_id =3D rte_node_clone(node_id, tm->test_n= ode[i].node.name); + if (rte_node_is_invalid(dummy_id) && (rte_errno= !=3D EEXIST)) { printf("Got invalid node id\n"); return -1; } + + if (!rte_node_is_invalid(dummy_id)) + tm->test_node[i].idx =3D dummy_i= d; } /* Clone from cloned node should fail */ @@ -640,7 +642,7 @@ struct test_node_register { node_id =3D rte_node_from_name("test_node00"); dummy_node_id =3D 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 !=3D EEXIS= T)) { printf("Got invalid node id\n"); return -1; } @@ -672,7 +674,7 @@ struct test_node_register { main_graph_id =3D rte_graph_from_name("worker0"); if (main_graph_id =3D=3D RTE_GRAPH_ID_INVALID) { printf("Must create main graph first\n"); - ret =3D -1; + return -1; } graph_conf.dispatch.mp_capacity =3D 1024; @@ -682,7 +684,7 @@ struct test_node_register { if (cloned_graph_id =3D=3D RTE_GRAPH_ID_INVALID) { printf("Graph creation failed with error =3D %= d\n", rte_errno); - ret =3D -1; + return -1; } if (strcmp(rte_graph_id_to_name(cloned_graph_id), "worker0-cl= oned-test0")) { @@ -787,7 +789,7 @@ struct test_node_register { cloned_graph_id =3D rte_graph_clone(graph_id, "cloned-test1",= &graph_conf); node =3D rte_graph_node_get(cloned_graph_id, nid); - if (node->dispatch.lcore_id !=3D worker_lcore) { + if (!node || node->dispatch.lcore_id !=3D worker_lcore) { printf("set node affinity failed\n"); ret =3D -1; } @@ -859,7 +861,8 @@ struct test_node_register { } graph =3D rte_graph_lookup("worker0-cloned-test3"); - if (rte_graph_worker_model_get(graph) !=3D RTE_GRAPH_MODEL_MCO= RE_DISPATCH) { + if (!graph || rte_graph_worker_model_get(graph) !=3D + RTE_GRAPH_MODEL_MCORE_DISPATCH) { printf("Get graph worker model failed\n"); ret =3D -1; } -- 1.8.3.1 --_000_PH0PR18MB507187E28ADF207715BE0FA0AC4C2PH0PR18MB5071namp_ Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

 

 

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@m= arvell.com>; yanzhirun_163@163.com
Cc: dev@dpdk.org
Subject: [EXTERNAL] [PATCH] test/graph: fix graph autotest second te= st failure

 

Start dpdk-test, execute the graph_autotest tes= t 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@=E2=80=8A163.=E2=80=8Acom>

Start dpdk-test, execute the graph_autot=
est 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 <chcc=
hc88@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 {
            &nbs=
p; tm->test_node[0].idx =3D node_id;
 
            =
;  dummy_id =3D rte_node_clone(node_id, "test_node00");=
-            if =
(rte_node_is_invalid(dummy_id)) {
+           if (rte_n=
ode_is_invalid(dummy_id) && (rte_errno !=3D EEXIST)) {
            &nbs=
p;            &=
nbsp;   printf("Got invalid id when clone, Expecting fail\n&=
quot;);
            &nbs=
p;            &=
nbsp;   return -1;
            &nbs=
p; }
 
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=E2=80=99t see this problem=
.
 
 
 
@@ -565,12 +565,14 @@ struct test_node_register {
            &nbs=
p; }
 
            =
;  for (i =3D 1; i < MAX_NODES; i++) {
-           &nbs=
p;            &=
nbsp;   tm->test_node[i].idx =3D
-           &nbs=
p;            &=
nbsp;           &nbs=
p;      rte_node_clone(node_id, tm->test_node[i=
].node.name);
-           &nbs=
p;            &=
nbsp;   if (rte_node_is_invalid(tm->test_node[i].idx)) {<=
/o:p>
+           &nbs=
p;            &=
nbsp;  dummy_id =3D rte_node_clone(node_id, tm->test_node[i].node.n=
ame);
+           &nbs=
p;            &=
nbsp;  if (rte_node_is_invalid(dummy_id) && (rte_errno !=3D EE=
XIST)) {
            &nbs=
p;            &=
nbsp;           &nbs=
p;      printf("Got invalid node id\n");=
            &nbs=
p;            &=
nbsp;           &nbs=
p;      return -1;
            &nbs=
p;            &=
nbsp;   }
+
+           &nbs=
p;            &=
nbsp;  if (!rte_node_is_invalid(dummy_id))
+           &nbs=
p;            &=
nbsp;           &nbs=
p;     tm->test_node[i].idx =3D dummy_id;=
            &nbs=
p; }
 
            =
;  /* Clone from cloned node should fail */
@@ -640,7 +642,7 @@ struct test_node_register {
 
            =
;  node_id =3D rte_node_from_name("test_node00");=
            &nbs=
p; dummy_node_id =3D rte_node_clone(node_id, "dummy_node");<=
/o:p>
-            if =
(rte_node_is_invalid(dummy_node_id)) {
+           if (rte_n=
ode_is_invalid(dummy_node_id) && (rte_errno !=3D EEXIST)) {
            &nbs=
p;            &=
nbsp;   printf("Got invalid node id\n");
            &nbs=
p;            &=
nbsp;   return -1;
            &nbs=
p; }
@@ -672,7 +674,7 @@ struct test_node_register {
            &nbs=
p; main_graph_id =3D rte_graph_from_name("worker0");
            &nbs=
p; if (main_graph_id =3D=3D RTE_GRAPH_ID_INVALID) {
            &nbs=
p;            &=
nbsp;   printf("Must create main graph first\n");<=
/o:p>
-           &nbs=
p;            &=
nbsp;   ret =3D -1;
+           &nbs=
p;            &=
nbsp;  return -1;
            &nbs=
p; }
 
            =
;  graph_conf.dispatch.mp_capacity =3D 1024;
@@ -682,7 +684,7 @@ struct test_node_register {
 
            =
;  if (cloned_graph_id =3D=3D RTE_GRAPH_ID_INVALID) {
            &nbs=
p;            &=
nbsp;   printf("Graph creation failed with error =3D %d\n&qu=
ot;, rte_errno);
-           &nbs=
p;            &=
nbsp;   ret =3D -1;
+           &nbs=
p;            &=
nbsp;  return -1;
            &nbs=
p; }
 
            =
;  if (strcmp(rte_graph_id_to_name(cloned_graph_id), "worker0-clo=
ned-test0")) {
@@ -787,7 +789,7 @@ struct test_node_register {
            &nbs=
p; cloned_graph_id =3D rte_graph_clone(graph_id, "cloned-test1", =
&graph_conf);
            &nbs=
p; node =3D rte_graph_node_get(cloned_graph_id, nid);
 
-            if =
(node->dispatch.lcore_id !=3D worker_lcore) {
+           if (!node=
 || node->dispatch.lcore_id !=3D worker_lcore) {
            &nbs=
p;            &=
nbsp;   printf("set node affinity failed\n");
            &nbs=
p;            &=
nbsp;   ret =3D -1;
            &nbs=
p; }
@@ -859,7 +861,8 @@ struct test_node_register {
            &nbs=
p; }
 
            =
;  graph =3D rte_graph_lookup("worker0-cloned-test3");<=
/o:p>
-            if =
(rte_graph_worker_model_get(graph) !=3D RTE_GRAPH_MODEL_MCORE_DISPATCH) {
+           if (!grap=
h || rte_graph_worker_model_get(graph) !=3D
+           &nbs=
p;            &=
nbsp;      RTE_GRAPH_MODEL_MCORE_DISPATCH) {=
            &nbs=
p;            &=
nbsp;   printf("Get graph worker model failed\n");=
            &nbs=
p;            &=
nbsp;   ret =3D -1;
            &nbs=
p; }
-- 
1.8.3.1
 
--_000_PH0PR18MB507187E28ADF207715BE0FA0AC4C2PH0PR18MB5071namp_--