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 ACA4C42C5E; Thu, 8 Jun 2023 14:29:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D501406B5; Thu, 8 Jun 2023 14:29:20 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 8AADF40042 for ; Thu, 8 Jun 2023 14:29:17 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3588QoDD023824; Thu, 8 Jun 2023 05:29:16 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2105.outbound.protection.outlook.com [104.47.58.105]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3r329c2ntd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 05:29:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q72le3IgiI97v3HfTMOoW2HEED98bwLIrzxA/rohdp0ZxCmUHnEI9ANKLWooZy9wmGdXqS93wUDruDLk7XcKYh7DwORpxYxE9PsiXw3c2Vxvurw11AJkB+q6gldZSkwwqYJcXK00ZGt7flqDq+mANTAC6qurniRXzSfOjDfOphNB4kOidE+3D4BEGNnWJrFl6Lavjdci1/FLQZiYqzVddTvMIPzpqOqiFBQkO5h0k/g5pqvUjP2r4wE0BqFW/nF5+taqE1AKv+FIQtPYBsxcnougcr89plgzP1kzwT3q6ok0O49TQLOYi9UxSKSX5YqyX+CMDl6R7YatCGkAIfucwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=JGFVNh2QIqO54gWyHAQT5etAAcA853TrglwSEZ7v88k=; b=JE0cf2gfM1fgf168BI4ztjugpo6hbGmABQpimpFaoJ8MCXrfFIwhJAeqsypfQRzow6Wxqsl6iMYiVF6CnASQ5GlF3QRvPE68DnVXGG3UETEgJa4k8B1wbe6iAuZM2JYePKvuFiZCKYAs94lTHzjMm5Rtiv7NLpC9T7mI9hFzetsSq5Y/jlfL0eh8gDeGa9ylo6AlMg+gBCuYDzjWayH8gsVT206+673NJwP5AA4rucS0l3hETB7CjZZgVBzVJqq29fNvuxs9GLvqBEIIIrbmD+y/dBwjWyYtxZERYxdvHxIc6MSbaIk/swlsioYnPZDzL2AAZXao/YJ8/VbcUWXrJA== 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.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JGFVNh2QIqO54gWyHAQT5etAAcA853TrglwSEZ7v88k=; b=dxfcsF11AYYTtDe7165Q2+CLTT2sIyopKaea4m4/m6OWIgMZmCNB0xEfiXs51J+xTEzIZY/OT0CfB6MLRsn+y8FBcZRtJWg4UxKt/WD/zrgmhgSjz5ouAmj8K9DJ0N27xIUh/jmwRAAglyoOmMYh98/kVLMB9m8ZNBWZKhDzR5I= Received: from PH0PR18MB4086.namprd18.prod.outlook.com (2603:10b6:510:3::9) by PH0PR18MB5090.namprd18.prod.outlook.com (2603:10b6:510:172::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.38; Thu, 8 Jun 2023 12:27:38 +0000 Received: from PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::600f:e50f:8159:d89]) by PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::600f:e50f:8159:d89%6]) with mapi id 15.20.6455.030; Thu, 8 Jun 2023 12:27:38 +0000 From: Pavan Nikhilesh Bhagavatula To: Zhirun Yan , "dev@dpdk.org" , Jerin Jacob Kollanukkaran , Kiran Kumar Kokkilagadda , Nithin Kumar Dabilpuram , "stephen@networkplumber.org" , "jerinjacobk@gmail.com" CC: "cunming.liang@intel.com" , "haiyue.wang@intel.com" , "mattias.ronnblom@ericsson.com" Subject: RE: [EXT] [PATCH v10 15/16] test/graph: add functional tests for mcore dispatch model Thread-Topic: [EXT] [PATCH v10 15/16] test/graph: add functional tests for mcore dispatch model Thread-Index: AQHZmfDQYhNigg5kFkK6cnXOspGLKK+A1Ufg Date: Thu, 8 Jun 2023 12:27:38 +0000 Message-ID: References: <20230607035144.1214492-1-zhirun.yan@intel.com> <20230608095759.1800617-1-zhirun.yan@intel.com> <20230608095759.1800617-16-zhirun.yan@intel.com> In-Reply-To: <20230608095759.1800617-16-zhirun.yan@intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-dg-ref: PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNccGJoYWdhdmF0dWxhXGFwcGRhdGFccm9hbWluZ1wwOWQ4NDliNi0zMmQzLTRhNDAtODVlZS02Yjg0YmEyOWUzNWJcbXNnc1xtc2ctZDk1ZDI3MmQtMDVmNy0xMWVlLWI2Y2UtNGMwMzRmNWZhYTMyXGFtZS10ZXN0XGQ5NWQyNzJmLTA1ZjctMTFlZS1iNmNlLTRjMDM0ZjVmYWEzMmJvZHkudHh0IiBzej0iNTM3NyIgdD0iMTMzMzA3MDA4NTY3MDI5NDcxIiBoPSJiSWhLOWpJd3l3YnhJd2pnV05TK1J1MlFrWlE9IiBpZD0iIiBibD0iMCIgYm89IjEiIGNpPSJjQUFBQUVSSFUxUlNSVUZOQ2dVQUFIQUFBQURmTHJXYkJKclpBVWhOQ1N3L1BYUTdTRTBKTEQ4OWREc0FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBRUFBQUVCQUFBQVIveFhoZ0NBQVFBQUFBQUFBQUFBQUE9PSIvPjwvbWV0YT4= x-dg-rorf: true x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR18MB4086:EE_|PH0PR18MB5090:EE_ x-ms-office365-filtering-correlation-id: 7fe48b78-b522-4d1d-f49f-08db681bbf18 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dbP3E2VJ2VbB6gfm4J3Ryfe7ceHXMV5bTdKR/O9sekBATiBCu0rGnQKpyOxV2hvIWa2p8pgN6RtpK9B4BvJIsYSwShtSh5ddFcrfkdNBihygdlCtlBoCoaxX9823qkWNsDlPsnzdgV3eUvET9Xq8rwbEQT9nruckSv9pd3zlq4SottvgLnv0/SEFIJv9KNaR1FAcxBrA1x02xc/AJATdT5ipEvC2B1au7cpN4sjP91+A+p0t+N20lsdYS1O9DVFSEWZH5pxnzwQgALl+quji8cq7l/AjnAB4NNvpQdJG0KfcJCWgaLLX8dYFGFBnsd2XejwXYrBUPVsjVl0ZcGMOGWJHs419S0MAnxnOwua+IwVLtz7bxXWwsvJUdBhBbSP8kTfocugTHh8AKlEIB5ASLmYR+/Sm1oX4bkBWq+3w5Ka7WsuANHVvJFgDienAsjmPCQWmF4NtuXAJ3e+y1NLftJaiz3yV4J7uFB1kcULugYOkXW5noJO/YXh8fRgPBmH9R8LysqDIj0ZL3KjiWMfmq4z0crhuHUL/NjTDRJ8Qx2zFDLmee5/R/K2NIzQYwZ0kYTDVZgpGRuDDoCWO1fjS+Zab3hu/+V+wKZk5a60FjFZTHdQNbSwJqtq4wASuzNPJ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4086.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(136003)(39860400002)(396003)(366004)(376002)(451199021)(55016003)(110136005)(54906003)(478600001)(122000001)(8676002)(8936002)(4326008)(76116006)(66556008)(66476007)(66446008)(64756008)(66946007)(316002)(41300700001)(38100700002)(7696005)(186003)(83380400001)(71200400001)(9686003)(6506007)(26005)(33656002)(86362001)(5660300002)(52536014)(38070700005)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?FiC8rl7dwRkYYIv5ibg/TsESCdCC6EHcjyluifNXV0c/9WqJ1JCQsSBsic9B?= =?us-ascii?Q?mQP4EioaSMLJxaQi3r8zbaYoLWaPPqMzt6jhozqeIEghlHvJJjN51IlKpycV?= =?us-ascii?Q?kOg1t1UBV2b19Ipd81pfHo1BW5wUITiCc9Gp9YLWShHLtdyfbS0b33FEGoqP?= =?us-ascii?Q?iOxMmlB2Q1rXCZt6dO22buqdXSORdp2ftWWXC5BpgW2zNxoIiQDv8RsvlLFl?= =?us-ascii?Q?sCQlT8ddxiJ9wjOnOTMyGiQHhXyDyrQMhq2yoUEJbN52OYHQ0OgAjV5oyokf?= =?us-ascii?Q?dBMitbmUCAlJMDzQgZCrPF2OdJvu8JLIGqknRHp1sjyq2Tph5fZtqg5Cyjx1?= =?us-ascii?Q?2xKYvmFJYb7D3QpWb5cpl6eyV1JRMGaSt0RUTpw6OsDSiNuAOwqnFR3Z5tq2?= =?us-ascii?Q?+02CFuxjkVgpon9DUrUBAcMD3jIerEYqhki1zj/NhnDuxOXVtqIcxd+EvRqy?= =?us-ascii?Q?KM3ldPgp4xQsSkY23gWg0UkOQKIJSIKmM4iA0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t?= =?us-ascii?Q?hNC5mvrFkmlN+cQWcM6sio41RfrZWQdTsOX92uvZ0vwo2uNhPkIwg0P67wbn?= =?us-ascii?Q?RbNaIxlhr0ukhACtUceEh+/gOMqbRIZkdEoTwYR5862dpbtWRLAyk4yUM8kL?= =?us-ascii?Q?Klb17pVV/aw3Fd49Ta/iDMVm+A/fnW9ei2kzV//VenaJd7X2v6uzWUO3woDD?= =?us-ascii?Q?0Hy/IrbWn9nd49Kd+R67voxW/aExplRfwu8v5q1f?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4086.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fe48b78-b522-4d1d-f49f-08db681bbf18 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2023 12:27:38.2055 (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: eXoaj7H2COjsbmJVzsWI7J095CtmvOOazuG4+9Z42WebaibXyIdT42fu+rp8z6omEFYmG4DeRHs2tgArwgF1baHYfIbRNZ/6NfijHyx5+dU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR18MB5090 X-Proofpoint-GUID: SXLdkQ7PWSA34NPbHz0xgD8LqZ6zydzx X-Proofpoint-ORIG-GUID: SXLdkQ7PWSA34NPbHz0xgD8LqZ6zydzx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_08,2023-06-08_01,2023-05-22_02 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 > Add functional test for mcore dispatch model including graph clone, > graph model set/get, node worker affinity, graph worker binding/unbinding= . >=20 > Signed-off-by: Haiyue Wang > Signed-off-by: Cunming Liang > Signed-off-by: Zhirun Yan Acked-by: Pavan Nikhilesh > --- > app/test/test_graph.c | 130 > ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 130 insertions(+) >=20 > diff --git a/app/test/test_graph.c b/app/test/test_graph.c > index 1a2d1e6fab..8609c0b3a4 100644 > --- a/app/test/test_graph.c > +++ b/app/test/test_graph.c > @@ -660,6 +660,132 @@ test_create_graph(void) > return 0; > } >=20 > +static int > +test_graph_clone(void) > +{ > + rte_graph_t cloned_graph_id =3D RTE_GRAPH_ID_INVALID; > + rte_graph_t main_graph_id =3D RTE_GRAPH_ID_INVALID; > + struct rte_graph_param graph_conf; > + int ret =3D 0; > + > + 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; > + } > + > + graph_conf.dispatch.mp_capacity =3D 1024; > + graph_conf.dispatch.wq_size_max =3D 32; > + > + cloned_graph_id =3D rte_graph_clone(main_graph_id, "cloned-test0", > &graph_conf); > + > + if (cloned_graph_id =3D=3D RTE_GRAPH_ID_INVALID) { > + printf("Graph creation failed with error =3D %d\n", rte_errno); > + ret =3D -1; > + } > + > + if (strcmp(rte_graph_id_to_name(cloned_graph_id), "worker0- > cloned-test0")) { > + printf("Cloned graph should name as %s but get %s\n", > "worker0-cloned-test", > + rte_graph_id_to_name(cloned_graph_id)); > + ret =3D -1; > + } > + > + rte_graph_destroy(cloned_graph_id); > + > + return ret; > +} > + > +static int > +test_graph_model_mcore_dispatch_node_lcore_affinity_set(void) > +{ > + rte_graph_t cloned_graph_id =3D RTE_GRAPH_ID_INVALID; > + unsigned int worker_lcore =3D RTE_MAX_LCORE; > + rte_node_t nid =3D RTE_NODE_ID_INVALID; > + char node_name[64] =3D "test_node00"; > + struct rte_node *node; > + int ret =3D 0; > + > + worker_lcore =3D rte_get_next_lcore(worker_lcore, true, 1); > + ret =3D > rte_graph_model_mcore_dispatch_node_lcore_affinity_set(node_name, > worker_lcore); > + if (ret =3D=3D 0) > + printf("Set node %s affinity to lcore %u\n", node_name, > worker_lcore); > + > + nid =3D rte_node_from_name(node_name); > + cloned_graph_id =3D rte_graph_clone(graph_id, "cloned-test1", NULL); > + node =3D rte_graph_node_get(cloned_graph_id, nid); > + > + if (node->dispatch.lcore_id !=3D worker_lcore) { > + printf("set node affinity failed\n"); > + ret =3D -1; > + } > + > + rte_graph_destroy(cloned_graph_id); > + > + return ret; > +} > + > +static int > +test_graph_model_mcore_dispatch_core_bind_unbind(void) > +{ > + rte_graph_t cloned_graph_id =3D RTE_GRAPH_ID_INVALID; > + unsigned int worker_lcore =3D RTE_MAX_LCORE; > + struct rte_graph *graph; > + int ret =3D 0; > + > + worker_lcore =3D rte_get_next_lcore(worker_lcore, true, 1); > + cloned_graph_id =3D rte_graph_clone(graph_id, "cloned-test2", NULL); > + > + ret =3D > rte_graph_model_mcore_dispatch_core_bind(cloned_graph_id, > worker_lcore); > + if (ret !=3D 0) { > + printf("bind graph %d to lcore %u failed\n", graph_id, > worker_lcore); > + ret =3D -1; > + } > + > + graph =3D rte_graph_lookup("worker0-cloned-test2"); > + > + if (graph->dispatch.lcore_id !=3D worker_lcore) { > + printf("bind graph %s(id:%d) with lcore %u failed\n", > + graph->name, graph->id, worker_lcore); > + ret =3D -1; > + } > + > + rte_graph_model_mcore_dispatch_core_unbind(cloned_graph_id); > + if (graph->dispatch.lcore_id !=3D RTE_MAX_LCORE) { > + printf("unbind graph %s(id:%d) failed %d\n", > + graph->name, graph->id, graph->dispatch.lcore_id); > + ret =3D -1; > + } > + > + rte_graph_destroy(cloned_graph_id); > + > + return ret; > +} > + > +static int > +test_graph_worker_model_set_get(void) > +{ > + rte_graph_t cloned_graph_id =3D RTE_GRAPH_ID_INVALID; > + struct rte_graph *graph; > + int ret =3D 0; > + > + cloned_graph_id =3D rte_graph_clone(graph_id, "cloned-test3", NULL); > + ret =3D > rte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH); > + if (ret !=3D 0) { > + printf("Set graph mcore dispatch model failed\n"); > + ret =3D -1; > + } > + > + graph =3D rte_graph_lookup("worker0-cloned-test3"); > + if (rte_graph_worker_model_get(graph) !=3D > RTE_GRAPH_MODEL_MCORE_DISPATCH) { > + printf("Get graph worker model failed\n"); > + ret =3D -1; > + } > + > + rte_graph_destroy(cloned_graph_id); > + > + return 0; > +} > + > static int > test_graph_walk(void) > { > @@ -837,6 +963,10 @@ static struct unit_test_suite graph_testsuite =3D { > TEST_CASE(test_update_edges), > TEST_CASE(test_lookup_functions), > TEST_CASE(test_create_graph), > + TEST_CASE(test_graph_clone), > + > TEST_CASE(test_graph_model_mcore_dispatch_node_lcore_affinity > _set), > + > TEST_CASE(test_graph_model_mcore_dispatch_core_bind_unbind), > + TEST_CASE(test_graph_worker_model_set_get), > TEST_CASE(test_graph_lookup_functions), > TEST_CASE(test_graph_walk), > TEST_CASE(test_print_stats), > -- > 2.37.2