net/i40e: fix mingw build error

Message ID 20210126153819.63625-1-leyi.rong@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/i40e: fix mingw build error |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing warning Testing issues

Commit Message

Leyi Rong Jan. 26, 2021, 3:38 p.m. UTC
  Disable i40e avx512 code path for windows build to
avoid the mingw build error.

Fixes: e6a6a138919f ("net/i40e: add AVX512 vector path")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 config/x86/cross-mingw       | 3 +++
 drivers/net/i40e/meson.build | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
  

Comments

Kadam, Pallavi Jan. 26, 2021, 4:18 p.m. UTC | #1
On 1/26/2021 7:38 AM, Leyi Rong wrote:
> Disable i40e avx512 code path for windows build to
> avoid the mingw build error.
>
> Fixes: e6a6a138919f ("net/i40e: add AVX512 vector path")
>
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> ---

Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>

Verified on Windows using MinGW and clang compiler.
  
Tal Shnaiderman Jan. 26, 2021, 5:04 p.m. UTC | #2
> Subject: [dpdk-dev] [PATCH] net/i40e: fix mingw build error
> 
> External email: Use caution opening links or attachments
> 
> 
> Disable i40e avx512 code path for windows build to avoid the mingw build
> error.
> 
> Fixes: e6a6a138919f ("net/i40e: add AVX512 vector path")
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> ---
>  config/x86/cross-mingw       | 3 +++
>  drivers/net/i40e/meson.build | 2 +-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw index
> 4c15a7fa2e..48a82b457e 100644
> --- a/config/x86/cross-mingw
> +++ b/config/x86/cross-mingw
> @@ -11,3 +11,6 @@ system = 'windows'
>  cpu_family = 'x86_64'
>  cpu = 'native'
>  endian = 'little'
> +
> +[properties]
> +c_args = '-mno-avx512f'

Should be in a different patch since it effects the whole project.

> diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
> index c0acdf4fd4..c9a1a50407 100644
> --- a/drivers/net/i40e/meson.build
> +++ b/drivers/net/i40e/meson.build
> @@ -54,7 +54,7 @@ if arch_subdir == 'x86'
>                 cc.has_argument('-mavx512f') and
>                 cc.has_argument('-mavx512bw'))
> 
> -       if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
> +       if not is_windows and (i40e_avx512_cpu_support == true or
> + i40e_avx512_cc_support == true)

DmitryK already mentioned it previously; you only need to disabled MinGW64 since clang isn't seeing those errors.

>                 cflags += ['-DCC_AVX512_SUPPORT']
>                 avx512_args = [cflags, '-mavx512f', '-mavx512bw']
>                 if cc.has_argument('-march=skylake-avx512')
> --
> 2.17.1
  
Leyi Rong Jan. 27, 2021, 8:30 a.m. UTC | #3
> -----Original Message-----
> From: Tal Shnaiderman <talshn@nvidia.com>
> Sent: Wednesday, January 27, 2021 1:04 AM
> To: Rong, Leyi <leyi.rong@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Kadam, Pallavi <pallavi.kadam@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Menon, Ranjit <ranjit.menon@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix mingw build error
> 
> > Subject: [dpdk-dev] [PATCH] net/i40e: fix mingw build error
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Disable i40e avx512 code path for windows build to avoid the mingw
> > build error.
> >
> > Fixes: e6a6a138919f ("net/i40e: add AVX512 vector path")
> >
> > Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> > ---
> >  config/x86/cross-mingw       | 3 +++
> >  drivers/net/i40e/meson.build | 2 +-
> >  2 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw index
> > 4c15a7fa2e..48a82b457e 100644
> > --- a/config/x86/cross-mingw
> > +++ b/config/x86/cross-mingw
> > @@ -11,3 +11,6 @@ system = 'windows'
> >  cpu_family = 'x86_64'
> >  cpu = 'native'
> >  endian = 'little'
> > +
> > +[properties]
> > +c_args = '-mno-avx512f'
> 
> Should be in a different patch since it effects the whole project.
> 

Sure, will be split in v2.

> > diff --git a/drivers/net/i40e/meson.build
> > b/drivers/net/i40e/meson.build index c0acdf4fd4..c9a1a50407 100644
> > --- a/drivers/net/i40e/meson.build
> > +++ b/drivers/net/i40e/meson.build
> > @@ -54,7 +54,7 @@ if arch_subdir == 'x86'
> >                 cc.has_argument('-mavx512f') and
> >                 cc.has_argument('-mavx512bw'))
> >
> > -       if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
> > +       if not is_windows and (i40e_avx512_cpu_support == true or
> > + i40e_avx512_cc_support == true)
> 
> DmitryK already mentioned it previously; you only need to disabled MinGW64
> since clang isn't seeing those errors.
> 

Yes, will support the case when clang is enable.
  

Patch

diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw
index 4c15a7fa2e..48a82b457e 100644
--- a/config/x86/cross-mingw
+++ b/config/x86/cross-mingw
@@ -11,3 +11,6 @@  system = 'windows'
 cpu_family = 'x86_64'
 cpu = 'native'
 endian = 'little'
+
+[properties]
+c_args = '-mno-avx512f'
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index c0acdf4fd4..c9a1a50407 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -54,7 +54,7 @@  if arch_subdir == 'x86'
 		cc.has_argument('-mavx512f') and
 		cc.has_argument('-mavx512bw'))
 
-	if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
+	if not is_windows and (i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true)
 		cflags += ['-DCC_AVX512_SUPPORT']
 		avx512_args = [cflags, '-mavx512f', '-mavx512bw']
 		if cc.has_argument('-march=skylake-avx512')