[PATCH] eal/x86: cache queried CPU flags
Bruce Richardson
bruce.richardson at intel.com
Mon Oct 7 18:43:48 CEST 2024
On Mon, Oct 07, 2024 at 04:29:31PM +0000, Wathsala Wathawana Vithanage wrote:
> > Rather than re-querying the HW each time a CPU flag is requested, we can just
> > save the return value in the flags array. This should speed up repeated
> > querying of CPU flags, and provides a workaround for a reported issue where
> > errors are seen with constant querying of the AVX-512 CPU flag from a non-
> > AVX VM.
> >
> > Bugzilla Id: 1501
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson at 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?
Thanks,
/Bruce
More information about the dev
mailing list