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 CB08241CEC; Mon, 20 Feb 2023 14:40:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BBF7343045; Mon, 20 Feb 2023 14:40:15 +0100 (CET) Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com [209.85.217.53]) by mails.dpdk.org (Postfix) with ESMTP id 22CA240395 for ; Mon, 20 Feb 2023 14:40:14 +0100 (CET) Received: by mail-vs1-f53.google.com with SMTP id o6so937611vsq.10 for ; Mon, 20 Feb 2023 05:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1676900413; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZyGemmlejG0O2G6GYOk3sLWxNgR7jcIvqdUkQarLqWs=; b=J8VAQ8p10o0l5JLOc07SPhMcmCdL8ooeKYSfPGjkX/jBf0LWBHHoHDlk3tHV0GyuZ/ STEGq1ef/3K/G6SzumWQgfwX3PO7Z6rVJhZhJqwJtzHd90Yh7Ar7bP3AyOPRHn63gKKz 2aAnf2TGlLNMgeZMF1QitsdWNtlruRHX2xrFRRAYdDmcuBK3Kx1pSKUp49zgBWC0w9GQ 0dQf9sNRYBBNlMAJWrtZ0DfTNgK83gExu6fnWZ8vNn/+v8ToBofK4s/waIPvDEIqCD/p 7BRVOwpjZuldHXrE2c/EQL+VrSM88rz3V0iLfXxglM6ZroBugbf79NKiQbXdzVOr/4ty iw/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1676900413; h=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=ZyGemmlejG0O2G6GYOk3sLWxNgR7jcIvqdUkQarLqWs=; b=nxBEe6W6CSic0QD2tEpyYztJ02HfQONML2hhzDyZi1ptaebQKTodlWBzG0QAQulVWO /uxRf1vxCGXBh1nCheFKZXJLxkon5Mnm7L5KzA029UvxJfJfofKuuQ4TXUNMpBQzfqyt Mp8U0Q8XqjmcfxWxAeCJCreWIYS+jFufGCB9ZUpqtI3tf2Pa18MdBCpXrRCDWvG4DAdG gKTHlocI/wR6LpvclM2pXjRzrLjy3OEQgm/FnQu7tIUC7ZTDWQBxcaliG/KGsrfegKF8 m7O4T4h5pG+4NlAUioOKsNippKX4NpJ10uohGdFYqQgy0ol9NPtBtfRgzuGAaDoqx5fm rLDg== X-Gm-Message-State: AO0yUKUye0FtsMisgF+ceZxgpdz7fdZM0Z2sE5gruJ3WOgU5MfbVLYeB UqGO2eAM9kIqeXMDu4BDAHtcb+gxPkU6eD4sFnY= X-Google-Smtp-Source: AK7set9smecTsg7hPuuGMUhGfNmd0t3gmxR07mug4HKmi70746LNcDODn18PQnGrOov7hmQASp1QfQ5u2i2/Bix7cAE= X-Received: by 2002:a05:6102:38d4:b0:3f0:89e1:7c80 with SMTP id k20-20020a05610238d400b003f089e17c80mr265494vst.72.1676900413307; Mon, 20 Feb 2023 05:40:13 -0800 (PST) MIME-Version: 1.0 References: <20221117050926.136974-1-zhirun.yan@intel.com> <20221117050926.136974-3-zhirun.yan@intel.com> In-Reply-To: <20221117050926.136974-3-zhirun.yan@intel.com> From: Jerin Jacob Date: Mon, 20 Feb 2023 19:09:47 +0530 Message-ID: Subject: Re: [PATCH v1 02/13] graph: move node process into inline function To: Zhirun Yan Cc: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com, cunming.liang@intel.com, haiyue.wang@intel.com Content-Type: text/plain; charset="UTF-8" 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 Thu, Nov 17, 2022 at 10:40 AM Zhirun Yan wrote: > > Node process is a single and reusable block, move the code into an inline > function. > > Signed-off-by: Haiyue Wang > Signed-off-by: Cunming Liang > Signed-off-by: Zhirun Yan Acked-by: Jerin Jacob > --- > lib/graph/rte_graph_model_rtc.h | 18 +--------------- > lib/graph/rte_graph_worker_common.h | 33 +++++++++++++++++++++++++++++ > 2 files changed, 34 insertions(+), 17 deletions(-) > > diff --git a/lib/graph/rte_graph_model_rtc.h b/lib/graph/rte_graph_model_rtc.h > index fb58730bde..c80b0ce962 100644 > --- a/lib/graph/rte_graph_model_rtc.h > +++ b/lib/graph/rte_graph_model_rtc.h > @@ -16,9 +16,6 @@ rte_graph_walk_rtc(struct rte_graph *graph) > const rte_node_t mask = graph->cir_mask; > uint32_t head = graph->head; > struct rte_node *node; > - uint64_t start; > - uint16_t rc; > - void **objs; > > /* > * Walk on the source node(s) ((cir_start - head) -> cir_start) and then > @@ -37,20 +34,7 @@ rte_graph_walk_rtc(struct rte_graph *graph) > */ > while (likely(head != graph->tail)) { > node = (struct rte_node *)RTE_PTR_ADD(graph, cir_start[(int32_t)head++]); > - RTE_ASSERT(node->fence == RTE_GRAPH_FENCE); > - objs = node->objs; > - rte_prefetch0(objs); > - > - if (rte_graph_has_stats_feature()) { > - start = rte_rdtsc(); > - rc = node->process(graph, node, objs, node->idx); > - node->total_cycles += rte_rdtsc() - start; > - node->total_calls++; > - node->total_objs += rc; > - } else { > - node->process(graph, node, objs, node->idx); > - } > - node->idx = 0; > + __rte_node_process(graph, node); > head = likely((int32_t)head > 0) ? head & mask : head; > } > graph->tail = 0; > diff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h > index 91a5de7fa4..b7b2bb958c 100644 > --- a/lib/graph/rte_graph_worker_common.h > +++ b/lib/graph/rte_graph_worker_common.h > @@ -121,6 +121,39 @@ void __rte_node_stream_alloc_size(struct rte_graph *graph, > > /* Fast path helper functions */ > > +/** > + * @internal > + * > + * Enqueue a given node to the tail of the graph reel. > + * > + * @param graph > + * Pointer Graph object. > + * @param node > + * Pointer to node object to be enqueued. > + */ > +static __rte_always_inline void > +__rte_node_process(struct rte_graph *graph, struct rte_node *node) > +{ > + uint64_t start; > + uint16_t rc; > + void **objs; > + > + RTE_ASSERT(node->fence == RTE_GRAPH_FENCE); > + objs = node->objs; > + rte_prefetch0(objs); > + > + if (rte_graph_has_stats_feature()) { > + start = rte_rdtsc(); > + rc = node->process(graph, node, objs, node->idx); > + node->total_cycles += rte_rdtsc() - start; > + node->total_calls++; > + node->total_objs += rc; > + } else { > + node->process(graph, node, objs, node->idx); > + } > + node->idx = 0; > +} > + > /** > * @internal > * > -- > 2.25.1 >