Skip to contentSkip to conversation

net/i40e: disable AVX512 with MinGW

PATCH In review Leyi Rong 9 participants 12 messages Feb 2, 2021 – Feb 4, 2021

Subsystems (2)
lore
Share & tools
lore

Leyi Rong

author
#0 lore raw

PATCH 1/1 net/i40e: disable AVX512 with MinGW

Disable i40e AVX512 code path for Windows build regardless of CPU capability to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

---
 drivers/net/i40e/meson.build | 1 +
 1 file changed, 1 insertion(+)
drivers/net/i40e/meson.build +1 -0
index f5fc5a17e..26cd201ee 100644
@@ -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
Signature · 1 line
2.17.1
#1 lore raw

02/02/2021 10:06, Leyi Rong:

Quoted 5 lines

Disable i40e AVX512 code path for Windows build regardless of CPU capability to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Please provide a "Fixes:" line.

#2 lore raw
In reply to Leyi Rong
Quoted 14 lines · 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

---
 drivers/net/i40e/meson.build | 1 +
 1 file changed, 1 insertion(+)
drivers/net/i40e/meson.build +0 -0
index f5fc5a17e..26cd201ee 100644

drivers/net/i40e/meson.build if arch_subdir == 'x86' · line 61

Quoted 6 lines
drivers/net/i40e/meson.build +1 -0
@@ -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

#3 lore raw
Quoted 21 lines

Subject: Re: [PATCH] net/i40e: disable AVX512 with MinGW

External email: Use caution opening links or attachments

Quoted 15 lines · 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

---
 drivers/net/i40e/meson.build | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/drivers/net/i40e/meson.build index f5fc5a17e..26cd201ee 100644

drivers/net/i40e/meson.build +0 -0
@@ -56,6 +56,7 @@ if arch_subdir == 'x86'
 
Quoted 12 lines

drivers/net/i40e/meson.build if arch_subdir == 'x86' · line 61

Quoted 5 lines
drivers/net/i40e/meson.build +1 -0
      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

Quoted 2 lines

/Bruce

author
#4 lore raw
Quoted 44 lines

-----Original Message-----
From: Tal Shnaiderman <[email protected]>
Sent: Tuesday, February 2, 2021 10:14 PM
To: Richardson, Bruce <[email protected]>; Rong, Leyi <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>; Yigit, Ferruh <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>; Kadam, Pallavi <[email protected]>; Menon, Ranjit <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: RE: [PATCH] net/i40e: disable AVX512 with MinGW

Quoted 21 lines

Subject: Re: [PATCH] net/i40e: disable AVX512 with MinGW

External email: Use caution opening links or attachments

Quoted 15 lines · 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

---
 drivers/net/i40e/meson.build | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/drivers/net/i40e/meson.build index f5fc5a17e..26cd201ee 100644

drivers/net/i40e/meson.build +0 -0
@@ -56,6 +56,7 @@ if arch_subdir == 'x86'
 
Quoted 10 lines

drivers/net/i40e/meson.build if arch_subdir == 'x86' · line 61

Quoted 5 lines
drivers/net/i40e/meson.build +1 -0
      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

Quoted 8 lines

"i40e_avx512_cpu_support"

Quoted 2 lines

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.

Quoted 2 lines
Quoted 2 lines

/Bruce

author
#5 lore raw

PATCH v2 1/1 net/i40e: fix avx code error on MinGW

In reply to Leyi Rong

Adds extra cflags '-fno-asynchronous-unwind-tables' to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Fixes 5c38c33f7880 ("net/i40e: disable AVX512 with MinGW")
---
 drivers/net/i40e/meson.build | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/i40e/meson.build +4 -4
index f5fc5a17e0..ce3cc658e9 100644
@@ -28,6 +28,10 @@ includes += include_directories('base')
 if arch_subdir == 'x86'
 	sources += files('i40e_rxtx_vec_sse.c')
 
+	if is_windows and cc.get_id() != 'clang'
+		cflags += ['-fno-asynchronous-unwind-tables']
+	endif
+
 	# compile AVX2 version if either:
 	# a. we have AVX supported in minimum instruction set baseline
 	# b. it's not minimum instruction set, but supported by compiler
@@ -54,10 +58,6 @@ if arch_subdir == 'x86'
 		cc.has_argument('-mavx512f') and
 		cc.has_argument('-mavx512bw'))
 
-	if is_windows and cc.get_id() != 'clang'
-		i40e_avx512_cc_support = false
-	endif
-
 	if i40e_avx512_cpu_support == true or i40e_avx512_cc_support == true
 		cflags += ['-DCC_AVX512_SUPPORT']
 		avx512_args = [cflags, '-mavx512f', '-mavx512bw']
Signature · 1 line
2.17.1
Tested-by on v2 1/1
#6 lore raw

Re: [dpdk-dev] [PATCH v2] net/i40e: fix avx code error on MinGW

Quoted 7 lines · Leyi Rong

Adds extra cflags '-fno-asynchronous-unwind-tables' to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Fixes 5c38c33f7880 ("net/i40e: disable AVX512 with MinGW")

Re: -fno-asynchronous-unwind-tables, when cross-compiling from Linux, I observe bit-to-bit identical i40e_rxtx_vec_avx512.c.obj. My guess it that this option somehow affects GCC inlining heuristics. Similar issue existed in librte_acl (at least a year ago win GCC 6, I believe), where GCC generated incorrect code unless certain functions had been inlined (caught by test app). No an AVX expert, just my 2c.

Applied
#7 lore raw

Re: [dpdk-dev] [PATCH v2] net/i40e: fix avx code error on MinGW

Quoted 23 lines

-----Original Message-----
From: Dmitry Kozlyuk <[email protected]>
Sent: Wednesday, February 3, 2021 7:08 AM
To: Rong, Leyi <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; Kadam, Pallavi <[email protected]>; Menon, Ranjit <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix avx code error on MinGW

Quoted 7 lines · Leyi Rong

Adds extra cflags '-fno-asynchronous-unwind-tables' to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Fixes 5c38c33f7880 ("net/i40e: disable AVX512 with MinGW")
Quoted 8 lines

Re: -fno-asynchronous-unwind-tables, when cross-compiling from Linux, I observe bit-to-bit identical i40e_rxtx_vec_avx512.c.obj. My guess it that this option somehow affects GCC inlining heuristics. Similar issue existed in librte_acl (at least a year ago win GCC 6, I believe), where GCC generated incorrect code unless certain functions had been inlined (caught by test app). No an AVX expert, just my 2c.

Applied to dpdk-next-net-intel.

Thanks
Qi

#8 lore raw

Re: [dpdk-dev] [PATCH v2] net/i40e: fix avx code error on MinGW

Quoted 25 lines · Qi Z
Quoted 25 lines

-----Original Message-----
From: Dmitry Kozlyuk <[email protected]>
Sent: Wednesday, February 3, 2021 7:08 AM
To: Rong, Leyi <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; Kadam, Pallavi <[email protected]>; Menon, Ranjit <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix avx code error on MinGW

Quoted 7 lines · Leyi Rong

Adds extra cflags '-fno-asynchronous-unwind-tables' to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Fixes 5c38c33f7880 ("net/i40e: disable AVX512 with MinGW")
Quoted 9 lines
Quoted 6 lines

Re: -fno-asynchronous-unwind-tables, when cross-compiling from Linux, I observe bit-to-bit identical i40e_rxtx_vec_avx512.c.obj. My guess it that this option somehow affects GCC inlining heuristics. Similar issue existed in librte_acl (at least a year ago win GCC 6, I believe), where GCC generated incorrect code unless certain functions had been inlined (caught by test app). No an AVX expert, just my 2c.

Applied to dpdk-next-net-intel.

Hi Thomas, David,

Do you prefer to get this directly to the main repo, since it is fixing the windows build?

#9 lore raw

Re: [dpdk-dev] [PATCH v2] net/i40e: fix avx code error on MinGW

04/02/2021 13:36, Ferruh Yigit:

Quoted 20 lines · Qi Z
Quoted 19 lines

From: Dmitry Kozlyuk <[email protected]>

Quoted 17 lines · Leyi Rong
Quoted 7 lines

Adds extra cflags '-fno-asynchronous-unwind-tables' to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Fixes 5c38c33f7880 ("net/i40e: disable AVX512 with MinGW")

Re: -fno-asynchronous-unwind-tables, when cross-compiling from Linux, I observe bit-to-bit identical i40e_rxtx_vec_avx512.c.obj. My guess it that this option somehow affects GCC inlining heuristics. Similar issue existed in librte_acl (at least a year ago win GCC 6, I believe), where GCC generated incorrect code unless certain functions had been inlined (caught by test app). No an AVX expert, just my 2c.

Quoted 7 lines
Quoted 2 lines

Applied to dpdk-next-net-intel.

Hi Thomas, David,

Do you prefer to get this directly to the main repo, since it is fixing the windows build?

Given it will be pulled shortly, I think it's OK through next-net.

#10 lore raw

Re: [dpdk-dev] [PATCH v2] net/i40e: fix avx code error on MinGW

In reply to Ferruh Yigit
Quoted 34 lines · Ferruh Yigit
Quoted 32 lines · Qi Z
Quoted 31 lines

-----Original Message-----
From: Dmitry Kozlyuk <[email protected]>
Sent: Wednesday, February 3, 2021 7:08 AM
To: Rong, Leyi <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; Kadam, Pallavi <[email protected]>; Menon, Ranjit <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix avx code error on MinGW

Quoted 7 lines · Leyi Rong

Adds extra cflags '-fno-asynchronous-unwind-tables' to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Fixes 5c38c33f7880 ("net/i40e: disable AVX512 with MinGW")

Re: -fno-asynchronous-unwind-tables, when cross-compiling from Linux, I observe bit-to-bit identical i40e_rxtx_vec_avx512.c.obj. My guess it that this option somehow affects GCC inlining heuristics. Similar issue existed in librte_acl (at least a year ago win GCC 6, I believe), where GCC generated incorrect code unless certain functions had been inlined (caught by test app). No an AVX expert, just my 2c.

Quoted 7 lines
Quoted 2 lines

Applied to dpdk-next-net-intel.

Hi Thomas, David,

Do you prefer to get this directly to the main repo, since it is fixing the windows build?

I have no issue with the main branch for mingw.
The windows builds at UNH seem unavailable, so we can wait for the next-net merge.

Signature · 1 line
David Marchand
#11 lore raw

Re: [dpdk-dev] [dpdk-ci] [PATCH v2] net/i40e: fix avx code error on MinGW

Hi All,

The jobs for Windows compile are running, so it may just be the patch hasn't caught up in the queue.

Cheers,
Lincoln

Quoted 63 lines · David Marchand
Quoted 9 lines · Ferruh Yigit
Quoted 7 lines · Qi Z
Quoted 7 lines

-----Original Message-----
From: Dmitry Kozlyuk <[email protected]>
Sent: Wednesday, February 3, 2021 7:08 AM
To: Rong, Leyi <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>;

Yigit,

Quoted 1 line
Quoted 1 line
Quoted 1 line

Ferruh <[email protected]>; [email protected]; Richardson,

Bruce

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

<[email protected]>; [email protected]; Kadam, Pallavi <[email protected]>; Menon, Ranjit <[email protected]>;

Xing,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Beilei <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix avx code error on

MinGW

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines · Leyi Rong
Quoted 4 lines

Adds extra cflags '-fno-asynchronous-unwind-tables' to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Fixes 5c38c33f7880 ("net/i40e: disable AVX512 with MinGW")

Re: -fno-asynchronous-unwind-tables, when cross-compiling from Linux,

I

Quoted 1 line
Quoted 1 line
Quoted 1 line

observe bit-to-bit identical i40e_rxtx_vec_avx512.c.obj. My guess it

that this

Quoted 1 line
Quoted 1 line
Quoted 1 line

option somehow affects GCC inlining heuristics. Similar issue existed

in

Quoted 1 line
Quoted 1 line
Quoted 1 line

librte_acl (at least a year ago win GCC 6, I believe), where GCC

generated

Quoted 1 line
Quoted 1 line
Quoted 1 line

incorrect code unless certain functions had been inlined (caught by

test app).

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

No an AVX expert, just my 2c.

Applied to dpdk-next-net-intel.

Hi Thomas, David,

Do you prefer to get this directly to the main repo, since it is fixing

the

Quoted 1 line

windows build?

I have no issue with the main branch for mingw.
The windows builds at UNH seem unavailable, so we can wait for the next-net merge.

--
David Marchand

Signature · 7 lines
*Lincoln Lavoie*
Principal Engineer, Broadband Technologies
21 Madbury Rd., Ste. 100, Durham, NH 03824
[email protected]
https://www.iol.unh.edu
+1-603-674-2755 (m)
<https://www.iol.unh.edu>