DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: david.marchand@redhat.com,
	Bruce Richardson <bruce.richardson@intel.com>,
	Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Subject: [PATCH v4 08/11] fib: use common AVX build handling
Date: Wed, 19 Mar 2025 17:29:38 +0000	[thread overview]
Message-ID: <20250319172942.2992053-9-bruce.richardson@intel.com> (raw)
In-Reply-To: <20250319172942.2992053-1-bruce.richardson@intel.com>

Remove custom logic for building AVX2 and AVX-512 files. Within the C
code this requires some renaming of build macros to use the standard
defines.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/fib/dir24_8.c   |  6 +++---
 lib/fib/meson.build | 18 +-----------------
 lib/fib/trie.c      |  6 +++---
 3 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/lib/fib/dir24_8.c b/lib/fib/dir24_8.c
index c48d962d41..2ba7e93511 100644
--- a/lib/fib/dir24_8.c
+++ b/lib/fib/dir24_8.c
@@ -16,11 +16,11 @@
 #include "dir24_8.h"
 #include "fib_log.h"
 
-#ifdef CC_DIR24_8_AVX512_SUPPORT
+#ifdef CC_AVX512_SUPPORT
 
 #include "dir24_8_avx512.h"
 
-#endif /* CC_DIR24_8_AVX512_SUPPORT */
+#endif /* CC_AVX512_SUPPORT */
 
 #define DIR24_8_NAMESIZE	64
 
@@ -63,7 +63,7 @@ get_scalar_fn_inlined(enum rte_fib_dir24_8_nh_sz nh_sz, bool be_addr)
 static inline rte_fib_lookup_fn_t
 get_vector_fn(enum rte_fib_dir24_8_nh_sz nh_sz, bool be_addr)
 {
-#ifdef CC_DIR24_8_AVX512_SUPPORT
+#ifdef CC_AVX512_SUPPORT
 	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) <= 0 ||
 			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ) <= 0 ||
 			rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_512)
diff --git a/lib/fib/meson.build b/lib/fib/meson.build
index 0c19cc8201..55d9ddcee9 100644
--- a/lib/fib/meson.build
+++ b/lib/fib/meson.build
@@ -15,21 +15,5 @@ deps += ['rcu']
 deps += ['net']
 
 if dpdk_conf.has('RTE_ARCH_X86_64')
-    if target_has_avx512
-        cflags += ['-DCC_DIR24_8_AVX512_SUPPORT', '-DCC_TRIE_AVX512_SUPPORT']
-        sources += files('dir24_8_avx512.c', 'trie_avx512.c')
-
-    elif cc_has_avx512
-        cflags += ['-DCC_DIR24_8_AVX512_SUPPORT', '-DCC_TRIE_AVX512_SUPPORT']
-        dir24_8_avx512_tmp = static_library('dir24_8_avx512_tmp',
-                'dir24_8_avx512.c',
-                dependencies: [static_rte_eal, static_rte_rcu],
-                c_args: cflags + cc_avx512_flags)
-        objs += dir24_8_avx512_tmp.extract_objects('dir24_8_avx512.c')
-        trie_avx512_tmp = static_library('trie_avx512_tmp',
-                'trie_avx512.c',
-                dependencies: [static_rte_eal, static_rte_rcu, static_rte_net],
-                c_args: cflags + cc_avx512_flags)
-        objs += trie_avx512_tmp.extract_objects('trie_avx512.c')
-    endif
+    sources_avx512 = files('dir24_8_avx512.c', 'trie_avx512.c')
 endif
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index 4893f6c636..6c20057ac5 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -14,11 +14,11 @@
 #include <rte_fib6.h>
 #include "trie.h"
 
-#ifdef CC_TRIE_AVX512_SUPPORT
+#ifdef CC_AVX512_SUPPORT
 
 #include "trie_avx512.h"
 
-#endif /* CC_TRIE_AVX512_SUPPORT */
+#endif /* CC_AVX512_SUPPORT */
 
 #define TRIE_NAMESIZE		64
 
@@ -45,7 +45,7 @@ get_scalar_fn(enum rte_fib_trie_nh_sz nh_sz)
 static inline rte_fib6_lookup_fn_t
 get_vector_fn(enum rte_fib_trie_nh_sz nh_sz)
 {
-#ifdef CC_TRIE_AVX512_SUPPORT
+#ifdef CC_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 ||
-- 
2.43.0


  parent reply	other threads:[~2025-03-19 17:31 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14 17:23 [PATCH 0/3] remove driver-specific logic for AVX builds Bruce Richardson
2025-03-14 17:23 ` [PATCH 1/3] build: add generalized AVX handling for drivers Bruce Richardson
2025-03-14 17:23 ` [PATCH 2/3] net/intel: use common AVX build code Bruce Richardson
2025-03-14 17:23 ` [PATCH 3/3] drivers/net: build use common AVX handling Bruce Richardson
2025-03-14 17:31   ` David Marchand
2025-03-14 17:37     ` Bruce Richardson
2025-03-14 17:44 ` [PATCH v2 0/4] remove driver-specific logic for AVX builds Bruce Richardson
2025-03-14 17:44   ` [PATCH v2 1/4] build: add generalized AVX handling for drivers Bruce Richardson
2025-03-14 17:44   ` [PATCH v2 2/4] net/intel: use common AVX build code Bruce Richardson
2025-03-14 17:44   ` [PATCH v2 3/4] drivers/net: build use common AVX handling Bruce Richardson
2025-03-14 17:44   ` [PATCH v2 4/4] drivers/net: remove AVX2 build-time define Bruce Richardson
2025-03-17  9:47     ` David Marchand
2025-03-17  9:50   ` [PATCH v2 0/4] remove driver-specific logic for AVX builds David Marchand
2025-03-18 11:51     ` Bruce Richardson
2025-03-18 17:34 ` [PATCH v3 00/11] remove component-specific " Bruce Richardson
2025-03-18 17:34   ` [PATCH v3 01/11] build: add generalized AVX handling for drivers Bruce Richardson
2025-03-18 17:34   ` [PATCH v3 02/11] net/intel: use common AVX build code Bruce Richardson
2025-03-19 10:11     ` David Marchand
2025-03-19 11:17       ` Bruce Richardson
2025-03-18 17:34   ` [PATCH v3 03/11] drivers/net: build use common AVX handling Bruce Richardson
2025-03-18 17:34   ` [PATCH v3 04/11] drivers/net: remove AVX2 build-time define Bruce Richardson
2025-03-18 17:42     ` Ajit Khaparde
2025-03-18 17:34   ` [PATCH v3 05/11] event/dlb2: build using common AVX handling Bruce Richardson
2025-03-18 17:34   ` [PATCH v3 06/11] build: add generalized AVX handling for libs Bruce Richardson
2025-03-18 17:35   ` [PATCH v3 07/11] acl: use common AVX build handling Bruce Richardson
2025-03-19 10:16     ` David Marchand
2025-03-19 10:26       ` Bruce Richardson
2025-03-19 10:40         ` David Marchand
2025-03-19 10:59           ` Bruce Richardson
2025-03-18 17:35   ` [PATCH v3 08/11] fib: " Bruce Richardson
2025-03-18 17:35   ` [PATCH v3 09/11] net: simplify build-time logic for x86 Bruce Richardson
2025-03-19 10:24     ` David Marchand
2025-03-18 17:35   ` [PATCH v3 10/11] net: use common AVX512 build code Bruce Richardson
2025-03-18 17:35   ` [PATCH v3 11/11] member: use common AVX512 build support Bruce Richardson
2025-03-19 10:27   ` [PATCH v3 00/11] remove component-specific logic for AVX builds David Marchand
2025-03-19 17:29 ` [PATCH v4 " Bruce Richardson
2025-03-19 17:29   ` [PATCH v4 01/11] drivers: add generalized AVX build handling Bruce Richardson
2025-03-19 17:29   ` [PATCH v4 02/11] net/intel: use common AVX build code Bruce Richardson
2025-03-19 17:29   ` [PATCH v4 03/11] drivers/net: build use common AVX handling Bruce Richardson
2025-03-19 17:29   ` [PATCH v4 04/11] drivers/net: remove AVX2 build-time define Bruce Richardson
2025-03-19 17:29   ` [PATCH v4 05/11] event/dlb2: build using common AVX handling Bruce Richardson
2025-03-19 17:29   ` [PATCH v4 06/11] lib: add generalized AVX build handling Bruce Richardson
2025-03-19 17:29   ` [PATCH v4 07/11] acl: use common " Bruce Richardson
2025-03-19 17:29   ` Bruce Richardson [this message]
2025-03-19 17:29   ` [PATCH v4 09/11] net: simplify build-time logic for x86 Bruce Richardson
2025-03-19 17:29   ` [PATCH v4 10/11] net: use common AVX512 build code Bruce Richardson
2025-03-19 17:29   ` [PATCH v4 11/11] member: use common AVX512 build support Bruce Richardson
2025-03-19 18:08   ` [PATCH v4 00/11] remove component-specific logic for AVX builds Bruce Richardson

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=20250319172942.2992053-9-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=vladimir.medvedkin@intel.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).