patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] fib6: add runtime checks for vector lookup
@ 2024-10-08 17:31 Vladimir Medvedkin
  2024-10-11  9:29 ` David Marchand
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Medvedkin @ 2024-10-08 17:31 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, stable

AVX512 lookup function requires CPU to support RTE_CPUFLAG_AVX512DQ and
RTE_CPUFLAG_AVX512BW. Add runtime checks of these two flags when deciding
if vector function can be used.

Fixes: c3e12e0f0354 ("fib: add dataplane algorithm for IPv6")
Cc: stable@dpdk.org

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 lib/fib/trie.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index 09470e7287..805e21d090 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -47,6 +47,8 @@ get_vector_fn(enum rte_fib_trie_nh_sz nh_sz)
 {
 #ifdef CC_TRIE_AVX512_SUPPORT
 	if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) <= 0) ||
+		(rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ) <= 0) ||
+		(rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) <= 0) ||
 			(rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_512))
 		return NULL;
 	switch (nh_sz) {
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fib6: add runtime checks for vector lookup
  2024-10-08 17:31 [PATCH] fib6: add runtime checks for vector lookup Vladimir Medvedkin
@ 2024-10-11  9:29 ` David Marchand
  0 siblings, 0 replies; 2+ messages in thread
From: David Marchand @ 2024-10-11  9:29 UTC (permalink / raw)
  To: Vladimir Medvedkin, Bruce Richardson, Mcnamara, John
  Cc: dev, stable, Thomas Monjalon

On Tue, Oct 8, 2024 at 7:31 PM Vladimir Medvedkin
<vladimir.medvedkin@intel.com> wrote:
>
> AVX512 lookup function requires CPU to support RTE_CPUFLAG_AVX512DQ and
> RTE_CPUFLAG_AVX512BW. Add runtime checks of these two flags when deciding
> if vector function can be used.
>

Fixes: 1e5630e40d95 ("fib6: add AVX512 lookup")

> Cc: stable@dpdk.org
>
> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>

I wish we had a build check for those.
Or maybe a tool/script that would look at libraries/drivers, catch
_mmXXXXX intrinsics and warn if such a library/driver has no call to
corresponding runtime check.
That would save us from having to go to
https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html
...

Could someone from Intel work on this?


In any case, adjusted indent, fixed Fixes: tag, removed superfluous
parenthesis, and applied, thanks.

-- 
David Marchand


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-11  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-08 17:31 [PATCH] fib6: add runtime checks for vector lookup Vladimir Medvedkin
2024-10-11  9:29 ` David Marchand

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).