Remove from remaining net drivers the special-case code to handle AVX2
or AVX512 specific files. These can be built instead using
drivers/meson.build.

Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>
---
 drivers/net/bnxt/meson.build      | 10 +---------
 drivers/net/enic/meson.build      | 10 +---------
 drivers/net/nfp/meson.build       | 10 +---------
 drivers/net/octeon_ep/meson.build | 14 ++------------
 drivers/net/virtio/meson.build    |  9 +--------
 5 files changed, 6 insertions(+), 47 deletions(-)

diff --git a/drivers/net/bnxt/meson.build b/drivers/net/bnxt/meson.build
index fd82d0c409..dcca7df916 100644
--- a/drivers/net/bnxt/meson.build
+++ b/drivers/net/bnxt/meson.build
@@ -58,15 +58,7 @@ subdir('hcapi/cfa_v3')
 
 if arch_subdir == 'x86'
     sources += files('bnxt_rxtx_vec_sse.c')
-    # build AVX2 code with instruction set explicitly enabled for runtime 
selection
-    bnxt_avx2_lib = static_library('bnxt_avx2_lib',
-            'bnxt_rxtx_vec_avx2.c',
-            dependencies: [static_rte_ethdev,
-                static_rte_bus_pci,
-                static_rte_kvargs, static_rte_hash],
-            include_directories: includes,
-            c_args: [cflags, cc_avx2_flags])
-     objs += bnxt_avx2_lib.extract_objects('bnxt_rxtx_vec_avx2.c')
+    sources_avx2 = files('bnxt_rxtx_vec_avx2.c')
 elif arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64')
     sources += files('bnxt_rxtx_vec_neon.c')
 endif
diff --git a/drivers/net/enic/meson.build b/drivers/net/enic/meson.build
index cfe5ec170a..2b3052fae8 100644
--- a/drivers/net/enic/meson.build
+++ b/drivers/net/enic/meson.build
@@ -29,17 +29,9 @@ sources = files(
 deps += ['hash']
 includes += include_directories('base')
 
-# Build the avx2 handler for 64-bit X86 targets, even though 'machine'
-# may not. This is to support users who build for the min supported machine
-# and need to run the binary on newer CPUs too.
 if dpdk_conf.has('RTE_ARCH_X86_64')
     cflags += '-DENIC_RXTX_VEC'
-    enic_avx2_lib = static_library('enic_avx2_lib',
-            'enic_rxtx_vec_avx2.c',
-            dependencies: [static_rte_ethdev, static_rte_bus_pci],
-            include_directories: includes,
-            c_args: [cflags, cc_avx2_flags])
-    objs += enic_avx2_lib.extract_objects('enic_rxtx_vec_avx2.c')
+    sources_avx2 = files('enic_rxtx_vec_avx2.c')
 endif
 
 annotate_locks = false
diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build
index 0a12b7dce7..a98b584042 100644
--- a/drivers/net/nfp/meson.build
+++ b/drivers/net/nfp/meson.build
@@ -52,19 +52,11 @@ cflags += no_wvla_cflag
 if arch_subdir == 'x86'
         includes += include_directories('../../common/nfp')
 
-        avx2_sources = files(
+        sources_avx2 = files(
                 'nfdk/nfp_nfdk_vec_avx2_dp.c',
                 'nfp_rxtx_vec_avx2.c',
         )
 
-        nfp_avx2_lib = static_library('nfp_avx2_lib',
-                avx2_sources,
-                dependencies: [static_rte_ethdev, static_rte_bus_pci],
-                include_directories: includes,
-                c_args: [cflags, cc_avx2_flags]
-        )
-
-        objs += nfp_avx2_lib.extract_all_objects(recursive: true)
 else
         sources += files(
                 'nfp_rxtx_vec_stub.c',
diff --git a/drivers/net/octeon_ep/meson.build 
b/drivers/net/octeon_ep/meson.build
index 1b34db3edc..9bf4627894 100644
--- a/drivers/net/octeon_ep/meson.build
+++ b/drivers/net/octeon_ep/meson.build
@@ -15,18 +15,8 @@ sources = files(
 
 if arch_subdir == 'x86'
     sources += files('cnxk_ep_rx_sse.c')
-    if cc.get_define('__AVX2__', args: machine_args) != ''
-        cflags += ['-DCC_AVX2_SUPPORT']
-        sources += files('cnxk_ep_rx_avx.c')
-    elif cc.has_multi_arguments(cc_avx2_flags)
-        cflags += ['-DCC_AVX2_SUPPORT']
-        otx_ep_avx2_lib = static_library('otx_ep_avx2_lib',
-                        'cnxk_ep_rx_avx.c',
-                        dependencies: [static_rte_ethdev, static_rte_pci, 
static_rte_bus_pci],
-                        include_directories: includes,
-                        c_args: [cflags, cc_avx2_flags])
-        objs += otx_ep_avx2_lib.extract_objects('cnxk_ep_rx_avx.c')
-    endif
+    cflags += ['-DCC_AVX2_SUPPORT']
+    sources_avx2 = files('cnxk_ep_rx_avx.c')
 endif
 
 if arch_subdir == 'arm'
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index c1c4a85bea..01bfb3c47d 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -27,15 +27,8 @@ cflags += no_wvla_cflag
 
 if arch_subdir == 'x86'
     if cc_has_avx512
-        cflags += ['-DCC_AVX512_SUPPORT']
         cflags += ['-DVIRTIO_RXTX_PACKED_VEC']
-        virtio_avx512_lib = static_library('virtio_avx512_lib',
-                'virtio_rxtx_packed.c',
-                dependencies: [static_rte_ethdev,
-                    static_rte_kvargs, static_rte_bus_pci],
-                include_directories: includes,
-                c_args: cflags + cc_avx512_flags)
-        objs += virtio_avx512_lib.extract_objects('virtio_rxtx_packed.c')
+        sources_avx512 = files('virtio_rxtx_packed.c')
         if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
             cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
         elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
-- 
2.43.0

Reply via email to