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 B14DF42BBB; Mon, 5 Jun 2023 15:42:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E4F44021F; Mon, 5 Jun 2023 15:42:42 +0200 (CEST) Received: from mail-vk1-f170.google.com (mail-vk1-f170.google.com [209.85.221.170]) by mails.dpdk.org (Postfix) with ESMTP id 270A14003C for ; Mon, 5 Jun 2023 15:42:41 +0200 (CEST) Received: by mail-vk1-f170.google.com with SMTP id 71dfb90a1353d-4611eec56bdso1075271e0c.2 for ; Mon, 05 Jun 2023 06:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685972560; x=1688564560; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Ojv6cWKW9LRR2VScQuYZeI9WlmTKN0rK4mmJE0NW2rg=; b=XYD49EhaG+NPK3gWp7RsRBsui61gxNWurtiDMxxcJv9pNAZgUguV1hKYfA/Yk/m9DU f02mDIHWBADqcT6vtcYb2sI7ZHqQyAF/MqBn+KQHA267E3YggQD93S4BNWa3dhcmaxXg M3hambTkrxRVaQqw5vmkNTu+wcuABdo/9BjH9ks4FoMdLt7c5On7zMJKbHe+j2MJnfs7 dKERf75qxseUBMuwapHR0vYGBsCQFG+leLPYUpU1RxDSYEu2WrLSqWrMibqSx2FpQB0g zlHq862YCmunt/TaOWbYCMm24rZRC2GE+xbwEGSOmU+9WMmNl+a7rsR7hiKKPbpoJu2T EWmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685972560; x=1688564560; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ojv6cWKW9LRR2VScQuYZeI9WlmTKN0rK4mmJE0NW2rg=; b=F4Uenc9D5XXAIJxsXPBRbAHsTe+kk2BbLtuG4R5XWfQc8h+YbjftKENnCE5sft+3nL OeNSa6jKf7CObK1PDHT1KNhkkAYZ9jOYR8KdE26eJE+89JZpY515CJyhbcjyzARqcmQc 1UtJc5jP4gcAismaIM1AbHmgsPgFf4nWKeBD6f3qsPg9zNsJoYpdjWn+6bgmbaRkczIg WXq7PL4BR6hqTFdlrZnEJs0tFczE/epJ4TfrMEm7XN6wHd6UWVOAUcJBfZwmkOUOtKLB 38OIfrnY3pp/b80r41HfDdX7fi1S4O2T4VVzKNeJEy4YofiwQnnjwwH1IW8ACYMYp3Tb VDDg== X-Gm-Message-State: AC+VfDwxVovTxKUdosRB/ftw5Y/+pjuMNmnrSq4AmwuVwpGY076eIrPQ 6EMhGYSBnraJnhLO6oLOLHeG79P4OgY/OGHrNIc= X-Google-Smtp-Source: ACHHUZ4yZBvF7V8A+eSX1UsQh9uKZtu/TVa4kFVOZlcMzZx1Hp5CxxO2jpch8NjKDMptretJ34FhZgFm46F774T8wqs= X-Received: by 2002:a1f:4343:0:b0:463:b57a:e927 with SMTP id q64-20020a1f4343000000b00463b57ae927mr1706483vka.4.1685972560381; Mon, 05 Jun 2023 06:42:40 -0700 (PDT) MIME-Version: 1.0 References: <20230509060347.1237884-1-zhirun.yan@intel.com> <20230605111923.3772260-1-zhirun.yan@intel.com> <20230605111923.3772260-16-zhirun.yan@intel.com> In-Reply-To: <20230605111923.3772260-16-zhirun.yan@intel.com> From: Jerin Jacob Date: Mon, 5 Jun 2023 19:12:14 +0530 Message-ID: Subject: Re: [PATCH v7 15/17] examples/l3fwd-graph: introduce multicore dispatch worker model To: Zhirun Yan Cc: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com, stephen@networkplumber.org, pbhagavatula@marvell.com, cunming.liang@intel.com, haiyue.wang@intel.com, mattias.ronnblom@ericsson.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Mon, Jun 5, 2023 at 4:57=E2=80=AFPM Zhirun Yan wr= ote: > > Add new parameter "model" to choose mcore dispatch or rtc model. > And in dispatch model, the node will affinity to worker core successively= . > > Note: > RTE_GRAPH_MODEL_SELECT is set to GRAPH_MODEL_RTC by default. Must set > model the same as RTE_GRAPH_MODEL_SELECT If set it as rtc or mcore > dispatch explicitly. GRAPH_MODEL_MCORE_RUNTIME_SELECT means it could > choose by model in runtime. > Only support one RX node for mcore dispatch model in current > implementation. > > ./dpdk-l3fwd-graph -l 8,9,10,11 -n 4 -- -p 0x1 --config=3D"(0,0,9)" -P > --model=3D"dispatch" > > Signed-off-by: Haiyue Wang > Signed-off-by: Cunming Liang > Signed-off-by: Zhirun Yan > --- > examples/l3fwd-graph/main.c | 231 +++++++++++++++++++++++++++++------ > lib/graph/rte_graph_worker.h | 3 + > 2 files changed, 196 insertions(+), 38 deletions(-) > > diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c > index 5feeab4f0f..4ecc6c9af4 100644 > --- a/examples/l3fwd-graph/main.c > +++ b/examples/l3fwd-graph/main.c > @@ -23,6 +23,12 @@ > #include > #include > #include > +#define GRAPH_MODEL_RTC 0 /* Run-to-completion model, set by default. */ > +#define GRAPH_MODEL_MCORE_DISPATCH 1 /* Dispatch model. */ > +#define GRAPH_MODEL_MCORE_RUNTIME_SELECT 2 /* Support to select model by= */ > + /* parsing model in cmdline. *= / After moving model to graph->model, Can you check the performance. This may not be needed for l3fwd or if there is not much code duplication, Do the following remove the limitation, #define RTE_GRAPH_MODEL_SELECT RTE_GRAPH_MODEL_RTC. graph_main_loop change to graph_main_rtc_loop #define RTE_GRAPH_MODEL_SELECT GRAPH_MODEL_MCORE_DISPATCH graph_main_loop change to graph_main_mcore_loop Select the following based on runtime option /* Launch per-lcore init on every worker lcore */ rte_eal_mp_remote_launch(graph_main_rtc_loop, NULL, SKIP_MAIN); or rte_eal_mp_remote_launch(graph_main_mcore_loop, NULL, SKIP_MAIN); > memset(&rewrite_data, 0, sizeof(rewrite_data)); > rewrite_len =3D sizeof(rewrite_data); > diff --git a/lib/graph/rte_graph_worker.h b/lib/graph/rte_graph_worker.h > index 541c373cb1..19b4c1514f 100644 > --- a/lib/graph/rte_graph_worker.h > +++ b/lib/graph/rte_graph_worker.h > @@ -26,6 +26,9 @@ __rte_experimental > static inline void > rte_graph_walk(struct rte_graph *graph) > { > +#define RTE_GRAPH_MODEL_RTC 0 > +#define RTE_GRAPH_MODEL_MCORE_DISPATCH 1 No need for duplicate enum. Please remove enum make this as in public header file. > + Add comment here, On how application uses this, aka. before inlcuding the worker header file #define RTE_GRAPH_MODEL_SELECT RTE_GRAPH_MODEL_RTC. Please change the text as needed. > #if !defined(RTE_GRAPH_MODEL_SELECT) || RTE_GRAPH_MODEL_SELECT =3D=3D RT= E_GRAPH_MODEL_RTC > rte_graph_walk_rtc(graph); > #elif RTE_GRAPH_MODEL_SELECT =3D=3D RTE_GRAPH_MODEL_MCORE_DISPATCH > -- > 2.37.2 >