net/i40e: disable AVX512 with MinGW

Message ID 20210202090639.83164-1-leyi.rong@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/i40e: disable AVX512 with MinGW |

Checks

Context Check Description
ci/checkpatch warning coding style issues
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 Feb. 2, 2021, 9:06 a.m. UTC
  Disable i40e AVX512 code path for Windows build regardless of CPU
capability to avoid the MinGW build error:
	Error: invalid register for .seh_savexmm

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 drivers/net/i40e/meson.build | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Thomas Monjalon Feb. 2, 2021, 9:30 a.m. UTC | #1
02/02/2021 10:06, Leyi Rong:
> Disable i40e AVX512 code path for Windows build regardless of CPU
> capability to avoid the MinGW build error:
> 	Error: invalid register for .seh_savexmm
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>

Please provide a "Fixes:" line.
  
Bruce Richardson Feb. 2, 2021, 10:24 a.m. UTC | #2
On Tue, Feb 02, 2021 at 05:06:39PM +0800, Leyi Rong wrote:
> Disable i40e AVX512 code path for Windows build regardless of CPU
> capability to avoid the MinGW build error:
> 	Error: invalid register for .seh_savexmm
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> ---
>  drivers/net/i40e/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
> index f5fc5a17e..26cd201ee 100644
> --- a/drivers/net/i40e/meson.build
> +++ b/drivers/net/i40e/meson.build
> @@ -56,6 +56,7 @@ if arch_subdir == 'x86'
>  
>  	if is_windows and cc.get_id() != 'clang'
>  		i40e_avx512_cc_support = false
> +		i40e_avx512_cpu_support = false
>  	endif
>  

This fix seems to imply that there is something else wrong in the logic in
the build file. If the compiler does not support avx512, the fact that the
CPU supports it should be completely irrelevant. Therefore, I think a more
correct fix (logically) should be to remove the "i40e_avx512_cpu_support"
from the next "if" condition, and only check the compiler support. We
don't do anything with the cpu support variable.

/Bruce
  
Tal Shnaiderman Feb. 2, 2021, 2:13 p.m. UTC | #3
> Subject: Re: [PATCH] net/i40e: disable AVX512 with MinGW
> 
> External email: Use caution opening links or attachments
> 
> 
> On Tue, Feb 02, 2021 at 05:06:39PM +0800, Leyi Rong wrote:
> > Disable i40e AVX512 code path for Windows build regardless of CPU
> > capability to avoid the MinGW build error:
> >       Error: invalid register for .seh_savexmm
> >
> > Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> > ---
> >  drivers/net/i40e/meson.build | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/i40e/meson.build
> > b/drivers/net/i40e/meson.build index f5fc5a17e..26cd201ee 100644
> > --- a/drivers/net/i40e/meson.build
> > +++ b/drivers/net/i40e/meson.build
> > @@ -56,6 +56,7 @@ if arch_subdir == 'x86'
> >
> >       if is_windows and cc.get_id() != 'clang'
> >               i40e_avx512_cc_support = false
> > +             i40e_avx512_cpu_support = false
> >       endif
> >
> 
> This fix seems to imply that there is something else wrong in the logic in the
> build file. If the compiler does not support avx512, the fact that the CPU
> supports it should be completely irrelevant. Therefore, I think a more correct
> fix (logically) should be to remove the "i40e_avx512_cpu_support"
> from the next "if" condition, and only check the compiler support. We don't
> do anything with the cpu support variable.

Moreover, this patch doesn't resolve the issue [1].

 [1]  http://mails.dpdk.org/archives/test-report/2021-February/177665.html

> 
> /Bruce
  
Leyi Rong Feb. 2, 2021, 2:31 p.m. UTC | #4
> -----Original Message-----
> From: Tal Shnaiderman <talshn@nvidia.com>
> Sent: Tuesday, February 2, 2021 10:14 PM
> To: Richardson, Bruce <bruce.richardson@intel.com>; Rong, Leyi
> <leyi.rong@intel.com>
> Cc: david.marchand@redhat.com; Zhang, Qi Z <qi.z.zhang@intel.com>; Yigit,
> Ferruh <ferruh.yigit@intel.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Kadam, Pallavi <pallavi.kadam@intel.com>; Menon,
> Ranjit <ranjit.menon@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> aconole@redhat.com; dev@dpdk.org; ci@dpdk.org
> Subject: RE: [PATCH] net/i40e: disable AVX512 with MinGW
> 
> > Subject: Re: [PATCH] net/i40e: disable AVX512 with MinGW
> >
> > External email: Use caution opening links or attachments
> >
> >
> > On Tue, Feb 02, 2021 at 05:06:39PM +0800, Leyi Rong wrote:
> > > Disable i40e AVX512 code path for Windows build regardless of CPU
> > > capability to avoid the MinGW build error:
> > >       Error: invalid register for .seh_savexmm
> > >
> > > Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> > > ---
> > >  drivers/net/i40e/meson.build | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/net/i40e/meson.build
> > > b/drivers/net/i40e/meson.build index f5fc5a17e..26cd201ee 100644
> > > --- a/drivers/net/i40e/meson.build
> > > +++ b/drivers/net/i40e/meson.build
> > > @@ -56,6 +56,7 @@ if arch_subdir == 'x86'
> > >
> > >       if is_windows and cc.get_id() != 'clang'
> > >               i40e_avx512_cc_support = false
> > > +             i40e_avx512_cpu_support = false
> > >       endif
> > >
> >
> > This fix seems to imply that there is something else wrong in the
> > logic in the build file. If the compiler does not support avx512, the
> > fact that the CPU supports it should be completely irrelevant.
> > Therefore, I think a more correct fix (logically) should be to remove the
> "i40e_avx512_cpu_support"
> > from the next "if" condition, and only check the compiler support. We
> > don't do anything with the cpu support variable.
> 
> Moreover, this patch doesn't resolve the issue [1].
> 
>  [1]  http://mails.dpdk.org/archives/test-report/2021-February/177665.html
> 

[139/227] Compiling C object drivers/a715181@@tmp_rte_net_i40e@sta/net_i40e_i40e_rxtx_vec_avx2.c.obj.
FAILED: drivers/a715181@@tmp_rte_net_i40e@sta/net_i40e_i40e_rxtx_vec_avx2.c.obj 
gcc @drivers/a715181@@tmp_rte_net_i40e@sta/net_i40e_i40e_rxtx_vec_avx2.c.obj.rsp
{standard input}: Assembler messages:
{standard input}:2024: Error: invalid register for .seh_savexmm
{standard input}:2026: Error: invalid register for .seh_savexmm
{standard input}:2028: Error: invalid register for .seh_savexmm

Seems that avx2 file also causes the same issue, will send a new patch to have the test.

> >
> > /Bruce
  

Patch

diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index f5fc5a17e..26cd201ee 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -56,6 +56,7 @@  if arch_subdir == 'x86'
 
 	if is_windows and cc.get_id() != 'clang'
 		i40e_avx512_cc_support = false
+		i40e_avx512_cpu_support = false
 	endif
 
 	if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true