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 8767342BCF; Mon, 5 Jun 2023 13:26:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18F7A4021F; Mon, 5 Jun 2023 13:26:21 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 066774003C for ; Mon, 5 Jun 2023 13:26:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685964380; x=1717500380; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2kA3ADzPb5RubQVBhctLPfWtI34qTLCQRIEace35+B8=; b=F1/ZGEnqfj2ej9NOdYCSV1x97lWhNbtiSw0+B6L4Iud3I7lhYmDH+QhU Qo2v4eLxfg2myk4Uzkr8VdN0iiLqxReX6+rrZ+8UJqwciksqhWOjoYVel 7rFIfFZS+CBISX7MLAMjyu2c5Y9GDYUZRlh2vmB3B4PoqK+18FScQLTZf W7bgB1bC3viBRKnTYcZpEksO6xpiNkeXCBcHwZPqtSOjhZkrUQBOGvBwL rmcJDy6yqSRZkU82DoM/6+CThUzSOisQoq+xAdFv0YPEnsb3jkjcYD+lq Wb4jucQvCK2RYdRGq1p2sVNbs12jh58/6FJndqVREgoxo+7UM0iYpy5RK A==; X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="422168453" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="422168453" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2023 04:26:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="832778861" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="832778861" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94]) by orsmga004.jf.intel.com with ESMTP; 05 Jun 2023 04:26:16 -0700 From: Zhirun Yan To: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com, stephen@networkplumber.org, pbhagavatula@marvell.com, jerinjacobk@gmail.com Cc: cunming.liang@intel.com, haiyue.wang@intel.com, mattias.ronnblom@ericsson.com, Zhirun Yan Subject: [PATCH v7 00/15] graph enhancement for multi-core dispatch Date: Mon, 5 Jun 2023 20:19:06 +0900 Message-Id: <20230605111923.3772260-1-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230509060347.1237884-1-zhirun.yan@intel.com> References: <20230509060347.1237884-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 V7: Revert rte_rdtsc_precise() in fastpath to fix performance issues in patch 03. Introduce new scheme for model choosing. Use RTE_GRAPH_MODEL_SELECT to choose in compile-time in patch 13, 15.(must have rte_graph_worker_model_set() to help other config func to do model specific things like alloc wq, collect stats) Extract the common func clone_name() into graph_private.h for graph/node clone in patch 07.(new patch) Use rte_graph->model in rte_graph_worker_model_set() instead of RTE_PER_LCORE_*. Add test case for all new APIs in patch 16(new patch). Remove *_END line in enum rte_graph_worker_model in patch 04. Add model check for graph lcore binding. Rename workqueue as graph_mcore_dispatch_wq_node in patch 09. Change all new model files/APIs with prefix _mcore_dispatch_. Change description of new API, comments of func/structure to explicitly mention for mcore dispatch model only. Add Doxygen comments. Update l3fwd-graph with new scheme, Update doc. Update MAINTAINERS. Fix typo and format issues. V6: Change rte_rdtsc() to rte_rdtsc_precise(). Add union in rte_graph_param to configure models. Remove memset in fastpath, add RTE_ASSERT for cloned graph. Update copyright in patch 02. Update l3fwd-graph node affinity, start from rx core successively. V5: Fix CI build issues about dynamically update doc. V4: Fix CI build issues about undefined reference of sched apis. Remove inline for model setting. V3: Fix CI build issues about TLS and typo. V2: Use git mv to keep git history. Use TLS for per-thread local storage. Change model name to mcore dispatch. Change API with specific mode name. Split big patch. Fix CI issues. Rebase l3fwd-graph example. Update doc and maintainers files. Currently, rte_graph supports RTC (Run-To-Completion) model within each of a single core. RTC is one of the typical model of packet processing. Others like Pipeline or Hybrid are lack of support. The patch set introduces a 'multicore dispatch' model selection which is a self-reacting scheme according to the core affinity. The new model enables a cross-core dispatching mechanism which employs a scheduling work-queue to dispatch streams to other worker cores which being associated with the destination node. When core flavor of the destination node is a default 'current', the stream can be continue executed as normal. Example: 3-node graph targets 3-core budget RTC: Graph: node-0 -> node-1 -> node-2 @Core0. + - - - - - - - - - - - - - - - - - - - - - + ' Core #0/1/2 ' ' ' ' +--------+ +---------+ +--------+ ' ' | Node-0 | --> | Node-1 | --> | Node-2 | ' ' +--------+ +---------+ +--------+ ' ' ' + - - - - - - - - - - - - - - - - - - - - - + Dispatch: Graph topo: node-0 -> Core1; node-1 -> node-2; node-2 -> node-3. Config graph: node-0 @Core0; node-1/3 @Core1; node-2 @Core2. .. code-block:: diff + - - - - - -+ +- - - - - - - - - - - - - + + - - - - - -+ ' Core #0 ' ' Core #1 ' ' Core #2 ' ' ' ' ' ' ' ' +--------+ ' ' +--------+ +--------+ ' ' +--------+ ' ' | Node-0 | - - - ->| Node-1 | | Node-3 |<- - - - | Node-2 | ' ' +--------+ ' ' +--------+ +--------+ ' ' +--------+ ' ' ' ' | ' ' ^ ' + - - - - - -+ +- - -|- - - - - - - - - - + + - - -|- - -+ | | + - - - - - - - - - - - - - - - - + The patch set has been break down as below: 1. Split graph worker into common and default model part. 2. Inline graph node processing to make it reusable. 3. Add set/get APIs to choose worker model. 4. Introduce core affinity API to set the node run on specific worker core. (only use in new model) 5. Introduce graph affinity API to bind one graph with specific worker core. 6. Introduce graph clone API. 7. Introduce stream moving with scheduler work-queue in patch 8~12. 8. Add stats for new models. 9. Abstract default graph config process and integrate new model into example/l3fwd-graph. Add new parameters for model choosing. We could run with new worker model by this: ./dpdk-l3fwd-graph -l 8,9,10,11 -n 4 -- -p 0x1 --config="(0,0,9)" -P --model="dispatch" References: https://static.sched.com/hosted_files/dpdkuserspace22/a6/graph%20introduce%20remote%20dispatch%20for%20mult-core%20scaling.pdf Zhirun Yan (17): graph: rename rte_graph_work as common graph: split graph worker into common and default model graph: move node process into inline function graph: add get/set graph worker model APIs graph: introduce graph node core affinity API graph: introduce graph bind unbind API graph: move node clone name func into private as common graph: introduce graph clone API for other worker core graph: add structure for stream moving between cores graph: introduce stream moving cross cores graph: enable create and destroy graph scheduling workqueue graph: introduce graph walk by cross-core dispatch graph: enable graph multicore dispatch scheduler model graph: add stats for cross-core dispatching examples/l3fwd-graph: introduce multicore dispatch worker model test/graph: add functional tests for mcore dispatch model doc: update multicore dispatch model in graph guides MAINTAINERS | 3 +- app/test/test_graph.c | 113 +++++ doc/guides/prog_guide/graph_lib.rst | 60 ++- examples/l3fwd-graph/main.c | 231 +++++++-- lib/graph/graph.c | 155 ++++++ lib/graph/graph_debug.c | 6 + lib/graph/graph_populate.c | 1 + lib/graph/graph_private.h | 90 ++++ lib/graph/graph_stats.c | 74 ++- lib/graph/meson.build | 4 +- lib/graph/node.c | 27 +- lib/graph/rte_graph.h | 65 +++ lib/graph/rte_graph_model_mcore_dispatch.c | 191 ++++++++ lib/graph/rte_graph_model_mcore_dispatch.h | 133 +++++ lib/graph/rte_graph_model_rtc.h | 46 ++ lib/graph/rte_graph_worker.c | 70 +++ lib/graph/rte_graph_worker.h | 503 +------------------ lib/graph/rte_graph_worker_common.h | 541 +++++++++++++++++++++ lib/graph/version.map | 10 + 19 files changed, 1759 insertions(+), 564 deletions(-) create mode 100644 lib/graph/rte_graph_model_mcore_dispatch.c create mode 100644 lib/graph/rte_graph_model_mcore_dispatch.h create mode 100644 lib/graph/rte_graph_model_rtc.h create mode 100644 lib/graph/rte_graph_worker.c create mode 100644 lib/graph/rte_graph_worker_common.h -- 2.37.2