Hi Anoob, One other observation in-line:
> -----Original Message----- > From: Anoob Joseph <ano...@marvell.com> > Sent: Monday, June 3, 2019 12:33 PM > To: Jerin Jacob <jer...@marvell.com>; Rao, Nikhil <nikhil....@intel.com>; > Carrillo, Erik G <erik.g.carri...@intel.com>; Gujjar, Abhinandan S > <abhinandan.guj...@intel.com>; Richardson, Bruce > <bruce.richard...@intel.com>; De Lara Guarch, Pablo > <pablo.de.lara.gua...@intel.com> > Cc: Anoob Joseph <ano...@marvell.com>; Narayana Prasad > <pathr...@marvell.com>; dev@dpdk.org; Lukasz Bartosik > <lbarto...@marvell.com>; Pavan Nikhilesh <pbhagavat...@marvell.com>; > Hemant Agrawal <hemant.agra...@nxp.com>; Nipun Gupta > <nipun.gu...@nxp.com>; Van Haaren, Harry > <harry.van.haa...@intel.com>; Mattias Rönnblom > <mattias.ronnb...@ericsson.com>; Ma, Liang J <liang.j...@intel.com> > Subject: [PATCH 32/39] eventdev: add routine to launch eventmode workers > > With eventmode, workers could be drafted differently according to the > capabilities of the underlying event device. The added function would > receive an array of such workers and probes the eventmode properties to > choose the worker. > > Signed-off-by: Anoob Joseph <ano...@marvell.com> > Signed-off-by: Lukasz Bartosik <lbarto...@marvell.com> > --- <...Snipped...> > + > +void __rte_experimental > +rte_eventmode_helper_launch_worker(struct > rte_eventmode_helper_conf *mode_conf, > + struct rte_eventmode_helper_app_worker_params > *app_wrkr, > + uint8_t nb_wrkr_param) > +{ > + struct rte_eventmode_helper_app_worker_params *match_wrkr; > + uint32_t lcore_id; > + struct eventmode_conf *em_conf; > + > + if (mode_conf == NULL) { > + RTE_EM_HLPR_LOG_ERR("Invalid conf"); > + return; > + } > + > + if (mode_conf->mode_params == NULL) { > + RTE_EM_HLPR_LOG_ERR("Invalid mode params"); > + return; > + } > + > + /* Get eventmode conf */ > + em_conf = (struct eventmode_conf *)(mode_conf->mode_params); > + > + /* Get core ID */ > + lcore_id = rte_lcore_id(); > + > + /* TODO check capability for rx core */ > + > + /* Check if this is rx core */ > + if (em_conf->eth_core_mask & (1 << lcore_id)) { In the above, eth_core_mask is a uint32_t, but RTE_MAX_LCORE=128 in the common config. > + rte_eventmode_helper_start_worker_eth_core(em_conf, > lcore_id); > + return; > + } > + > + if (app_wrkr == NULL || nb_wrkr_param == 0) { > + RTE_EM_HLPR_LOG_ERR("Invalid args"); > + return; > + } > + > + /* > + * This is a regular worker thread. The application would be > + * registering multiple workers with various capabilities. The > + * worker to be run will be selected by the capabilities of the > + * event device configured. > + */ > + > + /* Get the first matching worker for the event device */ > + match_wrkr = rte_eventmode_helper_find_worker(lcore_id, > + em_conf, > + app_wrkr, > + nb_wrkr_param); > + > + if (match_wrkr == NULL) { > + RTE_EM_HLPR_LOG_ERR( > + "No matching worker registered for lcore %d", > lcore_id); > + goto clean_and_exit; > + } > + > + /* Verify sanity of the matched worker */ > + if (rte_eventmode_helper_verify_match_worker(match_wrkr) != 1) > { > + RTE_EM_HLPR_LOG_ERR("Error in validating the matched > worker"); > + goto clean_and_exit; > + } > + > + /* Launch the worker thread */ > + match_wrkr->worker_thread(mode_conf); > + > +clean_and_exit: > + > + /* Flag eth_cores to stop, if started */ > + rte_eventmode_helper_stop_worker_eth_core(); > +} <...Snipped...> Regards, Erik