DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC 1/5] eal: add accessor functions for lcore_config
Date: Fri, 5 Apr 2019 09:33:35 -0700	[thread overview]
Message-ID: <20190405093335.72df8ac0@shemminger-XPS-13-9360> (raw)
In-Reply-To: <CAJFAV8wxPbyhA1MJ6+TEKrFRwV74gih_OzrOzpttbdDDj4Fjrg@mail.gmail.com>

On Fri, 5 Apr 2019 13:01:10 +0200
David Marchand <david.marchand@redhat.com> wrote:

> On Wed, Apr 3, 2019 at 7:16 PM Stephen Hemminger <stephen@networkplumber.org>
> wrote:
> 
> > diff --git a/lib/librte_eal/common/eal_common_lcore.c
> > b/lib/librte_eal/common/eal_common_lcore.c
> > index 1cbac42286ba..806204d9f73d 100644
> > --- a/lib/librte_eal/common/eal_common_lcore.c
> > +++ b/lib/librte_eal/common/eal_common_lcore.c
> > @@ -16,6 +16,52 @@
> >  #include "eal_private.h"
> >  #include "eal_thread.h"
> >
> > +int rte_lcore_index(int lcore_id)
> > +{
> > +       if (unlikely(lcore_id >= RTE_MAX_LCORE))
> > +               return -1;
> > +
> > +       if (lcore_id < 0)
> > +               lcore_id = (int)rte_lcore_id();
> > +
> > +       return lcore_config[lcore_id].core_index;
> > +}
> >  
> +
> > +int rte_lcore_to_cpu_id(int lcore_id)
> > +{
> > +       if (unlikely(lcore_id >= RTE_MAX_LCORE))
> > +               return -1;
> > +
> > +       if (lcore_id < 0)
> > +               lcore_id = (int)rte_lcore_id();
> > +
> > +       return lcore_config[lcore_id].core_id;
> > +}
> > +
> > +rte_cpuset_t rte_lcore_cpuset(unsigned lcore_id)
> >  
> 
> unsigned int
> 
> +{
> > +       return lcore_config[lcore_id].cpuset;
> > +}
> >  
> 
> I am a bit skeptical at what dpaa wants to do with this.
> Anyway, it can be used when we want to check the current cpuset.


Since cpuset is defined  already, don't want to override it with
unsigned.

> +
> > +unsigned
> >  
> 
> unsigned int
> 
> +rte_lcore_to_socket_id(unsigned int lcore_id)
> > +{
> > +       return lcore_config[lcore_id].socket_id;
> > +}
> > +
> > +enum rte_lcore_state_t
> > +rte_lcore_state(unsigned lcore_id)
> >  
> 
> unsigned int
> 
> +{
> > +       return lcore_config[lcore_id].state;
> > +}
> >  
> 
> This is a duplicate for existing rte_eal_get_lcore_state() in
> lib/librte_eal/common/eal_common_launch.c.
> So either we keep rte_eal_get_lcore_state() or we replace it with this new
> one.

Good point.

  parent reply	other threads:[~2019-04-05 16:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 17:16 [dpdk-dev] [RFC 0/5] make lcore_config less visible Stephen Hemminger
2019-04-03 17:16 ` Stephen Hemminger
2019-04-03 17:16 ` [dpdk-dev] [RFC 1/5] eal: add accessor functions for lcore_config Stephen Hemminger
2019-04-03 17:16   ` Stephen Hemminger
2019-04-05 11:01   ` David Marchand
2019-04-05 11:01     ` David Marchand
2019-04-05 16:33     ` Stephen Hemminger [this message]
2019-04-05 16:33       ` Stephen Hemminger
2019-04-03 17:16 ` [dpdk-dev] [RFC 2/5] bus: use lcore accessor functions Stephen Hemminger
2019-04-03 17:16   ` Stephen Hemminger
2019-04-03 17:16 ` [dpdk-dev] [RFC 3/5] examples/bond: use lcore accessor Stephen Hemminger
2019-04-03 17:16   ` Stephen Hemminger
2019-04-03 17:16 ` [dpdk-dev] [RFC 4/5] app/test: use lcore accessor functions Stephen Hemminger
2019-04-03 17:16   ` Stephen Hemminger
2019-04-03 17:16 ` [dpdk-dev] [RFC 5/5] eal: make lcore_config private Stephen Hemminger
2019-04-03 17:16   ` Stephen Hemminger

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=20190405093335.72df8ac0@shemminger-XPS-13-9360 \
    --to=stephen@networkplumber.org \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.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 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).