fix build error on lower version GCC
Subsystems (2)
cover fix build error on lower version GCC
These two patches fix the build error when -march=skylake-avx512 is not supported on lower version GCC in both ice and iavf PMD.
Leyi Rong (2):
net/ice: fix build error on lower version GCC
net/iavf: fix build error on lower version GCC
drivers/net/iavf/meson.build | 21 +++++++++++++++------ drivers/net/ice/meson.build | 21 +++++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 net/ice: fix build error on lower version GCC
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
--- drivers/net/ice/meson.build | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/net/ice/meson.build +15 -6
@@ -46,12 +46,21 @@ if arch_subdir == 'x86' if ice_avx512_cpu_support == true or ice_avx512_cc_support == true cflags += ['-DCC_AVX512_SUPPORT'] - ice_avx512_lib = static_library('ice_avx512_lib', - 'ice_rxtx_vec_avx512.c', - dependencies: [static_rte_ethdev, - static_rte_kvargs, static_rte_hash], - include_directories: includes, - c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw']) + if cc.has_argument('-march=skylake-avx512') + ice_avx512_lib = static_library('ice_avx512_lib', + 'ice_rxtx_vec_avx512.c', + dependencies: [static_rte_ethdev, + static_rte_kvargs, static_rte_hash], + include_directories: includes, + c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw']) + else + ice_avx512_lib = static_library('ice_avx512_lib', + 'ice_rxtx_vec_avx512.c', + dependencies: [static_rte_ethdev, + static_rte_kvargs, static_rte_hash], + include_directories: includes, + c_args: [cflags, '-mavx512f', '-mavx512bw']) + endif objs += ice_avx512_lib.extract_objects('ice_rxtx_vec_avx512.c') endif endif
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 1/2] net/ice: fix build error on lower version GCC
Quoted 29 lines · Leyi Rong
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
Fixes ef5d52dae5e2 ("net/ice: add AVX512 vector path")Signed-off-by Leyi Rong <[email protected]>--- drivers/net/ice/meson.build | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)drivers/net/ice/meson.build +5
-6@@ -46,12 +46,21 @@ if arch_subdir == 'x86' if ice_avx512_cpu_support == true or ice_avx512_cc_support == true cflags += ['-DCC_AVX512_SUPPORT'] - ice_avx512_lib = static_library('ice_avx512_lib', - 'ice_rxtx_vec_avx512.c', - dependencies: [static_rte_ethdev, - static_rte_kvargs, static_rte_hash], - include_directories: includes, - c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw']) + if cc.has_argument('-march=skylake-avx512') + ice_avx512_lib = static_library('ice_avx512_lib', + 'ice_rxtx_vec_avx512.c', + dependencies: [static_rte_ethdev, + static_rte_kvargs, static_rte_hash],
drivers/net/ice/meson.build if arch_subdir == 'x86' · line 63
Quoted 10 lines
drivers/net/ice/meson.build +10
-0+ include_directories: includes, + c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw']) + else + ice_avx512_lib = static_library('ice_avx512_lib', + 'ice_rxtx_vec_avx512.c', + dependencies: [static_rte_ethdev, + static_rte_kvargs, static_rte_hash], + include_directories: includes, + c_args: [cflags, '-mavx512f', '-mavx512bw']) + endif
Rather than duplicating the whole static_library call, you can just do:
avx512_cflags = [cflags, '-mavx512f', '-mavx512bw']
if cc.has_argument('-march=skylake-avx512')
avx512_cflags += '-march=skylake-avx512'
endifand then use avx512_cflags inside a single static_library call. Much shorter code.
/Bruce
Quoted 6 lines
drivers/net/ice/meson.build +0
-0objs += ice_avx512_lib.extract_objects('ice_rxtx_vec_avx512.c') endif endifSignature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 1/2] net/ice: fix build error on lower version GCC
Quoted 56 lines
-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, November 3, 2020 9:28 PM
To: Rong, Leyi <[email protected]>
Cc: Zhang, Qi Z <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] net/ice: fix build error on lower version GCCQuoted 15 lines · Leyi Rong
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
Fixes ef5d52dae5e2 ("net/ice: add AVX512 vector path")Signed-off-by Leyi Rong <[email protected]>--- drivers/net/ice/meson.build | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)drivers/net/ice/meson.build +0
-0drivers/net/ice/meson.build if arch_subdir == 'x86' · line 54
Quoted 9 lines
drivers/net/ice/meson.build +0
-6@@ -46,12 +46,21 @@ if arch_subdir == 'x86' if ice_avx512_cpu_support == true or ice_avx512_cc_support == true cflags += ['-DCC_AVX512_SUPPORT'] - ice_avx512_lib = static_library('ice_avx512_lib', - 'ice_rxtx_vec_avx512.c', - dependencies: [static_rte_ethdev, - static_rte_kvargs, static_rte_hash], - include_directories: includes, - c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw'])
drivers/net/ice/meson.build if arch_subdir == 'x86'
Quoted 5 lines
drivers/net/ice/meson.build +5
-0+ if cc.has_argument('-march=skylake-avx512') + ice_avx512_lib = static_library('ice_avx512_lib', + 'ice_rxtx_vec_avx512.c', + dependencies: [static_rte_ethdev, + static_rte_kvargs,
static_rte_hash],drivers/net/ice/meson.build if arch_subdir == 'x86' · line 55
Quoted 2 lines
drivers/net/ice/meson.build +2
-0+ include_directories: includes, + c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw'])
drivers/net/ice/meson.build if arch_subdir == 'x86'
Quoted 5 lines
drivers/net/ice/meson.build +5
-0+ else + ice_avx512_lib = static_library('ice_avx512_lib', + 'ice_rxtx_vec_avx512.c', + dependencies: [static_rte_ethdev, + static_rte_kvargs,
static_rte_hash],drivers/net/ice/meson.build if arch_subdir == 'x86' · line 62
Quoted 2 lines
drivers/net/ice/meson.build +2
-0+ include_directories: includes, + c_args: [cflags, '-mavx512f', '-mavx512bw'])
drivers/net/ice/meson.build if arch_subdir == 'x86' · line 63
Quoted 1 line
drivers/net/ice/meson.build +1
-0+ endifRather than duplicating the whole
static_librarycall, you can just do:
Quoted 9 lines
avx512_cflags = [cflags, '-mavx512f', '-mavx512bw'] if cc.has_argument('-march=skylake-avx512') avx512_cflags += '-march=skylake-avx512' endifand then use
avx512_cflagsinside a singlestatic_librarycall. Much shorter code./Bruce
Many thanks~
Fixed in v2 patches.
Leyi
Quoted 6 lines
Quoted 6 lines
drivers/net/ice/meson.build +0
-1objs += ice_avx512_lib.extract_objects('ice_rxtx_vec_avx512.c') endif endif --2.17.1
PATCH 2/2 net/iavf: fix build error on lower version GCC
In reply to Leyi RongFix the build error when -march=skylake-avx512 is not supported on lower version GCC.
--- drivers/net/iavf/meson.build | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/net/iavf/meson.build +15 -6
@@ -46,12 +46,21 @@ if arch_subdir == 'x86' if iavf_avx512_cpu_support == true or iavf_avx512_cc_support == true cflags += ['-DCC_AVX512_SUPPORT'] - iavf_avx512_lib = static_library('iavf_avx512_lib', - 'iavf_rxtx_vec_avx512.c', - dependencies: [static_rte_ethdev, - static_rte_kvargs, static_rte_hash], - include_directories: includes, - c_args: [cflags, '-mavx512f', '-mavx512bw', '-march=skylake-avx512']) + if cc.has_argument('-march=skylake-avx512') + iavf_avx512_lib = static_library('iavf_avx512_lib', + 'iavf_rxtx_vec_avx512.c', + dependencies: [static_rte_ethdev, + static_rte_kvargs, static_rte_hash], + include_directories: includes, + c_args: [cflags, '-mavx512f', '-mavx512bw', '-march=skylake-avx512']) + else + iavf_avx512_lib = static_library('iavf_avx512_lib', + 'iavf_rxtx_vec_avx512.c', + dependencies: [static_rte_ethdev, + static_rte_kvargs, static_rte_hash], + include_directories: includes, + c_args: [cflags, '-mavx512f', '-mavx512bw']) + endif objs += iavf_avx512_lib.extract_objects('iavf_rxtx_vec_avx512.c') endif endif
Signature · 1 line
2.17.1
v2 cover fix build error on lower version GCC
In reply to Leyi RongThese two patches fix the build error when -march=skylake-avx512 is not supported on lower version GCC in both ice and iavf PMD.
---
v2:
- Simplify the judgement by extracting the avx512_args.
Leyi Rong (2):
net/ice: fix build error on lower version GCC
net/iavf: fix build error on lower version GCC
drivers/net/iavf/meson.build | 8 ++++++-- drivers/net/ice/meson.build | 14 +++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/2 net/ice: fix build error on lower version GCC
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
--- drivers/net/ice/meson.build | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/ice/meson.build +9 -5
@@ -46,12 +46,16 @@ if arch_subdir == 'x86' if ice_avx512_cpu_support == true or ice_avx512_cc_support == true cflags += ['-DCC_AVX512_SUPPORT'] + avx512_args = [cflags, '-mavx512f', '-mavx512bw'] + if cc.has_argument('-march=skylake-avx512') + avx512_args += '-march=skylake-avx512' + endif ice_avx512_lib = static_library('ice_avx512_lib', - 'ice_rxtx_vec_avx512.c', - dependencies: [static_rte_ethdev, - static_rte_kvargs, static_rte_hash], - include_directories: includes, - c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw']) + 'ice_rxtx_vec_avx512.c', + dependencies: [static_rte_ethdev, + static_rte_kvargs, static_rte_hash], + include_directories: includes, + c_args: avx512_args) objs += ice_avx512_lib.extract_objects('ice_rxtx_vec_avx512.c') endif endif
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2 1/2] net/ice: fix build error on lower version GCC
Quoted 6 lines · Leyi Rong
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
Fixes ef5d52dae5e2 ("net/ice: add AVX512 vector path")Signed-off-by Leyi Rong <[email protected]>
Re: [dpdk-dev] [PATCH v2 1/2] net/ice: fix build error on lower version GCC
Quoted 10 lines · Bruce Richardson
Quoted 6 lines · Leyi Rong
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
Fixes ef5d52dae5e2 ("net/ice: add AVX512 vector path")Signed-off-by Leyi Rong <[email protected]>Acked-by Bruce Richardson <[email protected]>
Squashed into relevant commit in next-net, thanks.
Indentation added to match 'ice' while merging.
Re: [dpdk-dev] [PATCH v2 1/2] net/ice: fix build error on lower version GCC
Quoted 7 lines · Ferruh Yigit
Quoted 6 lines · Bruce Richardson
Quoted 5 lines · Leyi Rong
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
Fixes ef5d52dae5e2 ("net/ice: add AVX512 vector path")
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Leyi Rong <[email protected]>Acked-by Bruce Richardson <[email protected]>Squashed into relevant commit in next-net, thanks.
Indentation added to match 'ice' while merging.
Hi Ali,
Can you please test the build of next-net/main one more time?
Thanks,
ferruh
Re: [dpdk-dev] [PATCH v2 1/2] net/ice: fix build error on lower version GCC
Quoted 22 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, November 3, 2020 5:37 PM
To: Bruce Richardson <[email protected]>; Leyi Rong <[email protected]>; Ali Alnubani <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 1/2] net/ice: fix build error on lower version GCCQuoted 12 lines · Ferruh Yigit
Quoted 10 lines · Bruce Richardson
Quoted 6 lines · Leyi Rong
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
Fixes ef5d52dae5e2 ("net/ice: add AVX512 vector path")Signed-off-by Leyi Rong <[email protected]>Acked-by Bruce Richardson <[email protected]>
Quoted 9 lines
Quoted 4 lines
Squashed into relevant commit in next-net, thanks.
Indentation added to match 'ice' while merging.
Hi Ali,
Can you please test the build of next-net/main one more time?
Build is passing on "5b5f87681 app/testpmd: fix max Rx packet length for VLAN packets".
Thanks,
Ali
Re: [dpdk-dev] [PATCH v2 1/2] net/ice: fix build error on lower version GCC
Quoted 27 lines · Ali Alnubani
Quoted 27 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, November 3, 2020 5:37 PM
To: Bruce Richardson <[email protected]>; Leyi Rong <[email protected]>; Ali Alnubani <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 1/2] net/ice: fix build error on lower version GCCQuoted 16 lines · Ferruh Yigit
Quoted 10 lines · Bruce Richardson
Quoted 6 lines · Leyi Rong
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
Fixes ef5d52dae5e2 ("net/ice: add AVX512 vector path")Signed-off-by Leyi Rong <[email protected]>Acked-by Bruce Richardson <[email protected]>Squashed into relevant commit in next-net, thanks.
Indentation added to match 'ice' while merging.
Quoted 7 lines
Quoted 4 lines
Hi Ali,
Can you please test the build of next-net/main one more time?
Build is passing on "
5b5f87681app/testpmd: fix max Rx packet length for VLAN packets".
Thanks.
PATCH v2 2/2 net/iavf: fix build error on lower version GCC
In reply to Leyi RongFix the build error when -march=skylake-avx512 is not supported on lower version GCC.
--- drivers/net/iavf/meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/iavf/meson.build +6 -2
@@ -46,12 +46,16 @@ if arch_subdir == 'x86' if iavf_avx512_cpu_support == true or iavf_avx512_cc_support == true cflags += ['-DCC_AVX512_SUPPORT'] + avx512_args = [cflags, '-mavx512f', '-mavx512bw'] + if cc.has_argument('-march=skylake-avx512') + avx512_args += '-march=skylake-avx512' + endif iavf_avx512_lib = static_library('iavf_avx512_lib', 'iavf_rxtx_vec_avx512.c', dependencies: [static_rte_ethdev, - static_rte_kvargs, static_rte_hash], + static_rte_kvargs, static_rte_hash], include_directories: includes, - c_args: [cflags, '-mavx512f', '-mavx512bw', '-march=skylake-avx512']) + c_args: avx512_args) objs += iavf_avx512_lib.extract_objects('iavf_rxtx_vec_avx512.c') endif endif
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2 2/2] net/iavf: fix build error on lower version GCC
Quoted 17 lines · Leyi Rong
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
Fixes e0dcec9074c3 ("net/iavf: enable AVX512 for legacy Rx")Signed-off-by Leyi Rong <[email protected]>--- drivers/net/iavf/meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/net/iavf/meson.build +0
-0@@ -46,12 +46,16 @@ if arch_subdir == 'x86' if iavf_avx512_cpu_support == true or iavf_avx512_cc_support == true
drivers/net/iavf/meson.build if arch_subdir == 'x86' · line 56
Quoted 10 lines
drivers/net/iavf/meson.build +5
-1cflags += ['-DCC_AVX512_SUPPORT'] + avx512_args = [cflags, '-mavx512f', '-mavx512bw'] + if cc.has_argument('-march=skylake-avx512') + avx512_args += '-march=skylake-avx512' + endif iavf_avx512_lib = static_library('iavf_avx512_lib', 'iavf_rxtx_vec_avx512.c', dependencies: [static_rte_ethdev, - static_rte_kvargs, static_rte_hash], + static_rte_kvargs, static_rte_hash],
This is an unnecesary whitespace change that can be dropped from the patch, and doesn't actually clean things up, since the extra indent is useful to show the continuation of the array.
drivers/net/iavf/meson.build if arch_subdir == 'x86' · line 61
Quoted 7 lines
drivers/net/iavf/meson.build +1
-1include_directories: includes, - c_args: [cflags, '-mavx512f', '-mavx512bw', '-march=skylake-avx512']) + c_args: avx512_args) objs += iavf_avx512_lib.extract_objects('iavf_rxtx_vec_avx512.c') endif endif
Re: [dpdk-dev] [PATCH v2 2/2] net/iavf: fix build error on lower version GCC
Quoted 33 lines · Bruce Richardson
Quoted 17 lines · Leyi Rong
Fix the build error when -march=skylake-avx512 is not supported on lower version GCC.
Fixes e0dcec9074c3 ("net/iavf: enable AVX512 for legacy Rx")Signed-off-by Leyi Rong <[email protected]>--- drivers/net/iavf/meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/net/iavf/meson.build +0
-0@@ -46,12 +46,16 @@ if arch_subdir == 'x86' if iavf_avx512_cpu_support == true or iavf_avx512_cc_support == truedrivers/net/iavf/meson.build if arch_subdir == 'x86' · line 56
Quoted 10 lines
drivers/net/iavf/meson.build +5
-1cflags += ['-DCC_AVX512_SUPPORT'] + avx512_args = [cflags, '-mavx512f', '-mavx512bw'] + if cc.has_argument('-march=skylake-avx512') + avx512_args += '-march=skylake-avx512' + endif iavf_avx512_lib = static_library('iavf_avx512_lib', 'iavf_rxtx_vec_avx512.c', dependencies: [static_rte_ethdev, - static_rte_kvargs, static_rte_hash], + static_rte_kvargs, static_rte_hash],This is an unnecesary whitespace change that can be dropped from the patch, and doesn't actually clean things up, since the extra indent is useful to show the continuation of the array.
Quoted 10 lines
drivers/net/iavf/meson.build if arch_subdir == 'x86' · line 61
Quoted 7 lines
drivers/net/iavf/meson.build +1
-1include_directories: includes, - c_args: [cflags, '-mavx512f', '-mavx512bw', '-march=skylake-avx512']) + c_args: avx512_args) objs += iavf_avx512_lib.extract_objects('iavf_rxtx_vec_avx512.c') endif endifAcked-by Bruce Richardson <[email protected]>
Squashed into relevant commit in next-net, thanks.
Indentation change dropped while merging.