[Public] Hi @Morten Brørup
Would you need me to check this under `rte_topology` pcoming patches? > -----Original Message----- > From: Pavan Nikhilesh Bhagavatula <[email protected]> > Sent: Monday, May 19, 2025 7:46 PM > To: Morten Brørup <[email protected]> > Cc: dev <[email protected]> > Subject: RE: rte_lcore_has_role() return value > > Caution: This message originated from an External Source. Use proper caution > when opening attachments, clicking links, or responding. > > > My bad, I got it confused with lcore topology patches. > > I will look into this. > > Thanks, > Pavan. > > > -----Original Message----- > > From: Pavan Nikhilesh Bhagavatula > > Sent: Monday, May 19, 2025 7:32 PM > > To: Morten Brørup <[email protected]>; Varghese, Vipin > > <[email protected]> > > Cc: dev <[email protected]> > > Subject: RE: rte_lcore_has_role() return value > > > > Hi Morten, > > > > Looks like this is meant for Vipin. > > > > +Vipin > > > > Thanks, > > Pavan. > > > > > Pavan, > > > > > > The rte_lcore_has_role() documentation says it returns bool. > > > > > > Its implementation returns a true value (-1) if given a > > > non-compliant > > lcore_id, > > > e.g. LCORE_ID_ANY. > > > > > > I think it should behave like rte_lcore_is_enabled(), i.e. return > > > false if given a non-compliant lcore_id, e.g. LCORE_ID_ANY. > > > > > > Use case: > > > A control thread in an application might or might not register > > > itself, and the registration might not succeed. > > > > > > At exit of this control thread, it should unregister itself if registered. > > > > > > Fixing rte_lcore_has_role() as suggested would simplify the > > > application from > > > this: > > > > > > if (rte_lcore_id() != LCORE_ID_ANY && > > > rte_eal_lcore_role(rte_lcore_id()) == ROLE_NON_EAL) > > > rte_thread_unregister(); > > > > > > To this: > > > > > > if (rte_lcore_has_role(rte_lcore_id(), ROLE_NON_EAL)) > > > rte_thread_unregister(); > > > > > > -Morten

