[PATCH v3 01/10] eal: add interface to check if lcore is EAL managed

Thomas Monjalon thomas at monjalon.net
Thu Jun 11 11:10:39 CEST 2026


11/06/2026 08:16, lihuisong (C):
> On 6/11/2026 7:28 AM, Thomas Monjalon wrote:
> > 22/05/2026 06:11, Huisong Li:
> >> Add a new helper function rte_lcore_is_eal_managed() to determine
> >> if a logical core is managed by EAL.
> >>
> >> This interface returns true if the lcore role is either ROLE_RTE
> >> (standard worker/main cores) or ROLE_SERVICE (service cores).
> > [...]
> >> +RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_lcore_is_eal_managed, 26.07)
> >> +int rte_lcore_is_eal_managed(unsigned int lcore_id)
> >> +{
> >> +	struct rte_config *cfg = rte_eal_get_configuration();
> >> +
> >> +	if (lcore_id >= RTE_MAX_LCORE)
> >> +		return 0;
> >> +	return cfg->lcore_role[lcore_id] == ROLE_RTE ||
> >> +		cfg->lcore_role[lcore_id] == ROLE_SERVICE;
> >> +}
> > I'm not sure about adding this function in the API.
> > We already have rte_eal_lcore_role()
> > and I feel having this explicit ROLE_RTE || ROLE_SERVICE
> > in the code where needed may be less confusing.
> 
> Ack.
> 
> >
> > Note: we should prefix these constants with RTE_LCORE_
> 
> Yeah, it's good.
> 
> This will break API. And we can do this in 26.11.

We can keep the old names as aliases.
Better to not break the API, even in 26.11.
We could decide later, after some time, to remove the aliases.




More information about the dev mailing list