All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Lu <patrick.lu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "Richardson,
	Bruce" <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "dev-VfR2kkLFssw@public.gmane.org" <dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: [PATCH] Add an API to query enabled core index
Date: Fri, 13 Jun 2014 09:58:28 -0700	[thread overview]
Message-ID: <20140613165828.GA31321@debian-x64.ch.intel.com> (raw)
In-Reply-To: <59AF69C657FD0841A61C55336867B5B01AA357CE-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>

On Thu, Jun 12, 2014 at 08:54:11AM -0700, Richardson, Bruce wrote:
> 
> 
> > -----Original Message-----
> > From: Olivier MATZ [mailto:olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org]
> > Sent: Thursday, June 12, 2014 1:20 AM
> > To: Richardson, Bruce; Thomas Monjalon; Lu, Patrick
> > Cc: dev-VfR2kkLFssw@public.gmane.org
> > Subject: Re: [dpdk-dev] [PATCH] Add an API to query enabled core index
> > 
> > Hello,
> > 
> > On 06/11/2014 11:57 PM, Richardson, Bruce wrote:
> > >> I think core_id2 is not a representative name.
> > >> What do you think of renaming core_id as lcore_hwid and core_id2 as
> > >> lcore_index?
> > >>
> > >> --
> > > I like lcore_index as the name for the new function. However, I'm not sure in
> > that case that we want/need to rename the old one.
> > 
> > What about lcore_rank ?
> > It may avoid confusion between "id" and "index", which are quite
> > close visually and phonetically.
> 
> Not sure about rank, index is more correct. How about making it "app_index" or "app_idx", to indicate that it's not a global id but rather the idx that's local to the running app instance.
> 
> Other alternative approach would be rte_lcore_position() API that takes a hardware lcore id, and tells you it's "position" in the coremask for the application, i.e. lcore 6 is in position 2 (of e.g. 5) lcores, for instance. [It would obviously return -1 on non-active cores.]
The main purpose of this API is for a running thread know its relative
index in all enabled core, so it can access the shared data structure
with correct index. I don't know if we necessarily need to pass in a
hardware lcore id, I suggest the API will implicit call rte_lcore_id.

I think either position or index is a much appropriated name for this
API.
> 
> > 
> > I agree that we should not change the old lcore_id, its name is already
> > appropriate.
> > 
> And it's so widely used that changing it would break the code of probably every single Intel DPDK application ever written!

  parent reply	other threads:[~2014-06-13 16:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 20:45 [PATCH] Add an API to query enabled core index Patrick Lu
     [not found] ` <1402519509-26653-1-git-send-email-Patrick.Lu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-06-11 21:51   ` Thomas Monjalon
2014-06-11 21:57     ` Richardson, Bruce
     [not found]       ` <59AF69C657FD0841A61C55336867B5B01AA35210-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-11 22:50         ` Thomas Monjalon
2014-06-11 23:27           ` Richardson, Bruce
     [not found]             ` <59AF69C657FD0841A61C55336867B5B01AA352EF-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-12  0:18               ` Dumitrescu, Cristian
2014-06-12  8:20         ` Olivier MATZ
     [not found]           ` <539962C0.10701-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-06-12 15:54             ` Richardson, Bruce
     [not found]               ` <59AF69C657FD0841A61C55336867B5B01AA357CE-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-13 16:58                 ` Patrick Lu [this message]
     [not found]                   ` <20140613165828.GA31321-GQGeBJRQ6etbn3E1eTv7vNh3ngVCH38I@public.gmane.org>
2014-06-13 17:25                     ` Richardson, Bruce
2014-06-11 21:58     ` Lu, Patrick
     [not found]       ` <EFC7DD9FAC418F4683FA895DBD8B35A30E1B9C53-AtyAts71sc+krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-06-11 22:46         ` Thomas Monjalon

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=20140613165828.GA31321@debian-x64.ch.intel.com \
    --to=patrick.lu-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.