DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: disable AVX512 for Windows
@ 2021-01-20 16:40 David Marchand
  2021-01-20 17:46 ` David Marchand
  2021-01-20 18:21 ` Dmitry Kozlyuk
  0 siblings, 2 replies; 6+ messages in thread
From: David Marchand @ 2021-01-20 16:40 UTC (permalink / raw)
  To: dev
  Cc: dmitry.kozliuk, navasile, dmitrym, pallavi.kadam, ferruh.yigit,
	Beilei Xing, Jeff Guo, Wenzhuo Lu, Leyi Rong, Bruce Richardson

AVX512 does not seem supported with FC32 and Windows mingw:

FAILED:
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
x86_64-w64-mingw32-gcc -Idrivers/net/i40e/libi40e_avx512_lib.a.p
-Idrivers/net/i40e -I../../dpdk/drivers/net/i40e -Idrivers/net/i40e/base
-I../../dpdk/drivers/net/i40e/base -Ilib/librte_ethdev
-I../../dpdk/lib/librte_ethdev -I. -I../../dpdk -Iconfig
-I../../dpdk/config -Ilib/librte_eal/include
-I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/windows/include
-I../../dpdk/lib/librte_eal/windows/include -Ilib/librte_eal/x86/include
-I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_eal/common
-I../../dpdk/lib/librte_eal/common -Ilib/librte_eal
-I../../dpdk/lib/librte_eal -Ilib/librte_kvargs
-I../../dpdk/lib/librte_kvargs -Ilib/librte_net
-I../../dpdk/lib/librte_net -Ilib/librte_mbuf
-I../../dpdk/lib/librte_mbuf -Ilib/librte_mempool
-I../../dpdk/lib/librte_mempool -Ilib/librte_ring
-I../../dpdk/lib/librte_ring -Ilib/librte_meter
-I../../dpdk/lib/librte_meter -I../../dpdk/lib/librte_metrics
-Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry
-Ilib/librte_hash -I../../dpdk/lib/librte_hash -Ilib/librte_rcu
-I../../dpdk/lib/librte_rcu
-I/home/dmarchan/intel-ipsec-mb/install/include
-fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual
-Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs
-Wold-style-definition -Wpointer-arith -Wsign-compare
-Wstrict-prototypes -Wundef -Wwrite-strings
-Wno-address-of-packed-member -Wno-packed-not-aligned
-Wno-missing-field-initializers -D_GNU_SOURCE -D_WIN32_WINNT=0x0A00
-D__USE_MINGW_ANSI_STDIO -march=native -DALLOW_EXPERIMENTAL_API
-DALLOW_INTERNAL_API -Wno-format-truncation -DPF_DRIVER -DVF_DRIVER
-DINTEGRATED_VF -DX722_A0_SUPPORT -DCC_AVX2_SUPPORT -DCC_AVX512_SUPPORT
-mavx512f -mavx512bw -march=skylake-avx512 -MD -MQ
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj -MF
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj.d -o
drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj -c
../../dpdk/drivers/net/i40e/i40e_rxtx_vec_avx512.c
{standard input}: Assembler messages:
{standard input}:112: Error: invalid register for .seh_savexmm
{standard input}:114: Error: invalid register for .seh_savexmm
{standard input}:116: Error: invalid register for .seh_savexmm
{standard input}:118: Error: invalid register for .seh_savexmm
...

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

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
There is probably better to do rather than disabling AVX512 globally for
Windows but since I saw no patch fixing this, here it is.

---
 drivers/net/i40e/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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')
-- 
2.23.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: disable AVX512 for Windows
  2021-01-20 16:40 [dpdk-dev] [PATCH] net/i40e: disable AVX512 for Windows David Marchand
@ 2021-01-20 17:46 ` David Marchand
  2021-01-20 17:56   ` Ferruh Yigit
  2021-01-20 18:21 ` Dmitry Kozlyuk
  1 sibling, 1 reply; 6+ messages in thread
From: David Marchand @ 2021-01-20 17:46 UTC (permalink / raw)
  To: dev
  Cc: Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy (MESHCHANINOV),
	Pallavi Kadam, Yigit, Ferruh, Beilei Xing, Jeff Guo, Wenzhuo Lu,
	Leyi Rong, Bruce Richardson

On Wed, Jan 20, 2021 at 5:40 PM David Marchand
<david.marchand@redhat.com> wrote:
> There is probably better to do rather than disabling AVX512 globally for
> Windows but since I saw no patch fixing this, here it is.

Interesting...
This patch does not work with UNH job.
Seeing the same error but now on a different file, I am not sure what is wrong.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: disable AVX512 for Windows
  2021-01-20 17:46 ` David Marchand
@ 2021-01-20 17:56   ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2021-01-20 17:56 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy (MESHCHANINOV),
	Pallavi Kadam, Beilei Xing, Jeff Guo, Wenzhuo Lu, Leyi Rong,
	Bruce Richardson

On 1/20/2021 5:46 PM, David Marchand wrote:
> On Wed, Jan 20, 2021 at 5:40 PM David Marchand
> <david.marchand@redhat.com> wrote:
>> There is probably better to do rather than disabling AVX512 globally for
>> Windows but since I saw no patch fixing this, here it is.
> 
> Interesting...
> This patch does not work with UNH job.
> Seeing the same error but now on a different file, I am not sure what is wrong.
> 
> 

I have just replied to the original thread [1], the problem seems not just 
related to the 'i40e_rxtx_vec_avx512.c'.

[1]
http://inbox.dpdk.org/dev/20201215021945.103396-1-leyi.rong@intel.com/T/#mc47abfa0b72b068f26f4b8deb0dacea840d721e9

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: disable AVX512 for Windows
  2021-01-20 16:40 [dpdk-dev] [PATCH] net/i40e: disable AVX512 for Windows David Marchand
  2021-01-20 17:46 ` David Marchand
@ 2021-01-20 18:21 ` Dmitry Kozlyuk
  2021-01-20 18:24   ` Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Kozlyuk @ 2021-01-20 18:21 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, navasile, dmitrym, pallavi.kadam, ferruh.yigit, Beilei Xing,
	Jeff Guo, Wenzhuo Lu, Leyi Rong, Bruce Richardson

On Wed, 20 Jan 2021 17:40:16 +0100, David Marchand wrote:
> There is probably better to do rather than disabling AVX512 globally for
> Windows but since I saw no patch fixing this, here it is.
>
> ---
>  drivers/net/i40e/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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')

Clang doesn't seem to be affected, suggesting a cc.get_id() == 'gcc' check.

The error seems related to SEH (structured exception handling). Some MinGW
flavours don't use it, which can explain why the bug isn't not 100%
reproducible. IMO, just disabling AVX512 for MinGW is enough.

A nit, is there a reason to prefer "x == true" over "x"?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: disable AVX512 for Windows
  2021-01-20 18:21 ` Dmitry Kozlyuk
@ 2021-01-20 18:24   ` Ferruh Yigit
  2021-01-20 19:27     ` Dmitry Kozlyuk
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2021-01-20 18:24 UTC (permalink / raw)
  To: Dmitry Kozlyuk, David Marchand
  Cc: dev, navasile, dmitrym, pallavi.kadam, Beilei Xing, Jeff Guo,
	Wenzhuo Lu, Leyi Rong, Bruce Richardson

On 1/20/2021 6:21 PM, Dmitry Kozlyuk wrote:
> On Wed, 20 Jan 2021 17:40:16 +0100, David Marchand wrote:
>> There is probably better to do rather than disabling AVX512 globally for
>> Windows but since I saw no patch fixing this, here it is.
>>
>> ---
>>   drivers/net/i40e/meson.build | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 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')
> 
> Clang doesn't seem to be affected, suggesting a cc.get_id() == 'gcc' check.
> 
> The error seems related to SEH (structured exception handling). Some MinGW
> flavours don't use it, which can explain why the bug isn't not 100%
> reproducible. IMO, just disabling AVX512 for MinGW is enough.
> 

Is there a way to disable it selectively, only for the compiler versions that 
doesn't support it?

> A nit, is there a reason to prefer "x == true" over "x"?
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/i40e: disable AVX512 for Windows
  2021-01-20 18:24   ` Ferruh Yigit
@ 2021-01-20 19:27     ` Dmitry Kozlyuk
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Kozlyuk @ 2021-01-20 19:27 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: David Marchand, dev, navasile, dmitrym, pallavi.kadam,
	Beilei Xing, Jeff Guo, Wenzhuo Lu, Leyi Rong, Bruce Richardson

On Wed, 20 Jan 2021 18:24:43 +0000, Ferruh Yigit wrote:
> On 1/20/2021 6:21 PM, Dmitry Kozlyuk wrote:
> > On Wed, 20 Jan 2021 17:40:16 +0100, David Marchand wrote:  
> >> There is probably better to do rather than disabling AVX512 globally for
> >> Windows but since I saw no patch fixing this, here it is.
> >>
> >> ---
> >>   drivers/net/i40e/meson.build | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> 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')  
> > 
> > Clang doesn't seem to be affected, suggesting a cc.get_id() == 'gcc' check.
> > 
> > The error seems related to SEH (structured exception handling). Some MinGW
> > flavours don't use it, which can explain why the bug isn't not 100%
> > reproducible. IMO, just disabling AVX512 for MinGW is enough.
> >   
> 
> Is there a way to disable it selectively, only for the compiler versions that 
> doesn't support it?

It was a guesswork and it proved wrong, setsmp/longjmp flavour [1] with
GCC 8.1.0 also fails. Fedora 32 has GCC 9.2.1 (works), while Fedora 33 has
GCC 10.2.1 (fails). I use a reproducible environment [2] with GCC 9.3.0,
which succeeds. Seems like GCC 9 is the only known version that works, which
is pretty close to "doesn't work with MinGW at all".

[1]:
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-win32/sjlj/x86_64-8.1.0-release-win32-sjlj-rt_v6-rev0.7z

[2]: https://github.com/PlushBeaver/nix-shells/tree/master/dpdk

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-20 19:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 16:40 [dpdk-dev] [PATCH] net/i40e: disable AVX512 for Windows David Marchand
2021-01-20 17:46 ` David Marchand
2021-01-20 17:56   ` Ferruh Yigit
2021-01-20 18:21 ` Dmitry Kozlyuk
2021-01-20 18:24   ` Ferruh Yigit
2021-01-20 19:27     ` Dmitry Kozlyuk

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git