> -----Original Message----- > From: Jerin Jacob <jerinjac...@gmail.com> > Sent: Wednesday, June 7, 2023 9:26 PM > To: Yan, Zhirun <zhirun....@intel.com> > Cc: dev@dpdk.org; jer...@marvell.com; kirankum...@marvell.com; > ndabilpu...@marvell.com; step...@networkplumber.org; > pbhagavat...@marvell.com; Liang, Cunming <cunming.li...@intel.com>; Wang, > Haiyue <haiyue.w...@intel.com>; mattias.ronnblom > <mattias.ronnb...@ericsson.com> > Subject: Re: [PATCH v9 13/17] graph: enable graph multicore dispatch scheduler > model > > On Wed, Jun 7, 2023 at 5:55 PM Yan, Zhirun <zhirun....@intel.com> wrote: > > > > > > > > rte_graph_walk(struct rte_graph *graph) { > > > > +#if !defined(RTE_GRAPH_MODEL_SELECT) || > RTE_GRAPH_MODEL_SELECT > > > == > > > > +RTE_GRAPH_MODEL_RTC > > > > > > Is nt defined instead of !defined? > > > > > > > !defined(XX) means not defined XX. > > What is nt defined means? > > #undef RTE_GRAPH_MODEL_SELECT or not #define > RTE_GRAPH_MODEL_SELECT anywhere in .c file. >
In the implementation, RTE_GRAPH_MODEL_SELECT is only defined once in app I think #if !define(XX) is a judgement, #undef XX is an action. Here should be #if !define(XX) For this impl, I treat not define as default and go into rtc_walk(). So If we treat not defined RTE_GRAPH_MODEL_SELECT as runtime pick. The #else case should cover: 1. Not defined and 2. Defined other type. It should be as follow: rte_graph_walk() { #if defined(RTE_GRAPH_MODEL_SELECT) && RTE_GRAPH_MODEL_SELECT == RTE_GRAPH_MODEL_RTC rte_graph_walk_rtc(); #elif defined(RTE_GRAPH_MODEL_SELECT) && RTE_GRAPH_MODEL_SELECT == RTE_GRAPH_MODEL_MCORE_DISPATCH rte_graph_walk_mcore_dispatch(graph); #else const int model = rte_graph_worker_model_no_check_get(); switch (model) { case RTE_GRAPH_MODEL_MCORE_DISPATCH: rte_graph_walk_mcore_dispatch(); break; default: rte_graph_walk_rtc(); } #endif } > > > > > Use bracket around RTE_GRAPH_MODEL_SELECT == > RTE_GRAPH_MODEL_RTC. > > > > > Ok. > > > > > > > > > rte_graph_walk_rtc(graph); > > > > +#elif defined(RTE_GRAPH_MODEL_SELECT) && > RTE_GRAPH_MODEL_SELECT > > > == > > > > +RTE_GRAPH_MODEL_MCORE_DISPATCH > > > > > > Use bracket around RTE_GRAPH_MODEL_SELECT == > > Ok. > > > > > > > + rte_graph_walk_mcore_dispatch(graph); > > > > +#else > > > > + int model = rte_graph_worker_model_get(graph); > > > > > > Introduce rte_graph_worker_model_no_check_get() as commented earlier. > > > > Got it. > >