DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>,
	nd <nd@arm.com>, nd <nd@arm.com>
Subject: RE: [PATCH] eal/x86: cache queried CPU flags
Date: Mon, 7 Oct 2024 17:30:24 +0000	[thread overview]
Message-ID: <PAWPR08MB8909CF3CD24192DE8826061D9F7D2@PAWPR08MB8909.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <ZwQPxDDMBM8IXyRS@bricha3-mobl1.ger.corp.intel.com>

> > Hi Bruce,
> > Why x86/rte_cpuflags.c is not using rte_getauxval() ?
> 
> I don't see any such DPDK function, unless I'm missing something? I do see a
> linux function which includes hw capability flags. I suspect the reasons we
> don't use that are:
> 
> 1. Lack of awareness of it (at least on my end! :-)) 2. Originally when we added
> flags for new instruction sets we may have
>    needed to support their detection on platforms where the kernel/libc was
>    too old to be aware of them.
> 3. It's linux only, so we'd still need these cpuid calls for other OS's
>    anyway.
> 
> Therefore, I don't see any benefit in using that function over what we do now.
> Is there some benefit that you see that makes you think it would be
> worthwhile switching?
> 

Agree, all these are good reasons to avoid it. 
getauxval() reads these values from process stack (ELF loader places it there), so it's
a relatively fast way of finding cpu features. I'm wondering if a similar mechanism is
available in FreeBSD and Windows. 
If so, it might be beneficial to have a common API for such functions.
But as you mentioned, if the kernel isn't aware of the feature it may fail. 

  reply	other threads:[~2024-10-07 17:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 11:06 Bruce Richardson
2024-10-07 11:23 ` David Marchand
2024-10-07 14:47   ` Wathsala Wathawana Vithanage
2024-10-07 16:29 ` Wathsala Wathawana Vithanage
2024-10-07 16:43   ` Bruce Richardson
2024-10-07 17:30     ` Wathsala Wathawana Vithanage [this message]
2024-10-11 12:42 ` Konstantin Ananyev
2024-10-11 12:48   ` Bruce Richardson
2024-10-11 13:00     ` Konstantin Ananyev
2024-10-11 13:31 ` Bruce Richardson
2024-10-11 13:33 ` [PATCH v2] " Bruce Richardson
2024-10-11 13:37   ` Konstantin Ananyev
2024-10-14 18:29     ` 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=PAWPR08MB8909CF3CD24192DE8826061D9F7D2@PAWPR08MB8909.eurprd08.prod.outlook.com \
    --to=wathsala.vithanage@arm.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.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).