mbox series

[v3,0/3] AVX512 vPMD on i40e

Message ID 20210114063951.2580-1-leyi.rong@intel.com (mailing list archive)
Headers show
Series AVX512 vPMD on i40e | expand

Message

Leyi Rong Jan. 14, 2021, 6:39 a.m. UTC
This patchset aims to support AVX512 vPMD on i40e.
And the changes are only target to AVX512 vector path.

---
v3:
- Extract get_avx_supported() to get the proper vector data path to choose.

v2:
- Add return value check on rte_mempool_default_cache().


Leyi Rong (3):
  net/i40e: remove devarg use-latest-supported-vec
  net/i40e: add AVX512 vector path
  net/i40e: optimize Tx by using AVX512

 doc/guides/nics/i40e.rst                |    9 -
 drivers/net/i40e/i40e_ethdev.c          |   63 +-
 drivers/net/i40e/i40e_ethdev.h          |    3 -
 drivers/net/i40e/i40e_rxtx.c            |  196 ++--
 drivers/net/i40e/i40e_rxtx.h            |   13 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136 +++++++++++++++++++++++
 drivers/net/i40e/meson.build            |   24 +
 7 files changed, 1301 insertions(+), 143 deletions(-)
 create mode 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c

Comments

Zhang, Qi Z Jan. 14, 2021, 7:37 a.m. UTC | #1
> -----Original Message-----
> From: Rong, Leyi <leyi.rong@intel.com>
> Sent: Thursday, January 14, 2021 2:40 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>;
> Yigit, Ferruh <ferruh.yigit@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Rong, Leyi <leyi.rong@intel.com>
> Subject: [PATCH v3 0/3] AVX512 vPMD on i40e
> 
> This patchset aims to support AVX512 vPMD on i40e.
> And the changes are only target to AVX512 vector path.
> 
> ---
> v3:
> - Extract get_avx_supported() to get the proper vector data path to choose.
> 
> v2:
> - Add return value check on rte_mempool_default_cache().
> 
> 
> Leyi Rong (3):
>   net/i40e: remove devarg use-latest-supported-vec
>   net/i40e: add AVX512 vector path
>   net/i40e: optimize Tx by using AVX512
> 
>  doc/guides/nics/i40e.rst                |    9 -
>  drivers/net/i40e/i40e_ethdev.c          |   63 +-
>  drivers/net/i40e/i40e_ethdev.h          |    3 -
>  drivers/net/i40e/i40e_rxtx.c            |  196 ++--
>  drivers/net/i40e/i40e_rxtx.h            |   13 +
>  drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136 +++++++++++++++++++++++
>  drivers/net/i40e/meson.build            |   24 +
>  7 files changed, 1301 insertions(+), 143 deletions(-)  create mode 100644
> drivers/net/i40e/i40e_rxtx_vec_avx512.c
> 
> --
> 2.17.1


Applied to dpdk-next-net-intel after revert v1.

Thanks
Qi
Odi Assli Jan. 17, 2021, 11:26 a.m. UTC | #2
> > Subject: [PATCH v3 0/3] AVX512 vPMD on i40e
> >
> > This patchset aims to support AVX512 vPMD on i40e.
> > And the changes are only target to AVX512 vector path.
> >
> > ---
> > v3:
> > - Extract get_avx_supported() to get the proper vector data path to
> choose.
> >
> > v2:
> > - Add return value check on rte_mempool_default_cache().
> >
> >
> > Leyi Rong (3):
> >   net/i40e: remove devarg use-latest-supported-vec
> >   net/i40e: add AVX512 vector path
> >   net/i40e: optimize Tx by using AVX512
> >
> >  doc/guides/nics/i40e.rst                |    9 -
> >  drivers/net/i40e/i40e_ethdev.c          |   63 +-
> >  drivers/net/i40e/i40e_ethdev.h          |    3 -
> >  drivers/net/i40e/i40e_rxtx.c            |  196 ++--
> >  drivers/net/i40e/i40e_rxtx.h            |   13 +
> >  drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136
> +++++++++++++++++++++++
> >  drivers/net/i40e/meson.build            |   24 +
> >  7 files changed, 1301 insertions(+), 143 deletions(-)  create mode
> > 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
> >
> > --
> > 2.17.1
> 
> 
> Applied to dpdk-next-net-intel after revert v1.
> 
> Thanks
> Qi

Hi,
This patch series broke i40e compilation on windows with failure in undefined __m_prefetchw function 
Please see details in bug: 619 [1].

[1]: https://bugs.dpdk.org/show_bug.cgi?id=619
Leyi Rong Jan. 18, 2021, 1:58 p.m. UTC | #3
> -----Original Message-----
> From: Odi Assli <odia@nvidia.com>
> Sent: Sunday, January 17, 2021 7:26 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Rong, Leyi <leyi.rong@intel.com>; Lu,
> Wenzhuo <wenzhuo.lu@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> Richardson, Bruce <bruce.richardson@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Kadam, Pallavi <pallavi.kadam@intel.com>; Menon,
> Ranjit <ranjit.menon@intel.com>
> Cc: dev@dpdk.org; Tal Shnaiderman <talshn@nvidia.com>; NBU-Contact-
> Thomas Monjalon <thomas@monjalon.net>; Raslan Darawsheh
> <rasland@nvidia.com>; Ali Alnubani <alialnu@nvidia.com>
> Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e
> 
> > > Subject: [PATCH v3 0/3] AVX512 vPMD on i40e
> > >
> > > This patchset aims to support AVX512 vPMD on i40e.
> > > And the changes are only target to AVX512 vector path.
> > >
> > > ---
> > > v3:
> > > - Extract get_avx_supported() to get the proper vector data path to
> > choose.
> > >
> > > v2:
> > > - Add return value check on rte_mempool_default_cache().
> > >
> > >
> > > Leyi Rong (3):
> > >   net/i40e: remove devarg use-latest-supported-vec
> > >   net/i40e: add AVX512 vector path
> > >   net/i40e: optimize Tx by using AVX512
> > >
> > >  doc/guides/nics/i40e.rst                |    9 -
> > >  drivers/net/i40e/i40e_ethdev.c          |   63 +-
> > >  drivers/net/i40e/i40e_ethdev.h          |    3 -
> > >  drivers/net/i40e/i40e_rxtx.c            |  196 ++--
> > >  drivers/net/i40e/i40e_rxtx.h            |   13 +
> > >  drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136
> > +++++++++++++++++++++++
> > >  drivers/net/i40e/meson.build            |   24 +
> > >  7 files changed, 1301 insertions(+), 143 deletions(-)  create mode
> > > 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
> > >
> > > --
> > > 2.17.1
> >
> >
> > Applied to dpdk-next-net-intel after revert v1.
> >
> > Thanks
> > Qi
> 
> Hi,
> This patch series broke i40e compilation on windows with failure in undefined
> __m_prefetchw function Please see details in bug: 619 [1].
> 
> [1]: https://bugs.dpdk.org/show_bug.cgi?id=619
> 

Hi Ferruh,

Could you help to squash my fix patch into the patch series? As I've verified it works locally.
 
Hi Assli,

Could you help to check after Ferruh squashed the fix patch into the next-net?
Ferruh Yigit Jan. 18, 2021, 2:24 p.m. UTC | #4
On 1/18/2021 1:58 PM, Rong, Leyi wrote:
> 
>> -----Original Message-----
>> From: Odi Assli <odia@nvidia.com>
>> Sent: Sunday, January 17, 2021 7:26 PM
>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Rong, Leyi <leyi.rong@intel.com>; Lu,
>> Wenzhuo <wenzhuo.lu@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
>> Richardson, Bruce <bruce.richardson@intel.com>; Xing, Beilei
>> <beilei.xing@intel.com>; Kadam, Pallavi <pallavi.kadam@intel.com>; Menon,
>> Ranjit <ranjit.menon@intel.com>
>> Cc: dev@dpdk.org; Tal Shnaiderman <talshn@nvidia.com>; NBU-Contact-
>> Thomas Monjalon <thomas@monjalon.net>; Raslan Darawsheh
>> <rasland@nvidia.com>; Ali Alnubani <alialnu@nvidia.com>
>> Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e
>>
>>>> Subject: [PATCH v3 0/3] AVX512 vPMD on i40e
>>>>
>>>> This patchset aims to support AVX512 vPMD on i40e.
>>>> And the changes are only target to AVX512 vector path.
>>>>
>>>> ---
>>>> v3:
>>>> - Extract get_avx_supported() to get the proper vector data path to
>>> choose.
>>>>
>>>> v2:
>>>> - Add return value check on rte_mempool_default_cache().
>>>>
>>>>
>>>> Leyi Rong (3):
>>>>    net/i40e: remove devarg use-latest-supported-vec
>>>>    net/i40e: add AVX512 vector path
>>>>    net/i40e: optimize Tx by using AVX512
>>>>
>>>>   doc/guides/nics/i40e.rst                |    9 -
>>>>   drivers/net/i40e/i40e_ethdev.c          |   63 +-
>>>>   drivers/net/i40e/i40e_ethdev.h          |    3 -
>>>>   drivers/net/i40e/i40e_rxtx.c            |  196 ++--
>>>>   drivers/net/i40e/i40e_rxtx.h            |   13 +
>>>>   drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136
>>> +++++++++++++++++++++++
>>>>   drivers/net/i40e/meson.build            |   24 +
>>>>   7 files changed, 1301 insertions(+), 143 deletions(-)  create mode
>>>> 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
>>>>
>>>> --
>>>> 2.17.1
>>>
>>>
>>> Applied to dpdk-next-net-intel after revert v1.
>>>
>>> Thanks
>>> Qi
>>
>> Hi,
>> This patch series broke i40e compilation on windows with failure in undefined
>> __m_prefetchw function Please see details in bug: 619 [1].
>>
>> [1]: https://bugs.dpdk.org/show_bug.cgi?id=619
>>
> 
> Hi Ferruh,
> 
> Could you help to squash my fix patch into the patch series? As I've verified it works locally.
> 
> Hi Assli,
> 
> Could you help to check after Ferruh squashed the fix patch into the next-net?
> 

Hi Assli,

The other-way around is safer perhaps, can you please test with the patch:
https://patches.dpdk.org/patch/86804/

If it is good, I can squash it in the next-net.

Thanks,
ferruh
Odi Assli Jan. 18, 2021, 2:53 p.m. UTC | #5
> Subject: Re: [PATCH v3 0/3] AVX512 vPMD on i40e
> 
> External email: Use caution opening links or attachments
> 
> 
> On 1/18/2021 1:58 PM, Rong, Leyi wrote:
> >
> >> -----Original Message-----
> >> From: Odi Assli <odia@nvidia.com>
> >> Sent: Sunday, January 17, 2021 7:26 PM
> >> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Rong, Leyi
> >> <leyi.rong@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yigit,
> >> Ferruh <ferruh.yigit@intel.com>; Richardson, Bruce
> >> <bruce.richardson@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> >> Kadam, Pallavi <pallavi.kadam@intel.com>; Menon, Ranjit
> >> <ranjit.menon@intel.com>
> >> Cc: dev@dpdk.org; Tal Shnaiderman <talshn@nvidia.com>; NBU-Contact-
> >> Thomas Monjalon <thomas@monjalon.net>; Raslan Darawsheh
> >> <rasland@nvidia.com>; Ali Alnubani <alialnu@nvidia.com>
> >> Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e
> >>
> >>>> Subject: [PATCH v3 0/3] AVX512 vPMD on i40e
> >>>>
> >>>> This patchset aims to support AVX512 vPMD on i40e.
> >>>> And the changes are only target to AVX512 vector path.
> >>>>
> >>>> ---
> >>>> v3:
> >>>> - Extract get_avx_supported() to get the proper vector data path to
> >>> choose.
> >>>>
> >>>> v2:
> >>>> - Add return value check on rte_mempool_default_cache().
> >>>>
> >>>>
> >>>> Leyi Rong (3):
> >>>>    net/i40e: remove devarg use-latest-supported-vec
> >>>>    net/i40e: add AVX512 vector path
> >>>>    net/i40e: optimize Tx by using AVX512
> >>>>
> >>>>   doc/guides/nics/i40e.rst                |    9 -
> >>>>   drivers/net/i40e/i40e_ethdev.c          |   63 +-
> >>>>   drivers/net/i40e/i40e_ethdev.h          |    3 -
> >>>>   drivers/net/i40e/i40e_rxtx.c            |  196 ++--
> >>>>   drivers/net/i40e/i40e_rxtx.h            |   13 +
> >>>>   drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136
> >>> +++++++++++++++++++++++
> >>>>   drivers/net/i40e/meson.build            |   24 +
> >>>>   7 files changed, 1301 insertions(+), 143 deletions(-)  create
> >>>> mode
> >>>> 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
> >>>>
> >>>> --
> >>>> 2.17.1
> >>>
> >>>
> >>> Applied to dpdk-next-net-intel after revert v1.
> >>>
> >>> Thanks
> >>> Qi
> >>
> >> Hi,
> >> This patch series broke i40e compilation on windows with failure in
> >> undefined __m_prefetchw function Please see details in bug: 619 [1].
> >>
> >> [1]:
> >>
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbug
> >>
> s.dpdk.org%2Fshow_bug.cgi%3Fid%3D619&amp;data=04%7C01%7Codia%40
> nvidia
> >>
> .com%7C4b212e1ae3d045b6264108d8bbbd7703%7C43083d15727340c1b7db3
> 9efd9c
> >>
> cc17a%7C0%7C0%7C637465769725929951%7CUnknown%7CTWFpbGZsb3d8e
> yJWIjoiMC
> >>
> 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&
> amp;s
> >>
> data=oSmKjG6Za9DCSthbn72YfsQ1JsrUoaVSUCLNt7c5R4o%3D&amp;reserve
> d=0
> >>
> >
> > Hi Ferruh,
> >
> > Could you help to squash my fix patch into the patch series? As I've verified
> it works locally.
> >
> > Hi Assli,
> >
> > Could you help to check after Ferruh squashed the fix patch into the next-
> net?
> >
> 
> Hi Assli,
> 
> The other-way around is safer perhaps, can you please test with the patch:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
> hes.dpdk.org%2Fpatch%2F86804%2F&amp;data=04%7C01%7Codia%40nvidia
> .com%7C4b212e1ae3d045b6264108d8bbbd7703%7C43083d15727340c1b7db3
> 9efd9ccc17a%7C0%7C0%7C637465769725939943%7CUnknown%7CTWFpbGZs
> b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn
> 0%3D%7C1000&amp;sdata=ZQU7m8zNXw%2BKxeG6AcveYp9Dpa4k%2BdeO
> 2hK5DiBT3lg%3D&amp;reserved=0
> 
> If it is good, I can squash it in the next-net.
> 
> Thanks,
> ferruh

Hi Guys,

I tested it in my side and it works
Can you please the Bugzilla bug 619?


Regards,
Odi.
Ferruh Yigit Jan. 18, 2021, 4:36 p.m. UTC | #6
On 1/18/2021 2:53 PM, Odi Assli wrote:
>> Subject: Re: [PATCH v3 0/3] AVX512 vPMD on i40e
>>
>> External email: Use caution opening links or attachments
>>
>>
>> On 1/18/2021 1:58 PM, Rong, Leyi wrote:
>>>
>>>> -----Original Message-----
>>>> From: Odi Assli <odia@nvidia.com>
>>>> Sent: Sunday, January 17, 2021 7:26 PM
>>>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Rong, Leyi
>>>> <leyi.rong@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yigit,
>>>> Ferruh <ferruh.yigit@intel.com>; Richardson, Bruce
>>>> <bruce.richardson@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
>>>> Kadam, Pallavi <pallavi.kadam@intel.com>; Menon, Ranjit
>>>> <ranjit.menon@intel.com>
>>>> Cc: dev@dpdk.org; Tal Shnaiderman <talshn@nvidia.com>; NBU-Contact-
>>>> Thomas Monjalon <thomas@monjalon.net>; Raslan Darawsheh
>>>> <rasland@nvidia.com>; Ali Alnubani <alialnu@nvidia.com>
>>>> Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e
>>>>
>>>>>> Subject: [PATCH v3 0/3] AVX512 vPMD on i40e
>>>>>>
>>>>>> This patchset aims to support AVX512 vPMD on i40e.
>>>>>> And the changes are only target to AVX512 vector path.
>>>>>>
>>>>>> ---
>>>>>> v3:
>>>>>> - Extract get_avx_supported() to get the proper vector data path to
>>>>> choose.
>>>>>>
>>>>>> v2:
>>>>>> - Add return value check on rte_mempool_default_cache().
>>>>>>
>>>>>>
>>>>>> Leyi Rong (3):
>>>>>>     net/i40e: remove devarg use-latest-supported-vec
>>>>>>     net/i40e: add AVX512 vector path
>>>>>>     net/i40e: optimize Tx by using AVX512
>>>>>>
>>>>>>    doc/guides/nics/i40e.rst                |    9 -
>>>>>>    drivers/net/i40e/i40e_ethdev.c          |   63 +-
>>>>>>    drivers/net/i40e/i40e_ethdev.h          |    3 -
>>>>>>    drivers/net/i40e/i40e_rxtx.c            |  196 ++--
>>>>>>    drivers/net/i40e/i40e_rxtx.h            |   13 +
>>>>>>    drivers/net/i40e/i40e_rxtx_vec_avx512.c | 1136
>>>>> +++++++++++++++++++++++
>>>>>>    drivers/net/i40e/meson.build            |   24 +
>>>>>>    7 files changed, 1301 insertions(+), 143 deletions(-)  create
>>>>>> mode
>>>>>> 100644 drivers/net/i40e/i40e_rxtx_vec_avx512.c
>>>>>>
>>>>>> --
>>>>>> 2.17.1
>>>>>
>>>>>
>>>>> Applied to dpdk-next-net-intel after revert v1.
>>>>>
>>>>> Thanks
>>>>> Qi
>>>>
>>>> Hi,
>>>> This patch series broke i40e compilation on windows with failure in
>>>> undefined __m_prefetchw function Please see details in bug: 619 [1].
>>>>
>>>> [1]:
>>>>
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbug
>>>>
>> s.dpdk.org%2Fshow_bug.cgi%3Fid%3D619&amp;data=04%7C01%7Codia%40
>> nvidia
>>>>
>> .com%7C4b212e1ae3d045b6264108d8bbbd7703%7C43083d15727340c1b7db3
>> 9efd9c
>>>>
>> cc17a%7C0%7C0%7C637465769725929951%7CUnknown%7CTWFpbGZsb3d8e
>> yJWIjoiMC
>>>>
>> 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&
>> amp;s
>>>>
>> data=oSmKjG6Za9DCSthbn72YfsQ1JsrUoaVSUCLNt7c5R4o%3D&amp;reserve
>> d=0
>>>>
>>>
>>> Hi Ferruh,
>>>
>>> Could you help to squash my fix patch into the patch series? As I've verified
>> it works locally.
>>>
>>> Hi Assli,
>>>
>>> Could you help to check after Ferruh squashed the fix patch into the next-
>> net?
>>>
>>
>> Hi Assli,
>>
>> The other-way around is safer perhaps, can you please test with the patch:
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
>> hes.dpdk.org%2Fpatch%2F86804%2F&amp;data=04%7C01%7Codia%40nvidia
>> .com%7C4b212e1ae3d045b6264108d8bbbd7703%7C43083d15727340c1b7db3
>> 9efd9ccc17a%7C0%7C0%7C637465769725939943%7CUnknown%7CTWFpbGZs
>> b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn
>> 0%3D%7C1000&amp;sdata=ZQU7m8zNXw%2BKxeG6AcveYp9Dpa4k%2BdeO
>> 2hK5DiBT3lg%3D&amp;reserved=0
>>
>> If it is good, I can squash it in the next-net.
>>
>> Thanks,
>> ferruh
> 
> Hi Guys,
> 
> I tested it in my side and it works

Thanks Assli, Leyi, I will proceed with the patch.

> Can you please the Bugzilla bug 619?
>
Ali Alnubani Jan. 19, 2021, 1:46 p.m. UTC | #7
Hi,

> > Hi Guys,
> >
> > I tested it in my side and it works
> 
> Thanks Assli, Leyi, I will proceed with the patch.
> 
> > Can you please the Bugzilla bug 619?
> >

The patch "add AVX512 vector path" also caused a build failure when cross compiling on Linux using mingw, and it's still reproducing in next-net (517969c95).

```
$ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-mingw -Dexamples=helloworld build  && ninja-build -C build -j32

[221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-21.dll.symbols
[222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-21.dll.symbols
[223/232] Linking target lib/librte_net-21.dll
[224/232] Compiling C object drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
...
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 ../../root/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}:25351: Error: invalid register for .seh_savexmm
{standard input}:25352: Error: invalid register for .seh_savexmm
[225/232] Generating symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
ninja: build stopped: subcommand failed.
```

OS: Fedora 32
Meson: 0.55.3
MinGW: Fedora MinGW 9.2.1-6.fc32

- Ali
Tal Shnaiderman Jan. 20, 2021, 6:25 a.m. UTC | #8
> Subject: RE: [PATCH v3 0/3] AVX512 vPMD on i40e
> 
> Hi,
> 
> > > Hi Guys,
> > >
> > > I tested it in my side and it works
> >
> > Thanks Assli, Leyi, I will proceed with the patch.
> >
> > > Can you please the Bugzilla bug 619?
> > >
> 
> The patch "add AVX512 vector path" also caused a build failure when cross
> compiling on Linux using mingw, and it's still reproducing in next-net
> (517969c95).
> 
> ```
> $ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
> mingw -Dexamples=helloworld build  && ninja-build -C build -j32
> 
> [221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
> 21.dll.symbols
> [222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
> 21.dll.symbols
> [223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
> drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
> FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
> ...
> 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
> ../../root/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}:25351: Error: invalid register for .seh_savexmm {standard
> input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
> symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
> ninja: build stopped: subcommand failed.
> ```
> 
> OS: Fedora 32
> Meson: 0.55.3
> MinGW: Fedora MinGW 9.2.1-6.fc32
> 
> - Ali

Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.

[1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/
David Marchand Jan. 20, 2021, 8:36 a.m. UTC | #9
On Wed, Jan 20, 2021 at 7:26 AM Tal Shnaiderman <talshn@nvidia.com> wrote:
> > The patch "add AVX512 vector path" also caused a build failure when cross
> > compiling on Linux using mingw, and it's still reproducing in next-net
> > (517969c95).
> >
> > ```
> > $ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
> > mingw -Dexamples=helloworld build  && ninja-build -C build -j32
> >
> > [221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
> > 21.dll.symbols
> > [222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
> > 21.dll.symbols
> > [223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
> > drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
> > FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
> > ...
> > 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
> > ../../root/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}:25351: Error: invalid register for .seh_savexmm {standard
> > input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
> > symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
> > ninja: build stopped: subcommand failed.
> > ```
> >
> > OS: Fedora 32
> > Meson: 0.55.3
> > MinGW: Fedora MinGW 9.2.1-6.fc32
> >
> > - Ali
>
> Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.
>
> [1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/

I won't grmbl about how CI reports are not being looked at (or maybe I
just did :)).

This simple patch seems to work for me:

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


If nobody has a better fix, I'll send it later.
Ferruh Yigit Jan. 20, 2021, 9:18 a.m. UTC | #10
On 1/20/2021 8:36 AM, David Marchand wrote:
> On Wed, Jan 20, 2021 at 7:26 AM Tal Shnaiderman <talshn@nvidia.com> wrote:
>>> The patch "add AVX512 vector path" also caused a build failure when cross
>>> compiling on Linux using mingw, and it's still reproducing in next-net
>>> (517969c95).
>>>
>>> ```
>>> $ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
>>> mingw -Dexamples=helloworld build  && ninja-build -C build -j32
>>>
>>> [221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
>>> 21.dll.symbols
>>> [222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
>>> 21.dll.symbols
>>> [223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
>>> drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
>>> FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
>>> ...
>>> 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
>>> ../../root/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}:25351: Error: invalid register for .seh_savexmm {standard
>>> input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
>>> symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
>>> ninja: build stopped: subcommand failed.
>>> ```
>>>
>>> OS: Fedora 32
>>> Meson: 0.55.3
>>> MinGW: Fedora MinGW 9.2.1-6.fc32
>>>
>>> - Ali
>>
>> Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.
>>
>> [1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/
> 
> I won't grmbl about how CI reports are not being looked at (or maybe I
> just did :)).
> 

Noted and agreed, I will be more careful next time for next-net.
Thomas Monjalon Jan. 20, 2021, 9:23 a.m. UTC | #11
20/01/2021 09:36, David Marchand:
> On Wed, Jan 20, 2021 at 7:26 AM Tal Shnaiderman <talshn@nvidia.com> wrote:
> > > The patch "add AVX512 vector path" also caused a build failure when cross
> > > compiling on Linux using mingw, and it's still reproducing in next-net
> > > (517969c95).
> > >
> > > ```
> > > $ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
> > > mingw -Dexamples=helloworld build  && ninja-build -C build -j32
> > >
> > > [221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
> > > 21.dll.symbols
> > > [222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
> > > 21.dll.symbols
> > > [223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
> > > drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
> > > FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
> > > ...
> > > 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
> > > ../../root/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}:25351: Error: invalid register for .seh_savexmm {standard
> > > input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
> > > symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
> > > ninja: build stopped: subcommand failed.
> > > ```
> > >
> > > OS: Fedora 32
> > > Meson: 0.55.3
> > > MinGW: Fedora MinGW 9.2.1-6.fc32
> > >
> > > - Ali
> >
> > Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.
> >
> > [1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/
> 
> I won't grmbl about how CI reports are not being looked at (or maybe I
> just did :)).
> 
> This simple patch seems to work for me:
> 
> 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')
> 
> 
> If nobody has a better fix, I'll send it later.


For info, I don't reproduce the compilation issue on my machine.
David Marchand Jan. 20, 2021, 9:53 a.m. UTC | #12
On Wed, Jan 20, 2021 at 10:23 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 20/01/2021 09:36, David Marchand:
> > On Wed, Jan 20, 2021 at 7:26 AM Tal Shnaiderman <talshn@nvidia.com> wrote:
> > > > The patch "add AVX512 vector path" also caused a build failure when cross
> > > > compiling on Linux using mingw, and it's still reproducing in next-net
> > > > (517969c95).
> > > >
> > > > ```
> > > > $ meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-
> > > > mingw -Dexamples=helloworld build  && ninja-build -C build -j32
> > > >
> > > > [221/232] Generating symbol file lib/librte_mbuf-21.dll.p/librte_mbuf-
> > > > 21.dll.symbols
> > > > [222/232] Generating symbol file lib/librte_hash-21.dll.p/librte_hash-
> > > > 21.dll.symbols
> > > > [223/232] Linking target lib/librte_net-21.dll [224/232] Compiling C object
> > > > drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
> > > > FAILED: drivers/net/i40e/libi40e_avx512_lib.a.p/i40e_rxtx_vec_avx512.c.obj
> > > > ...
> > > > 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
> > > > ../../root/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}:25351: Error: invalid register for .seh_savexmm {standard
> > > > input}:25352: Error: invalid register for .seh_savexmm [225/232] Generating
> > > > symbol file lib/librte_net-21.dll.p/librte_net-21.dll.symbols
> > > > ninja: build stopped: subcommand failed.
> > > > ```
> > > >
> > > > OS: Fedora 32
> > > > Meson: 0.55.3
> > > > MinGW: Fedora MinGW 9.2.1-6.fc32
> > > >
> > > > - Ali
> > >
> > > Those errors were detected in the CI tests for this patch [1], we should pay more attention to those now that 2 PMDs are supported on Windows.
> > >
> > > [1]: https://lab.dpdk.org/results/dashboard/patchsets/15164/
> >
> > I won't grmbl about how CI reports are not being looked at (or maybe I
> > just did :)).
> >
> > This simple patch seems to work for me:
> >
> > 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')
> >
> >
> > If nobody has a better fix, I'll send it later.
>
>
> For info, I don't reproduce the compilation issue on my machine.

My build system has been upgraded from fc31 to fc32 so I guess this
has something to do with it.
Ali Alnubani Jan. 20, 2021, 10:05 a.m. UTC | #13
> > For info, I don't reproduce the compilation issue on my machine.
> 
> My build system has been upgraded from fc31 to fc32 so I guess this has
> something to do with it.
> 

I can reproduce with (Fedora MinGW 9.2.1-6.fc32), but not with (Fedora MinGW 10.2.1-2.fc33).

- Ali
Ferruh Yigit Jan. 20, 2021, 5:51 p.m. UTC | #14
On 1/20/2021 10:05 AM, Ali Alnubani wrote:
>>> For info, I don't reproduce the compilation issue on my machine.
>>
>> My build system has been upgraded from fc31 to fc32 so I guess this has
>> something to do with it.
>>
> 
> I can reproduce with (Fedora MinGW 9.2.1-6.fc32), but not with (Fedora MinGW 10.2.1-2.fc33).
> 

First of all, for the patch @Tal provided its link, the windows build and the 
mingw build errors are different. And the windows build error should be already 
fixed by a patch that squashed in next-net (https://patches.dpdk.org/patch/86804/).


And for the mingw, I have same result with Ali, I can reproduce with (Fedora 
MinGW 9.2.1-6.fc32).

But different from the CI, I am getting the error [1] for all following files:
rte_random.c
i40e_rxtx_vec_sse.c
i40e_rxtx_vec_avx512.c
i40e_rxtx_vec_avx2.c
rte_ethdev.c

[1] Error: invalid register for .seh_savexmm


There is a stackoverflow entry for it:
https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin

If I use '-fno-asynchronous-unwind-tables' as suggested there, the build works fine.

So the problem may not be just 'i40e_rxtx_vec_avx512.c'.


If I change the machine type from 'native' to 'corei7' [2], the build error 
reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems happens when 
avx512 is supported by CPU, in this case compiler seems has a defect.
And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' explicitly 
set can cause the problem seen in all machines.

[2]
  diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw
  index 4c15a7fa2e..7cee238add 100644
  --- a/config/x86/cross-mingw
  +++ b/config/x86/cross-mingw
  @@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config'
   [host_machine]
   system = 'windows'
   cpu_family = 'x86_64'
  -cpu = 'native'
  +cpu = 'corei7'
   endian = 'little'



@Ranjit, @Pallavi,
Are you building using mingw, and if so are you observing same problem?
Ferruh Yigit Jan. 20, 2021, 6:04 p.m. UTC | #15
On 1/20/2021 5:51 PM, Ferruh Yigit wrote:
> On 1/20/2021 10:05 AM, Ali Alnubani wrote:
>>>> For info, I don't reproduce the compilation issue on my machine.
>>>
>>> My build system has been upgraded from fc31 to fc32 so I guess this has
>>> something to do with it.
>>>
>>
>> I can reproduce with (Fedora MinGW 9.2.1-6.fc32), but not with (Fedora MinGW 
>> 10.2.1-2.fc33).
>>
> 
> First of all, for the patch @Tal provided its link, the windows build and the 
> mingw build errors are different. And the windows build error should be already 
> fixed by a patch that squashed in next-net (https://patches.dpdk.org/patch/86804/).
> 
> 
> And for the mingw, I have same result with Ali, I can reproduce with (Fedora 
> MinGW 9.2.1-6.fc32).
> 
> But different from the CI, I am getting the error [1] for all following files:
> rte_random.c
> i40e_rxtx_vec_sse.c
> i40e_rxtx_vec_avx512.c
> i40e_rxtx_vec_avx2.c
> rte_ethdev.c
> 
> [1] Error: invalid register for .seh_savexmm
> 

Build log for above errors: https://pastebin.com/jD4jRVzL

> 
> There is a stackoverflow entry for it:
> https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin 
> 
> 
> If I use '-fno-asynchronous-unwind-tables' as suggested there, the build works 
> fine.
> 
> So the problem may not be just 'i40e_rxtx_vec_avx512.c'.
> 
> 
> If I change the machine type from 'native' to 'corei7' [2], the build error 
> reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems happens when 
> avx512 is supported by CPU, in this case compiler seems has a defect.
> And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' explicitly 
> set can cause the problem seen in all machines.
> 
> [2]
>   diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw
>   index 4c15a7fa2e..7cee238add 100644
>   --- a/config/x86/cross-mingw
>   +++ b/config/x86/cross-mingw
>   @@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config'
>    [host_machine]
>    system = 'windows'
>    cpu_family = 'x86_64'
>   -cpu = 'native'
>   +cpu = 'corei7'
>    endian = 'little'
> 
> 
> 
> @Ranjit, @Pallavi,
> Are you building using mingw, and if so are you observing same problem?
Kadam, Pallavi Jan. 21, 2021, 5:01 a.m. UTC | #16
On 1/20/2021 11:21 PM, Ferruh Yigit wrote:
> On 1/20/2021 10:05 AM, Ali Alnubani wrote:
>>>> For info, I don't reproduce the compilation issue on my machine.
>>>
>>> My build system has been upgraded from fc31 to fc32 so I guess this has
>>> something to do with it.
>>>
>>
>> I can reproduce with (Fedora MinGW 9.2.1-6.fc32), but not with 
>> (Fedora MinGW 10.2.1-2.fc33).
>>
>
> First of all, for the patch @Tal provided its link, the windows build 
> and the mingw build errors are different. And the windows build error 
> should be already fixed by a patch that squashed in next-net 
> (https://patches.dpdk.org/patch/86804/).
>
>
> And for the mingw, I have same result with Ali, I can reproduce with 
> (Fedora MinGW 9.2.1-6.fc32).
>
> But different from the CI, I am getting the error [1] for all 
> following files:
> rte_random.c
> i40e_rxtx_vec_sse.c
> i40e_rxtx_vec_avx512.c
> i40e_rxtx_vec_avx2.c
> rte_ethdev.c
>
> [1] Error: invalid register for .seh_savexmm
>
>
> There is a stackoverflow entry for it:
> https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin 
>
>
> If I use '-fno-asynchronous-unwind-tables' as suggested there, the 
> build works fine.
>
> So the problem may not be just 'i40e_rxtx_vec_avx512.c'.
>
>
> If I change the machine type from 'native' to 'corei7' [2], the build 
> error reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems 
> happens when avx512 is supported by CPU, in this case compiler seems 
> has a defect.
> And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' 
> explicitly set can cause the problem seen in all machines.
>
> [2]
>  diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw
>  index 4c15a7fa2e..7cee238add 100644
>  --- a/config/x86/cross-mingw
>  +++ b/config/x86/cross-mingw
>  @@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config'
>   [host_machine]
>   system = 'windows'
>   cpu_family = 'x86_64'
>  -cpu = 'native'
>  +cpu = 'corei7'
>   endian = 'little'
>
>
>
> @Ranjit, @Pallavi,
> Are you building using mingw, and if so are you observing same problem?

We usually build using Clang. However, we verify with mingw as well before submitting the patch.
As mentioned in the patch [1] comments, we replaced #include x86intrin.h with <rte_vect.h> in the file i40e_rxtx_vec_avx2.c
And this helped fixing an error related to conflicting types for '__m_prefethw' with Clang on Windows.
I was able to build this patch using Clang as well as mingw.
[1] http://patches.dpdk.org/patch/84770/

I verified patch fix submitted by Rong, Leyi, it builds successfully with Clang.
However, I am getting same error "Error: invalid register for .seh_savexmm" using mingw for 'i40e_rxtx_vec_avx512.c' file.

Thanks,
Pallavi
David Marchand Jan. 25, 2021, 2:35 p.m. UTC | #17
On Thu, Jan 21, 2021 at 6:02 AM Kadam, Pallavi <pallavi.kadam@intel.com> wrote:
> On 1/20/2021 11:21 PM, Ferruh Yigit wrote:
>
> And for the mingw, I have same result with Ali, I can reproduce with (Fedora MinGW 9.2.1-6.fc32).
>
> But different from the CI, I am getting the error [1] for all following files:
> rte_random.c
> i40e_rxtx_vec_sse.c
> i40e_rxtx_vec_avx512.c
> i40e_rxtx_vec_avx2.c
> rte_ethdev.c
>
> [1] Error: invalid register for .seh_savexmm
>
>
> There is a stackoverflow entry for it:
> https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin
>
> If I use '-fno-asynchronous-unwind-tables' as suggested there, the build works fine.
>
> So the problem may not be just 'i40e_rxtx_vec_avx512.c'.
>
>
> If I change the machine type from 'native' to 'corei7' [2], the build error reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems happens when avx512 is supported by CPU, in this case compiler seems has a defect.
> And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' explicitly set can cause the problem seen in all machines.
>
> [2]
>  diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw
>  index 4c15a7fa2e..7cee238add 100644
>  --- a/config/x86/cross-mingw
>  +++ b/config/x86/cross-mingw
>  @@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config'
>   [host_machine]
>   system = 'windows'
>   cpu_family = 'x86_64'
>  -cpu = 'native'
>  +cpu = 'corei7'
>   endian = 'little'
>
> @Ranjit, @Pallavi,
> Are you building using mingw, and if so are you observing same problem?
>

Thanks Ferruh.


> We usually build using Clang. However, we verify with mingw as well before submitting the patch.
> As mentioned in the patch [1] comments, we replaced #include x86intrin.h with <rte_vect.h> in the file i40e_rxtx_vec_avx2.c
> And this helped fixing an error related to conflicting types for '__m_prefethw' with Clang on Windows.
> I was able to build this patch using Clang as well as mingw.
> [1] http://patches.dpdk.org/patch/84770/
>
> I verified patch fix submitted by Rong, Leyi, it builds successfully with Clang.
> However, I am getting same error "Error: invalid register for .seh_savexmm" using mingw for 'i40e_rxtx_vec_avx512.c' file.

The patch I sent https://patchwork.dpdk.org/patch/86999/ is not enough.
I have neither time nor environment to find a fix.

For now I simply stopped checking mingw builds.

Will it get fixed?
Leyi Rong Jan. 26, 2021, 4:17 p.m. UTC | #18
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Monday, January 25, 2021 10:35 PM
> To: Kadam, Pallavi <pallavi.kadam@intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Ali Alnubani <alialnu@nvidia.com>;
> NBU-Contact-Thomas Monjalon <thomas@monjalon.net>; Richardson, Bruce
> <bruce.richardson@intel.com>; Tal Shnaiderman <talshn@nvidia.com>; Odi Assli
> <odia@nvidia.com>; Rong, Leyi <leyi.rong@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Menon, Ranjit <ranjit.menon@intel.com>;
> dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: Re: [dpdk-dev] [PATCH v3 0/3] AVX512 vPMD on i40e
> 
> On Thu, Jan 21, 2021 at 6:02 AM Kadam, Pallavi <pallavi.kadam@intel.com>
> wrote:
> > On 1/20/2021 11:21 PM, Ferruh Yigit wrote:
> >
> > And for the mingw, I have same result with Ali, I can reproduce with (Fedora
> MinGW 9.2.1-6.fc32).
> >
> > But different from the CI, I am getting the error [1] for all following files:
> > rte_random.c
> > i40e_rxtx_vec_sse.c
> > i40e_rxtx_vec_avx512.c
> > i40e_rxtx_vec_avx2.c
> > rte_ethdev.c
> >
> > [1] Error: invalid register for .seh_savexmm
> >
> >
> > There is a stackoverflow entry for it:
> > https://stackoverflow.com/questions/43152633/invalid-register-for-seh-
> > savexmm-in-cygwin
> >
> > If I use '-fno-asynchronous-unwind-tables' as suggested there, the build works
> fine.
> >
> > So the problem may not be just 'i40e_rxtx_vec_avx512.c'.
> >
> >
> > If I change the machine type from 'native' to 'corei7' [2], the build error
> reduced to only 'i40e_rxtx_vec_avx512.c', so the problem seems happens when
> avx512 is supported by CPU, in this case compiler seems has a defect.
> > And since for 'i40e_rxtx_vec_avx512.c' the '-march=skylake-avx512' explicitly
> set can cause the problem seen in all machines.
> >
> > [2]
> >  diff --git a/config/x86/cross-mingw b/config/x86/cross-mingw  index
> > 4c15a7fa2e..7cee238add 100644
> >  --- a/config/x86/cross-mingw
> >  +++ b/config/x86/cross-mingw
> >  @@ -9,5 +9,5 @@ pkgconfig = 'x86_64-w64-mingw32-pkg-config'
> >   [host_machine]
> >   system = 'windows'
> >   cpu_family = 'x86_64'
> >  -cpu = 'native'
> >  +cpu = 'corei7'
> >   endian = 'little'
> >
> > @Ranjit, @Pallavi,
> > Are you building using mingw, and if so are you observing same problem?
> >
> 
> Thanks Ferruh.
> 
> 
> > We usually build using Clang. However, we verify with mingw as well before
> submitting the patch.
> > As mentioned in the patch [1] comments, we replaced #include
> > x86intrin.h with <rte_vect.h> in the file i40e_rxtx_vec_avx2.c And this helped
> fixing an error related to conflicting types for '__m_prefethw' with Clang on
> Windows.
> > I was able to build this patch using Clang as well as mingw.
> > [1] http://patches.dpdk.org/patch/84770/
> >
> > I verified patch fix submitted by Rong, Leyi, it builds successfully with Clang.
> > However, I am getting same error "Error: invalid register for .seh_savexmm"
> using mingw for 'i40e_rxtx_vec_avx512.c' file.
> 
> The patch I sent https://patchwork.dpdk.org/patch/86999/ is not enough.
> I have neither time nor environment to find a fix.
> 
> For now I simply stopped checking mingw builds.
> 
> Will it get fixed?
> 
> 
> --
> David Marchand

Hi,

Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround.
Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.
Thomas Monjalon Jan. 26, 2021, 4:22 p.m. UTC | #19
26/01/2021 17:17, Rong, Leyi:
> > > On 1/20/2021 11:21 PM, Ferruh Yigit wrote:
> > >
> > > And for the mingw, I have same result with Ali, I can reproduce with (Fedora
> > MinGW 9.2.1-6.fc32).
> > >
> > > But different from the CI, I am getting the error [1] for all following files:
> > > rte_random.c
> > > i40e_rxtx_vec_sse.c
> > > i40e_rxtx_vec_avx512.c
> > > i40e_rxtx_vec_avx2.c
> > > rte_ethdev.c
[...]
> Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround.
> Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.

Ferruh mentioned errors with other files outside of i40e.
Ferruh Yigit Jan. 26, 2021, 4:39 p.m. UTC | #20
On 1/26/2021 4:22 PM, Thomas Monjalon wrote:
> 26/01/2021 17:17, Rong, Leyi:
>>>> On 1/20/2021 11:21 PM, Ferruh Yigit wrote:
>>>>
>>>> And for the mingw, I have same result with Ali, I can reproduce with (Fedora
>>> MinGW 9.2.1-6.fc32).
>>>>
>>>> But different from the CI, I am getting the error [1] for all following files:
>>>> rte_random.c
>>>> i40e_rxtx_vec_sse.c
>>>> i40e_rxtx_vec_avx512.c
>>>> i40e_rxtx_vec_avx2.c
>>>> rte_ethdev.c
> [...]
>> Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround.
>> Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.
> 
> Ferruh mentioned errors with other files outside of i40e.
> 

The patch globally disables the avx512 for windows cross build, not just for 
i40e, so I confirm it fixes the build errors in my environment.

But disabling avx512 like this is not best option.
Thomas Monjalon Jan. 26, 2021, 4:48 p.m. UTC | #21
26/01/2021 17:39, Ferruh Yigit:
> On 1/26/2021 4:22 PM, Thomas Monjalon wrote:
> > 26/01/2021 17:17, Rong, Leyi:
> >>>> On 1/20/2021 11:21 PM, Ferruh Yigit wrote:
> >>>>
> >>>> And for the mingw, I have same result with Ali, I can reproduce with (Fedora
> >>> MinGW 9.2.1-6.fc32).
> >>>>
> >>>> But different from the CI, I am getting the error [1] for all following files:
> >>>> rte_random.c
> >>>> i40e_rxtx_vec_sse.c
> >>>> i40e_rxtx_vec_avx512.c
> >>>> i40e_rxtx_vec_avx2.c
> >>>> rte_ethdev.c
> > [...]
> >> Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround.
> >> Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.
> > 
> > Ferruh mentioned errors with other files outside of i40e.
> > 
> 
> The patch globally disables the avx512 for windows cross build, not just for 
> i40e, so I confirm it fixes the build errors in my environment.
> 
> But disabling avx512 like this is not best option.

Some may argue that AVX512 is not the best option ;)
Ferruh Yigit Jan. 26, 2021, 4:51 p.m. UTC | #22
On 1/26/2021 4:48 PM, Thomas Monjalon wrote:
> 26/01/2021 17:39, Ferruh Yigit:
>> On 1/26/2021 4:22 PM, Thomas Monjalon wrote:
>>> 26/01/2021 17:17, Rong, Leyi:
>>>>>> On 1/20/2021 11:21 PM, Ferruh Yigit wrote:
>>>>>>
>>>>>> And for the mingw, I have same result with Ali, I can reproduce with (Fedora
>>>>> MinGW 9.2.1-6.fc32).
>>>>>>
>>>>>> But different from the CI, I am getting the error [1] for all following files:
>>>>>> rte_random.c
>>>>>> i40e_rxtx_vec_sse.c
>>>>>> i40e_rxtx_vec_avx512.c
>>>>>> i40e_rxtx_vec_avx2.c
>>>>>> rte_ethdev.c
>>> [...]
>>>> Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround.
>>>> Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.
>>>
>>> Ferruh mentioned errors with other files outside of i40e.
>>>
>>
>> The patch globally disables the avx512 for windows cross build, not just for
>> i40e, so I confirm it fixes the build errors in my environment.
>>
>> But disabling avx512 like this is not best option.
> 
> Some may argue that AVX512 is not the best option ;)
> 

flame war mode activated.
Dmitry Kozlyuk Jan. 28, 2021, 8:35 p.m. UTC | #23
On Tue, 26 Jan 2021 16:51:19 +0000, Ferruh Yigit wrote:
> On 1/26/2021 4:48 PM, Thomas Monjalon wrote:
> > 26/01/2021 17:39, Ferruh Yigit:  
> >> On 1/26/2021 4:22 PM, Thomas Monjalon wrote:  
> >>> 26/01/2021 17:17, Rong, Leyi:  
> >>>>>> On 1/20/2021 11:21 PM, Ferruh Yigit wrote:
> >>>>>>
> >>>>>> And for the mingw, I have same result with Ali, I can reproduce with (Fedora  
> >>>>> MinGW 9.2.1-6.fc32).  
> >>>>>>
> >>>>>> But different from the CI, I am getting the error [1] for all following files:
> >>>>>> rte_random.c
> >>>>>> i40e_rxtx_vec_sse.c
> >>>>>> i40e_rxtx_vec_avx512.c
> >>>>>> i40e_rxtx_vec_avx2.c
> >>>>>> rte_ethdev.c  
> >>> [...]  
> >>>> Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround.
> >>>> Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.  
> >>>
> >>> Ferruh mentioned errors with other files outside of i40e.
> >>>  
> >>
> >> The patch globally disables the avx512 for windows cross build, not just for
> >> i40e, so I confirm it fixes the build errors in my environment.
> >>
> >> But disabling avx512 like this is not best option.  
> > 
> > Some may argue that AVX512 is not the best option ;)
> >   
> 
> flame war mode activated.

I found the following fix working:

--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -60,6 +60,9 @@ if arch_subdir == 'x86'
 		if cc.has_argument('-march=skylake-avx512')
 			avx512_args += '-march=skylake-avx512'
 		endif
+		if is_windows and cc.get_id() == 'gcc'
+			avx512_args += '-fno-asynchronous-unwind-tables'
+		endif
 		i40e_avx512_lib = static_library('i40e_avx512_lib',
 				'i40e_rxtx_vec_avx512.c',
 				dependencies: [static_rte_ethdev,

It's admittedly from StackOverflow, but after reading about
-fno-asynchronous-unwind-tables I see no harm disabling it, at least for just
one file.
Thomas Monjalon Jan. 28, 2021, 9:24 p.m. UTC | #24
28/01/2021 21:35, Dmitry Kozlyuk:
> On Tue, 26 Jan 2021 16:51:19 +0000, Ferruh Yigit wrote:
> > On 1/26/2021 4:48 PM, Thomas Monjalon wrote:
> > > 26/01/2021 17:39, Ferruh Yigit:  
> > >> On 1/26/2021 4:22 PM, Thomas Monjalon wrote:  
> > >>> 26/01/2021 17:17, Rong, Leyi:  
> > >>>>>> On 1/20/2021 11:21 PM, Ferruh Yigit wrote:
> > >>>>>>
> > >>>>>> And for the mingw, I have same result with Ali, I can reproduce with (Fedora  
> > >>>>> MinGW 9.2.1-6.fc32).  
> > >>>>>>
> > >>>>>> But different from the CI, I am getting the error [1] for all following files:
> > >>>>>> rte_random.c
> > >>>>>> i40e_rxtx_vec_sse.c
> > >>>>>> i40e_rxtx_vec_avx512.c
> > >>>>>> i40e_rxtx_vec_avx2.c
> > >>>>>> rte_ethdev.c  
> > >>> [...]  
> > >>>> Send patch https://patchwork.dpdk.org/patch/87349/ to disable avx512 on windows as the workaround.
> > >>>> Pallavi also tested with this patch, and passed the mingw and clang build. Will try to see if has better way to fix.  
> > >>>
> > >>> Ferruh mentioned errors with other files outside of i40e.
> > >>>  
> > >>
> > >> The patch globally disables the avx512 for windows cross build, not just for
> > >> i40e, so I confirm it fixes the build errors in my environment.
> > >>
> > >> But disabling avx512 like this is not best option.  
> > > 
> > > Some may argue that AVX512 is not the best option ;)
> > >   
> > 
> > flame war mode activated.
> 
> I found the following fix working:
> 
> --- a/drivers/net/i40e/meson.build
> +++ b/drivers/net/i40e/meson.build
> @@ -60,6 +60,9 @@ if arch_subdir == 'x86'
>  		if cc.has_argument('-march=skylake-avx512')
>  			avx512_args += '-march=skylake-avx512'
>  		endif
> +		if is_windows and cc.get_id() == 'gcc'
> +			avx512_args += '-fno-asynchronous-unwind-tables'
> +		endif
>  		i40e_avx512_lib = static_library('i40e_avx512_lib',
>  				'i40e_rxtx_vec_avx512.c',
>  				dependencies: [static_rte_ethdev,
> 
> It's admittedly from StackOverflow, but after reading about
> -fno-asynchronous-unwind-tables I see no harm disabling it, at least for just
> one file.

Thanks, it will require some tests and approvals.
For now, I take the patch proposing a simple disabling of AVX512 with MinGW.