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 9A3E142DAF; Mon, 3 Jul 2023 12:05:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FFE440ED5; Mon, 3 Jul 2023 12:05:46 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id B8CE040156 for ; Mon, 3 Jul 2023 12:05:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688378745; x=1719914745; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6HWNng979eYuBUTYxWYHMZsM50AvOdV+WouIhVoCeXM=; b=bU2dbRQL9vRPsazkGHvgGNQahbPlHgAdpPaSRpsTYBi0Di/bl5e5h6es K8oNb8zQGxzB1dYAlZj+26AMOmnwxADZckIbpGZhJJZu0pL0UD66iVF3h lx52eLWaAfgw//1LCpaHkbnBGRSa8hlA7aa2EAF69iSc8fuvNR8u4aWjn XDl3FuDqzT0qyV1Oy3blt1SbabNbtL7Hu/Cweg49nng7sf0czifpYlMW3 IxIERuO41hpxu+4mxFpzSSAKZ2BvUvqcmCLKWCcAXa0n1bX94qOTGFvCG xJsC9gfLl6DivbYnqZS8NKGPaQsyeq/hzRx5g2E3NUWHiFSZTf5eFDD9+ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="366327112" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="366327112" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2023 03:05:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="712512162" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="712512162" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94]) by orsmga007.jf.intel.com with ESMTP; 03 Jul 2023 03:05:40 -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 v2] graph: fix graph model check in core binding Date: Mon, 3 Jul 2023 17:55:42 +0800 Message-Id: <20230703095542.1229602-1-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230703072919.760043-1-zhirun.yan@intel.com> References: <20230703072919.760043-1-zhirun.yan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Fix graph model check in core binding with graph. And rte_graph_clone() need to use valid params rather than NULL pointer. Update release notes for new mcore dispatch model. Signed-off-by: Zhirun Yan --- app/test/test_graph.c | 15 ++++++++++++--- doc/guides/rel_notes/release_23_07.rst | 12 ++++++++++++ lib/graph/graph.c | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/app/test/test_graph.c b/app/test/test_graph.c index 8609c0b3a4..8983363c8e 100644 --- a/app/test/test_graph.c +++ b/app/test/test_graph.c @@ -702,6 +702,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void) unsigned int worker_lcore = RTE_MAX_LCORE; rte_node_t nid = RTE_NODE_ID_INVALID; char node_name[64] = "test_node00"; + struct rte_graph_param graph_conf; struct rte_node *node; int ret = 0; @@ -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,18 @@ 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; 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_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) { @@ -765,10 +773,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; 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"); diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst index 4459144140..adaecb3e7c 100644 --- a/doc/guides/rel_notes/release_23_07.rst +++ b/doc/guides/rel_notes/release_23_07.rst @@ -185,6 +185,13 @@ 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 clone graph, bind graph with lcore and affinity node with + lcore APIs to support mcore dispatch model. + * **Added PDCP Library.** Added an experimental library to provide PDCP UL and DL processing of packets. @@ -200,6 +207,11 @@ New Features Enhanced the GRO library to support TCP packets over IPv6 network. +* **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; -- 2.37.2