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 7F39242BCF; Mon, 5 Jun 2023 13:28:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A2C542D3F; Mon, 5 Jun 2023 13:27:10 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id BC3E0427E9 for ; Mon, 5 Jun 2023 13:27:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685964428; x=1717500428; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LBCe3kFxY2MhLLaP/y3RPwHD+grCxfNyIzvMIFYLa1I=; b=bYCQrGbIYzN5WBo2e6dN2KXJbLC2pwjBjhtccld41pXxFIQRswJWRA3y GiJ8Jd2raYgB8cexRfs6RIvbT//45iGz3Icf7MPMTxT6e3JN10K97UqBu IIAOU32nDcbONXoI4WpS2n9BUMIBPF8Jxrh+JQM75qi4joUF2CH134AFg GZAba/0ED99kmFOi2HCZyMPFqwJF1P8Y3LnkwY0J1I0y3Wc+F7kKs09e3 uUZq2/JDONNgcfCvY+/HSAJuKmLcTUI5nWVnN57ln48739rOizuQyYe7r f11QgPtKwucEFZLDywqofLAiXOcOgqro+HgVjDD1kkaYhxKNstedLTlNI w==; X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="422168704" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="422168704" 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:27:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="832779019" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="832779019" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94]) by orsmga004.jf.intel.com with ESMTP; 05 Jun 2023 04:27:05 -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 17/17] doc: update multicore dispatch model in graph guides Date: Mon, 5 Jun 2023 20:19:23 +0900 Message-Id: <20230605111923.3772260-18-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230605111923.3772260-1-zhirun.yan@intel.com> References: <20230509060347.1237884-1-zhirun.yan@intel.com> <20230605111923.3772260-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 Update graph documentation to introduce new multicore dispatch model. Signed-off-by: Haiyue Wang Signed-off-by: Cunming Liang Signed-off-by: Zhirun Yan --- doc/guides/prog_guide/graph_lib.rst | 60 +++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/doc/guides/prog_guide/graph_lib.rst b/doc/guides/prog_guide/graph_lib.rst index 1cfdc86433..c0bdb4c71f 100644 --- a/doc/guides/prog_guide/graph_lib.rst +++ b/doc/guides/prog_guide/graph_lib.rst @@ -189,14 +189,66 @@ In the above example, A graph object will be created with ethdev Rx node of port 0 and queue 0, all ipv4* nodes in the system, and ethdev tx node of all ports. -Multicore graph processing -~~~~~~~~~~~~~~~~~~~~~~~~~~ -In the current graph library implementation, specifically, -``rte_graph_walk()`` and ``rte_node_enqueue*`` fast path API functions +Graph models chossing +~~~~~~~~~~~~~~~~~~~~~ +Currently, there are 2 different walking models. Use macro +RTE_GRAPH_MODEL_SELECT to set the model in compile time. Use +``rte_graph_worker_model_set()`` to set the walking model in runtime. + +RTC (Run-To-Completion) +^^^^^^^^^^^^^^^^^^^^^^^ +This is the default graph walking model. Specifically, +``rte_graph_walk_rtc()`` and ``rte_node_enqueue*`` fast path API functions are designed to work on single-core to have better performance. The fast path API works on graph object, So the multi-core graph processing strategy would be to create graph object PER WORKER. +Example: + +Graph: node-0 -> node-1 -> node-2 @Core0. + +.. code-block:: diff + + + - - - - - - - - - - - - - - - - - - - - - + + ' Core #0 ' + ' ' + ' +--------+ +---------+ +--------+ ' + ' | Node-0 | --> | Node-1 | --> | Node-2 | ' + ' +--------+ +---------+ +--------+ ' + ' ' + + - - - - - - - - - - - - - - - - - - - - - + + +Dispatch model +^^^^^^^^^^^^^^ +The dispatch 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. + +Use ``rte_graph_model_mcore_dispatch_lcore_affinity_set()`` to set lcore affinity +with the node. +Each worker core will have a graph repetition. Use ``rte_graph_clone()`` to clone +graph for each worker and use``rte_graph_model_mcore_dispatch_core_bind()`` to +bind graph with the worker core. + +Example: + +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 | ' + ' +--------+ ' ' +--------+ +--------+ ' ' +--------+ ' + ' ' ' | ' ' ^ ' + + - - - - - -+ +- - -|- - - - - - - - - - + + - - -|- - -+ + | | + + - - - - - - - - - - - - - - - - + + + In fast path ~~~~~~~~~~~~ Typical fast-path code looks like below, where the application -- 2.37.2