DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Bruce Richardson" <bruce.richardson@intel.com>,
	"David Marchand" <david.marchand@redhat.com>
Cc: <dev@dpdk.org>, <ferruh.yigit@amd.com>, <thomas@monjalon.net>,
	<konstantin.v.ananyev@yandex.ru>, <ruifeng.wang@arm.com>,
	<zhoumin@loongson.cn>, <drc@linux.vnet.ibm.com>,
	<kda@semihalf.com>, <roretzla@linux.microsoft.com>
Subject: RE: [PATCH 1/2] eal: introduce x86 processor identification
Date: Mon, 25 Sep 2023 12:52:26 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87C06@smartserver.smartshare.dk> (raw)
In-Reply-To: <ZRFd6y8wJqd7TwaF@bricha3-MOBL.ger.corp.intel.com>

> From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> Sent: Monday, 25 September 2023 12.16
> 
> On Mon, Sep 25, 2023 at 11:46:00AM +0200, David Marchand wrote:
> > On Fri, Sep 22, 2023 at 12:40 PM Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > On Fri, Sep 22, 2023 at 11:37:20AM +0200, David Marchand wrote:
> > > > In some really specific cases, it may be needed to get a detailed
> > > > information on the processor running a DPDK application for drivers to
> > > > achieve better performance, or for matters that concern only them.
> > > >
> > > > Those information are highly arch-specific and require a specific API.
> > > >
> > > > Introduce a set of functions to get brand, family and model of a x86
> > > > processor.
> > > > Those functions do not make sense on other arches and a
> > > > driver must first check rte_cpu_is_x86() before anything else.
> > > >
> > > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > > > ---
> > >
> > > Couple of thoughts, having had a few minutes to process this.
> > >
> > > * Rather than rte_cpu_is_x86() API, we could go a general API called
> > >   rte_cpu_arch() which returns either a string, or an enum value. Within
> > >   that, rather than #ifdefs, the actual return value could just be a
> define
> > >   placed by meson in the rte_build_config.h file. The list of families
> > >   according to meson are [1] - we'd just need to merge the 32 and 64-bit
> > >   variants into one in the meson file.
> >
> > Your proposal (in next mail) lgtm.
> >
> >
> > >
> > > * Similarly rather than having is_intel or is_amd functions, we could
> > >   generalize to a "manufacturer" API, which could be applicable for other
> > >   architectures too.
> >
> > Like a rte_cpu_x86_manufacturer() ? which returns an enum too I suppose.
> >
> I was actually thinking a more general "rte_cpu_manufacturer()" which
> returns string, and therefore could be implemented by all architectures.
> Could default to NULL or string "unknown" if not implemented.
> 
> /Bruce

Please stop to think about this!

Nobody cares who manufactured the CPU. E.g. is it Cavium or Marvell... some vendors might have multiple series of CPUs with different features, e.g. from companies they have bought up.

What you are looking for are some sort of "capabilities" APIs, so you can query what the CPU offers. In this context, the CPU is just a device, like any other device. E.g. the ethdev has a bunch of "capabilities" APIs, where you can query for specific features, maximum number of queues, descriptors, and a lot more.



  reply	other threads:[~2023-09-25 10:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22  9:37 [PATCH 0/2] Introduce x86 specific identification API David Marchand
2023-09-22  9:37 ` [PATCH 1/2] eal: introduce x86 processor identification David Marchand
2023-09-22  9:46   ` Bruce Richardson
2023-09-25  9:42     ` David Marchand
2023-09-22 10:38   ` Bruce Richardson
2023-09-22 10:55     ` Bruce Richardson
2023-09-25  9:46     ` David Marchand
2023-09-25 10:16       ` Bruce Richardson
2023-09-25 10:52         ` Morten Brørup [this message]
2023-09-22  9:37 ` [PATCH 2/2] common/mlx5: use EAL " David Marchand

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=98CBD80474FA8B44BF855DF32C47DC35D87C06@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    --cc=ferruh.yigit@amd.com \
    --cc=kda@semihalf.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=roretzla@linux.microsoft.com \
    --cc=ruifeng.wang@arm.com \
    --cc=thomas@monjalon.net \
    --cc=zhoumin@loongson.cn \
    /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).