From patchwork Mon Jul 10 07:15:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zhirun" X-Patchwork-Id: 129415 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 823AA42E38; Mon, 10 Jul 2023 09:39:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B97242B8C; Mon, 10 Jul 2023 09:38:59 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 0DF13410EF for ; Mon, 10 Jul 2023 09:38:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688974737; x=1720510737; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xPY8RGKYv86qAitURVOywKitJbOasU1FZLbKVGwUjec=; b=V29q2v8aOXEV4cjWDkvpzW8Il9ck2PNHnhsjge+b1iCcz/zGOUxpgbvv s+/WN86vMNmoKy68/XEMWI/kWPhAAv1gtVsklAfcSRmI05gg1ONL57mpM Wkh0VJD1ktTOjsgJZbbya9jSQSGxtE9LG0FaPoDVdl37D3FI3YjVrEVNR +Rl0af5dunFXeTW29IU+ulnronCQyBlkfSYcHClx3XmiBvVf3SDjbGD/l V2zElrgXcELl2YFUkqhCkHK74ObRU3cHHAl69UGXP+zo5wtu2HJzGBYur rOdz3HAiUfzUFZsWWUevglOEL4BGpq9IHQQxfdeePscaoNUZS18sxFhYT g==; X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="364314491" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="364314491" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 00:38:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="790696503" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="790696503" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.138]) by fmsmga004.fm.intel.com with ESMTP; 10 Jul 2023 00:38:54 -0700 From: Zhirun Yan To: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com Cc: qi.fu@intel.com, Zhirun Yan Subject: [PATCH v4 1/2] graph: fix graph functional tests with valid params Date: Mon, 10 Jul 2023 15:15:14 +0800 Message-Id: <20230710071515.3143533-2-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230710071515.3143533-1-zhirun.yan@intel.com> References: <20230705015633.1465235-1-zhirun.yan@intel.com> <20230710071515.3143533-1-zhirun.yan@intel.com> MIME-Version: 1.0 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 rte_graph_clone() should use valid param rather than NULL pointer, cause it needs the param for alloc work queue memory for mcore dispatch model in graph_sched_wq_create(). Fixes: 67e2303cd823 ("test/graph: add functional tests for mcore dispatch model") Signed-off-by: Zhirun Yan Acked-by: Jerin Jacob --- app/test/test_graph.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/test/test_graph.c b/app/test/test_graph.c index 8609c0b3a4..47f5ab8395 100644 --- a/app/test/test_graph.c +++ b/app/test/test_graph.c @@ -665,7 +665,7 @@ test_graph_clone(void) { rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID; rte_graph_t main_graph_id = RTE_GRAPH_ID_INVALID; - struct rte_graph_param graph_conf; + struct rte_graph_param graph_conf = {0}; int ret = 0; main_graph_id = rte_graph_from_name("worker0"); @@ -700,6 +700,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void) { rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID; unsigned int worker_lcore = RTE_MAX_LCORE; + struct rte_graph_param graph_conf = {0}; rte_node_t nid = RTE_NODE_ID_INVALID; char node_name[64] = "test_node00"; struct rte_node *node; @@ -711,7 +712,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void) printf("Set node %s affinity to lcore %u\n", node_name, worker_lcore); nid = rte_node_from_name(node_name); - cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", NULL); + 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) { @@ -729,11 +730,12 @@ test_graph_model_mcore_dispatch_core_bind_unbind(void) { rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID; unsigned int worker_lcore = RTE_MAX_LCORE; + struct rte_graph_param graph_conf = {0}; struct rte_graph *graph; int ret = 0; worker_lcore = rte_get_next_lcore(worker_lcore, true, 1); - cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", NULL); + cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", &graph_conf); ret = rte_graph_model_mcore_dispatch_core_bind(cloned_graph_id, worker_lcore); if (ret != 0) { @@ -765,10 +767,11 @@ static int test_graph_worker_model_set_get(void) { rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID; + struct rte_graph_param graph_conf = {0}; struct rte_graph *graph; int ret = 0; - cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", NULL); + cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", &graph_conf); ret = rte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH); if (ret != 0) { printf("Set graph mcore dispatch model failed\n"); From patchwork Mon Jul 10 07:15:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zhirun" X-Patchwork-Id: 129416 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D252642E38; Mon, 10 Jul 2023 09:39:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9170642BAC; Mon, 10 Jul 2023 09:39:01 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id E52A2410F1 for ; Mon, 10 Jul 2023 09:38:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688974739; x=1720510739; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FLewvDoxl1jYohzb29SyCYpA4HAurNNPNmrEo9wB9Ik=; b=BoIKOunioVIy0hvYys9NwkhIVZ/QaGGpGbg9/uqneQmQL6ZOf39L93nO K5p7MU/gqAaV1tJjYB2Xk0dDzNeRh+SvIXozN+xTigXflTqilVQEaf7lh I3pc92jy7NgBTKQZ8rtZd5YTtYxfuCC2NPJi8z7eyHtCa8E4K+CttTmcf NXAtpxc3TdMXSBDLk3gu+kTiSjBi26YgXTIQ20ng13PPpBCGCIxqSxzU5 FNp2imMqlF2+BanQoomnDDTCm2/ZT6F/WMZRjZLV3VoMU9ni6W/UEzo+I DpzMeN3Mdb8r18XZ27M+QMcn8FvGaw+OdSOCGWLVJdrqlM2nAlgZgZMbw g==; X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="364314497" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="364314497" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 00:38:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="790696509" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="790696509" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.138]) by fmsmga004.fm.intel.com with ESMTP; 10 Jul 2023 00:38:56 -0700 From: Zhirun Yan To: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com Cc: qi.fu@intel.com, Zhirun Yan Subject: [PATCH v4 2/2] graph: fix graph model check in core binding Date: Mon, 10 Jul 2023 15:15:15 +0800 Message-Id: <20230710071515.3143533-3-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230710071515.3143533-1-zhirun.yan@intel.com> References: <20230705015633.1465235-1-zhirun.yan@intel.com> <20230710071515.3143533-1-zhirun.yan@intel.com> MIME-Version: 1.0 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 This function is used for mcore dispatch model only, correct the check to make sure it is the expected model. And specific the model by rte_graph_worker_model_set() before call it in test. Update release notes for new mcore dispatch model. Fixes: ecb22a294980 ("graph: introduce graph bind unbind API") Signed-off-by: Zhirun Yan Acked-by: Jerin Jacob --- app/test/test_graph.c | 6 ++++++ doc/guides/rel_notes/release_23_07.rst | 10 ++++++++++ lib/graph/graph.c | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/test/test_graph.c b/app/test/test_graph.c index 47f5ab8395..af90ac07ec 100644 --- a/app/test/test_graph.c +++ b/app/test/test_graph.c @@ -737,6 +737,12 @@ test_graph_model_mcore_dispatch_core_bind_unbind(void) worker_lcore = rte_get_next_lcore(worker_lcore, true, 1); cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", &graph_conf); + ret = rte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH); + if (ret != 0) { + printf("Set graph mcore dispatch model failed\n"); + ret = -1; + } + ret = rte_graph_model_mcore_dispatch_core_bind(cloned_graph_id, worker_lcore); if (ret != 0) { printf("bind graph %d to lcore %u failed\n", graph_id, worker_lcore); diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst index dcfd692425..7f1c2e66d5 100644 --- a/doc/guides/rel_notes/release_23_07.rst +++ b/doc/guides/rel_notes/release_23_07.rst @@ -185,6 +185,12 @@ New Features * Added SM2 algorithm support in asymmetric crypto operations. +* **Added mcore dispatch model in rte_graph library.** + + * Added set, get and validate model APIs to enhance graph framework + to chose different walk models. + * Added mcore dispatch model to support cross-core dispatching mechanism. + * **Added PDCP Library.** Added an experimental library to provide PDCP UL and DL processing of packets. @@ -206,6 +212,10 @@ New Features See the :doc:`../tools/dmaperf` for more details. +* **Update l3fwd-graph sample application.** + + Added a new cmdline option ``--model`` which can be used to chose + RTC or mcore dispatch model. Removed Items ------------- diff --git a/lib/graph/graph.c b/lib/graph/graph.c index 0c28d925bc..26f0968a97 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -287,7 +287,7 @@ rte_graph_model_mcore_dispatch_core_bind(rte_graph_t id, int lcore) if (graph->id == id) break; - if (graph->graph->model == RTE_GRAPH_MODEL_MCORE_DISPATCH) + if (graph->graph->model != RTE_GRAPH_MODEL_MCORE_DISPATCH) goto fail; graph->lcore_id = lcore;