Skip to content

Commit 469a556

Browse files
bruce-richardsondavid-marchand
authored andcommitted
drivers/net: use common AVX build handling
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 <[email protected]> Acked-by: Konstantin Ananyev <[email protected]>
1 parent c29e728 commit 469a556

File tree

5 files changed

+6
-47
lines changed

5 files changed

+6
-47
lines changed

drivers/net/bnxt/meson.build

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,7 @@ subdir('hcapi/cfa_v3')
5858

5959
if arch_subdir == 'x86'
6060
sources += files('bnxt_rxtx_vec_sse.c')
61-
# build AVX2 code with instruction set explicitly enabled for runtime selection
62-
bnxt_avx2_lib = static_library('bnxt_avx2_lib',
63-
'bnxt_rxtx_vec_avx2.c',
64-
dependencies: [static_rte_ethdev,
65-
static_rte_bus_pci,
66-
static_rte_kvargs, static_rte_hash],
67-
include_directories: includes,
68-
c_args: [cflags, cc_avx2_flags])
69-
objs += bnxt_avx2_lib.extract_objects('bnxt_rxtx_vec_avx2.c')
61+
sources_avx2 += files('bnxt_rxtx_vec_avx2.c')
7062
elif arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64')
7163
sources += files('bnxt_rxtx_vec_neon.c')
7264
endif

drivers/net/enic/meson.build

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,9 @@ sources = files(
2929
deps += ['hash']
3030
includes += include_directories('base')
3131

32-
# Build the avx2 handler for 64-bit X86 targets, even though 'machine'
33-
# may not. This is to support users who build for the min supported machine
34-
# and need to run the binary on newer CPUs too.
3532
if dpdk_conf.has('RTE_ARCH_X86_64')
3633
cflags += '-DENIC_RXTX_VEC'
37-
enic_avx2_lib = static_library('enic_avx2_lib',
38-
'enic_rxtx_vec_avx2.c',
39-
dependencies: [static_rte_ethdev, static_rte_bus_pci],
40-
include_directories: includes,
41-
c_args: [cflags, cc_avx2_flags])
42-
objs += enic_avx2_lib.extract_objects('enic_rxtx_vec_avx2.c')
34+
sources_avx2 += files('enic_rxtx_vec_avx2.c')
4335
endif
4436

4537
annotate_locks = false

drivers/net/nfp/meson.build

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,11 @@ cflags += no_wvla_cflag
5252
if arch_subdir == 'x86'
5353
includes += include_directories('../../common/nfp')
5454

55-
avx2_sources = files(
55+
sources_avx2 += files(
5656
'nfdk/nfp_nfdk_vec_avx2_dp.c',
5757
'nfp_rxtx_vec_avx2.c',
5858
)
5959

60-
nfp_avx2_lib = static_library('nfp_avx2_lib',
61-
avx2_sources,
62-
dependencies: [static_rte_ethdev, static_rte_bus_pci],
63-
include_directories: includes,
64-
c_args: [cflags, cc_avx2_flags]
65-
)
66-
67-
objs += nfp_avx2_lib.extract_all_objects(recursive: true)
6860
else
6961
sources += files(
7062
'nfp_rxtx_vec_stub.c',

drivers/net/octeon_ep/meson.build

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,8 @@ sources = files(
1515

1616
if arch_subdir == 'x86'
1717
sources += files('cnxk_ep_rx_sse.c')
18-
if cc.get_define('__AVX2__', args: machine_args) != ''
19-
cflags += ['-DCC_AVX2_SUPPORT']
20-
sources += files('cnxk_ep_rx_avx.c')
21-
elif cc.has_multi_arguments(cc_avx2_flags)
22-
cflags += ['-DCC_AVX2_SUPPORT']
23-
otx_ep_avx2_lib = static_library('otx_ep_avx2_lib',
24-
'cnxk_ep_rx_avx.c',
25-
dependencies: [static_rte_ethdev, static_rte_pci, static_rte_bus_pci],
26-
include_directories: includes,
27-
c_args: [cflags, cc_avx2_flags])
28-
objs += otx_ep_avx2_lib.extract_objects('cnxk_ep_rx_avx.c')
29-
endif
18+
cflags += ['-DCC_AVX2_SUPPORT']
19+
sources_avx2 += files('cnxk_ep_rx_avx.c')
3020
endif
3121

3222
if arch_subdir == 'arm'

drivers/net/virtio/meson.build

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,8 @@ cflags += no_wvla_cflag
2727

2828
if arch_subdir == 'x86'
2929
if cc_has_avx512
30-
cflags += ['-DCC_AVX512_SUPPORT']
3130
cflags += ['-DVIRTIO_RXTX_PACKED_VEC']
32-
virtio_avx512_lib = static_library('virtio_avx512_lib',
33-
'virtio_rxtx_packed.c',
34-
dependencies: [static_rte_ethdev,
35-
static_rte_kvargs, static_rte_bus_pci],
36-
include_directories: includes,
37-
c_args: cflags + cc_avx512_flags)
38-
objs += virtio_avx512_lib.extract_objects('virtio_rxtx_packed.c')
31+
sources_avx512 += files('virtio_rxtx_packed.c')
3932
if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
4033
cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
4134
elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))

0 commit comments

Comments
 (0)