DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Varghese, Vipin" <Vipin.Varghese@amd.com>
To: "Pavan Nikhilesh Bhagavatula" <pbhagavatula@marvell.com>,
	"Morten Brørup" <mb@smartsharesystems.com>
Cc: dev <dev@dpdk.org>
Subject: RE: rte_lcore_has_role() return value
Date: Tue, 3 Jun 2025 06:07:50 +0000	[thread overview]
Message-ID: <PH7PR12MB859673BB32BC7B05B6ACD55E826DA@PH7PR12MB8596.namprd12.prod.outlook.com> (raw)
In-Reply-To: <PH0PR18MB40867CA69B24733163400ADCDE9CA@PH0PR18MB4086.namprd18.prod.outlook.com>

[Public]

Hi @Morten Brørup

Would you need me to check this under `rte_topology` pcoming patches?

> -----Original Message-----
> From: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Sent: Monday, May 19, 2025 7:46 PM
> To: Morten Brørup <mb@smartsharesystems.com>
> Cc: dev <dev@dpdk.org>
> 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 <mb@smartsharesystems.com>; Varghese, Vipin
> > <vipin.varghese@amd.com>
> > Cc: dev <dev@dpdk.org>
> > 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


  reply	other threads:[~2025-06-03  6:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19  9:59 Morten Brørup
2025-05-19 14:01 ` Pavan Nikhilesh Bhagavatula
2025-05-19 14:15   ` Pavan Nikhilesh Bhagavatula
2025-06-03  6:07     ` Varghese, Vipin [this message]
2025-06-03  6:34       ` Morten Brørup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH7PR12MB859673BB32BC7B05B6ACD55E826DA@PH7PR12MB8596.namprd12.prod.outlook.com \
    --to=vipin.varghese@amd.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=pbhagavatula@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).