Hi Anoob, One other observation in-line:
> -----Original Message----- > From: Anoob Joseph <[email protected]> > Sent: Monday, June 3, 2019 12:33 PM > To: Jerin Jacob <[email protected]>; Rao, Nikhil <[email protected]>; > Carrillo, Erik G <[email protected]>; Gujjar, Abhinandan S > <[email protected]>; Richardson, Bruce > <[email protected]>; De Lara Guarch, Pablo > <[email protected]> > Cc: Anoob Joseph <[email protected]>; Narayana Prasad > <[email protected]>; [email protected]; Lukasz Bartosik > <[email protected]>; Pavan Nikhilesh <[email protected]>; > Hemant Agrawal <[email protected]>; Nipun Gupta > <[email protected]>; Van Haaren, Harry > <[email protected]>; Mattias Rönnblom > <[email protected]>; Ma, Liang J <[email protected]> > 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 <[email protected]> > Signed-off-by: Lukasz Bartosik <[email protected]> > --- <...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

