[dpdk-dev] [PATCH 32/39] eventdev: add routine to launch eventmode workers

Anoob Joseph anoobj at marvell.com
Thu Jun 27 07:50:19 CEST 2019


Hi Erik,

Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Carrillo, Erik G <erik.g.carrillo at intel.com>
> Sent: Monday, June 10, 2019 8:16 PM
> To: Anoob Joseph <anoobj at marvell.com>; Jerin Jacob Kollanukkaran
> <jerinj at marvell.com>; Rao, Nikhil <nikhil.rao at intel.com>; Gujjar,
> Abhinandan S <abhinandan.gujjar at intel.com>; Richardson, Bruce
> <bruce.richardson at intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch at intel.com>
> Cc: Narayana Prasad Raju Athreya <pathreya at marvell.com>; dev at dpdk.org;
> Lukas Bartosik <lbartosik at marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula at marvell.com>; Hemant Agrawal
> <hemant.agrawal at nxp.com>; Nipun Gupta <nipun.gupta at nxp.com>; Van
> Haaren, Harry <harry.van.haaren at intel.com>; Mattias Rönnblom
> <mattias.ronnblom at ericsson.com>; Ma, Liang J <liang.j.ma at intel.com>
> Subject: RE: [PATCH 32/39] eventdev: add routine to launch eventmode
> workers
> 
> Hi Anoob,
> 
> One other observation in-line:
> 
> > -----Original Message-----
> > From: Anoob Joseph <anoobj at marvell.com>
> > Sent: Monday, June 3, 2019 12:33 PM
> > To: Jerin Jacob <jerinj at marvell.com>; Rao, Nikhil
> > <nikhil.rao at intel.com>; Carrillo, Erik G <erik.g.carrillo at intel.com>;
> > Gujjar, Abhinandan S <abhinandan.gujjar at intel.com>; Richardson, Bruce
> > <bruce.richardson at intel.com>; De Lara Guarch, Pablo
> > <pablo.de.lara.guarch at intel.com>
> > Cc: Anoob Joseph <anoobj at marvell.com>; Narayana Prasad
> > <pathreya at marvell.com>; dev at dpdk.org; Lukasz Bartosik
> > <lbartosik at marvell.com>; Pavan Nikhilesh <pbhagavatula at marvell.com>;
> > Hemant Agrawal <hemant.agrawal at nxp.com>; Nipun Gupta
> > <nipun.gupta at nxp.com>; Van Haaren, Harry
> <harry.van.haaren at intel.com>;
> > Mattias Rönnblom <mattias.ronnblom at ericsson.com>; Ma, Liang J
> > <liang.j.ma at 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 <anoobj at marvell.com>
> > Signed-off-by: Lukasz Bartosik <lbartosik at 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.

[Anoob] Will fix this in v2. Will use rte_bitmask APIs instead.
 
> 
> > +		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


More information about the dev mailing list