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 27B6D42B8A; Wed, 24 May 2023 10:00:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDDA440ED8; Wed, 24 May 2023 10:00:39 +0200 (CEST) Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) by mails.dpdk.org (Postfix) with ESMTP id 5E73C4067E for ; Wed, 24 May 2023 10:00:39 +0200 (CEST) Received: by mail-vs1-f49.google.com with SMTP id ada2fe7eead31-43931d2b92eso207844137.2 for ; Wed, 24 May 2023 01:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684915238; x=1687507238; 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=hSfiJm3CSNLI1lOS8M5i6NzB2/+NXE9hl6HAUyty9uA=; b=lSR3kRJ0el0n6hFnACIOfQJS2whX77P7oL25Kr6SzHp5+FbMLA203rYfIA7tQ7OPxn L15b6zaS8nFs8SQZYLZRLM2djfY7+mPrnyXYPplk4Fr5Fp7lwnA5W7QBgKGFfLBbTOOd QNktLtHqbVTE7HT04oAPESc6LlTufyP8O94MftK5S/y8drmvq+O+v7BNBf78D/X/DiiC 7t+URIwR610TJmPEwHunOwmsKfmPpREYH9Q0Y78dnCn5OsTXaqzqyvQXzkQkAxRZyIuZ N0Yamjy6bSlz2axs581GVRFwERttgKu8bQpMgCuS+f8gnzdyTkMS8EH0cru3PUHwfnRS 4KGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684915238; x=1687507238; 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=hSfiJm3CSNLI1lOS8M5i6NzB2/+NXE9hl6HAUyty9uA=; b=RK7YQpp0Giu5ctLw2Eokddux6M/yl1HLqz7x1sBKJ1oLHydoXXiYTaAZ0/Gxx79RoY 0NeXSaDiSvaFcKONxlmHBMtcNdRUBlwPbWAATdVQiNiwhJ3mYGORu82kMS+Z74lQxQ8d B6xAVo1AU5qy2NDzh84vckLNz8TYSgQ/oBiPuzqXAyqysnHbWO7ehYA+UYs07k0YWJ1G Ja1r0WFSwp8nVAFQB5jdWn63PS/3hCulSlvX/SyrhZQzTXcoMUmFUWvZiOP031HV26ge +HnlkHPWPcY89/yd/i3eQ5WryvFR/g4Hat7sYPdhSjGGR/+UU4jtJkpqctsLx0ZCzwDO 1oZA== X-Gm-Message-State: AC+VfDzbgfBvHXkSsxQJcD3t+i2sTFdLqVS1rqiplr2o5T0B/TgJZh84 exrKDomeOqkiGPiDwUtBfXA1DnBFMFzhZpqiJTc= X-Google-Smtp-Source: ACHHUZ4s9KNbSzMI9/+N3yxEcfnUwt/vF4GAp4JbqNr6J6Om36+NzVo2w+ReseddgNT8v7ugcBHiGwJMoneQlx/BZuo= X-Received: by 2002:a67:fe17:0:b0:437:e722:5f65 with SMTP id l23-20020a67fe17000000b00437e7225f65mr4602084vsr.16.1684915238493; Wed, 24 May 2023 01:00:38 -0700 (PDT) MIME-Version: 1.0 References: <20230331040306.3143693-1-zhirun.yan@intel.com> <20230509060347.1237884-1-zhirun.yan@intel.com> <20230509060347.1237884-10-zhirun.yan@intel.com> In-Reply-To: <20230509060347.1237884-10-zhirun.yan@intel.com> From: Jerin Jacob Date: Wed, 24 May 2023 13:30:12 +0530 Message-ID: Subject: Re: [PATCH v6 09/15] graph: introduce stream moving cross cores 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 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 Tue, May 9, 2023 at 11:35=E2=80=AFAM Zhirun Yan w= rote: > > This patch introduces key functions to allow a worker thread to > enable enqueue and move streams of objects to the next nodes over > different cores. different cores-> different cores for mcore dispatch model. > > Signed-off-by: Haiyue Wang > Signed-off-by: Cunming Liang > Signed-off-by: Zhirun Yan > --- > lib/graph/graph.c | 6 +- > lib/graph/graph_private.h | 30 +++++ > lib/graph/meson.build | 2 +- > lib/graph/rte_graph.h | 15 ++- > lib/graph/rte_graph_model_dispatch.c | 157 +++++++++++++++++++++++++++ > lib/graph/rte_graph_model_dispatch.h | 37 +++++++ > lib/graph/version.map | 2 + > 7 files changed, 244 insertions(+), 5 deletions(-) > > diff --git a/lib/graph/graph.c b/lib/graph/graph.c > index e809aa55b0..f555844d8f 100644 > --- a/lib/graph/graph.c > +++ b/lib/graph/graph.c > @@ -495,7 +495,7 @@ clone_name(struct graph *graph, struct graph *parent_= graph, const char *name) > } > > static rte_graph_t > -graph_clone(struct graph *parent_graph, const char *name) > +graph_clone(struct graph *parent_graph, const char *name, struct rte_gra= ph_param *prm) > { > struct graph_node *graph_node; > struct graph *graph; > @@ -566,14 +566,14 @@ graph_clone(struct graph *parent_graph, const char = *name) > } > > --- a/lib/graph/rte_graph.h > +++ b/lib/graph/rte_graph.h > @@ -169,6 +169,17 @@ struct rte_graph_param { > bool pcap_enable; /**< Pcap enable. */ > uint64_t num_pkt_to_capture; /**< Number of packets to capture. *= / > char *pcap_filename; /**< Filename in which packets to be capture= d.*/ > + > + RTE_STD_C11 > + union { > + struct { > + uint64_t rsvd[8]; > + } rtc; > + struct { > + uint32_t wq_size_max; > + uint32_t mp_capacity; Add doxgen comment for all please. > + } dispatch; > + }; > }; > > /** > @@ -260,12 +271,14 @@ int rte_graph_destroy(rte_graph_t id); > * Name of the new graph. The library prepends the parent graph name t= o the > * user-specified name. The final graph name will be, > * "parent graph name" + "-" + name. > + * @param prm > + * Graph parameter, includes model-specific parameters in this graph. > * > * @return > * Valid graph id on success, RTE_GRAPH_ID_INVALID otherwise. > */ > __rte_experimental > -rte_graph_t rte_graph_clone(rte_graph_t id, const char *name); > +rte_graph_t rte_graph_clone(rte_graph_t id, const char *name, struct rte= _graph_param *prm); > > /** > +void > +__rte_graph_sched_wq_process(struct rte_graph *graph) > +{ > + struct graph_sched_wq_node *wq_node; > + struct rte_mempool *mp =3D graph->mp; > + struct rte_ring *wq =3D graph->wq; > + uint16_t idx, free_space; > + struct rte_node *node; > + unsigned int i, n; > + struct graph_sched_wq_node *wq_nodes[32]; Use RTE_GRAPH_BURST_SIZE instead of 32, if it is anything do with burst size? else ignore. > + > + n =3D rte_ring_sc_dequeue_burst_elem(wq, wq_nodes, sizeof(wq_node= s[0]), > + RTE_DIM(wq_nodes), NULL); > + if (n =3D=3D 0) > + return; > + > + for (i =3D 0; i < n; i++) { > + wq_node =3D wq_nodes[i]; > + node =3D RTE_PTR_ADD(graph, wq_node->node_off); > + RTE_ASSERT(node->fence =3D=3D RTE_GRAPH_FENCE); > + idx =3D node->idx; > + free_space =3D node->size - idx; > + > + if (unlikely(free_space < wq_node->nb_objs)) > + __rte_node_stream_alloc_size(graph, node, node->s= ize + wq_node->nb_objs); > + > + memmove(&node->objs[idx], wq_node->objs, wq_node->nb_objs= * sizeof(void *)); > + node->idx =3D idx + wq_node->nb_objs; > + > + __rte_node_process(graph, node); > + > + wq_node->nb_objs =3D 0; > + node->idx =3D 0; > + } > + > + rte_mempool_put_bulk(mp, (void **)wq_nodes, n); > +} > + > +/** > + * @internal For both internal function, you can add Doxygen comment as @note to tell this must not be used directly. > + * > + * Process all nodes (streams) in the graph's work queue. > + * > + * @param graph > + * Pointer to the graph object. > + */ > +__rte_experimental > +void __rte_graph_sched_wq_process(struct rte_graph *graph); > + > /** > * Set lcore affinity with the node. > * > diff --git a/lib/graph/version.map b/lib/graph/version.map > index aaa86f66ed..d511133f39 100644 > --- a/lib/graph/version.map > +++ b/lib/graph/version.map > @@ -48,6 +48,8 @@ EXPERIMENTAL { > > rte_graph_worker_model_set; > rte_graph_worker_model_get; > + __rte_graph_sched_wq_process; > + __rte_graph_sched_node_enqueue; Please add _mcore_dispatch_ name space. > > rte_graph_model_dispatch_lcore_affinity_set; > > -- > 2.37.2 >