DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime
@ 2020-10-27 10:19 Leyi Rong
  2020-10-27 11:57 ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Leyi Rong @ 2020-10-27 10:19 UTC (permalink / raw)
  To: qi.z.zhang, ferruh.yigit, bruce.richardson, wenzhuo.lu; +Cc: dev, Leyi Rong

Intrinsic function __mm512_bsrli_epi128 should be used in
the environment which supports AVX512BW, so adds check for
this flag.

Fixes: 5dd3b8f3af34 ("net/ice: add AVX512 vector path")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 drivers/net/ice/ice_rxtx.c  | 12 ++++++++++--
 drivers/net/ice/meson.build | 13 +++++++++++--
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index f6291894cd..0785f37028 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -3007,7 +3007,8 @@ ice_set_rx_function(struct rte_eth_dev *dev)
 			}
 
 			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
-			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1)
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)
 #ifdef CC_AVX512_SUPPORT
 				use_avx512 = true;
 #else
@@ -3028,11 +3029,13 @@ ice_set_rx_function(struct rte_eth_dev *dev)
 	if (ad->rx_vec_allowed) {
 		if (dev->data->scattered_rx) {
 			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
 				PMD_DRV_LOG(NOTICE,
 					"Using AVX512 Vector Scattered Rx (port %d).",
 					dev->data->port_id);
 				dev->rx_pkt_burst =
 					ice_recv_scattered_pkts_vec_avx512;
+#endif
 			} else {
 				PMD_DRV_LOG(DEBUG,
 					"Using %sVector Scattered Rx (port %d).",
@@ -3044,11 +3047,13 @@ ice_set_rx_function(struct rte_eth_dev *dev)
 			}
 		} else {
 			if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
 				PMD_DRV_LOG(NOTICE,
 					"Using AVX512 Vector Rx (port %d).",
 					dev->data->port_id);
 				dev->rx_pkt_burst =
 					ice_recv_pkts_vec_avx512;
+#endif
 			} else {
 				PMD_DRV_LOG(DEBUG,
 					"Using %sVector Rx (port %d).",
@@ -3218,7 +3223,8 @@ ice_set_tx_function(struct rte_eth_dev *dev)
 			}
 
 			if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
-			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1)
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
+			rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)
 #ifdef CC_AVX512_SUPPORT
 				use_avx512 = true;
 #else
@@ -3238,9 +3244,11 @@ ice_set_tx_function(struct rte_eth_dev *dev)
 
 	if (ad->tx_vec_allowed) {
 		if (use_avx512) {
+#ifdef CC_AVX512_SUPPORT
 			PMD_DRV_LOG(NOTICE, "Using AVX512 Vector Tx (port %d).",
 				    dev->data->port_id);
 			dev->tx_pkt_burst = ice_xmit_pkts_vec_avx512;
+#endif
 		} else {
 			PMD_DRV_LOG(DEBUG, "Using %sVector Tx (port %d).",
 				    use_avx2 ? "avx2 " : "",
diff --git a/drivers/net/ice/meson.build b/drivers/net/ice/meson.build
index 514bad9b8b..7d54a49236 100644
--- a/drivers/net/ice/meson.build
+++ b/drivers/net/ice/meson.build
@@ -35,14 +35,23 @@ if arch_subdir == 'x86'
 		objs += ice_avx2_lib.extract_objects('ice_rxtx_vec_avx2.c')
 	endif
 
-	if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX512F') or (not machine_args.contains('-mno-avx512f') and cc.has_argument('-mavx512f'))
+	ice_avx512_cpu_support = (
+		cc.get_define('__AVX512F__', args: machine_args) != '' and
+		cc.get_define('__AVX512BW__', args: machine_args) != '')
+
+	ice_avx512_cc_support = (
+		not machine_args.contains('-mno-avx512f') and
+		cc.has_argument('-mavx512f') and
+		cc.has_argument('-mavx512bw'))
+
+	if ice_avx512_cpu_support == true or ice_avx512_cc_support == true
 		cflags += ['-DCC_AVX512_SUPPORT']
 		ice_avx512_lib = static_library('ice_avx512_lib',
 				      'ice_rxtx_vec_avx512.c',
 				      dependencies: [static_rte_ethdev,
 					static_rte_kvargs, static_rte_hash],
 				      include_directories: includes,
-				      c_args: [cflags, '-march=skylake-avx512', '-mavx512f'])
+				      c_args: [cflags, '-march=skylake-avx512', '-mavx512f', '-mavx512bw'])
 		objs += ice_avx512_lib.extract_objects('ice_rxtx_vec_avx512.c')
 	endif
 endif
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime
  2020-10-27 10:19 [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime Leyi Rong
@ 2020-10-27 11:57 ` Ferruh Yigit
  2020-10-27 12:47   ` Andrew Rybchenko
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ferruh Yigit @ 2020-10-27 11:57 UTC (permalink / raw)
  To: Leyi Rong, qi.z.zhang, bruce.richardson, wenzhuo.lu,
	Ali Alnubani, Andrew Rybchenko, David Marchand
  Cc: dev

On 10/27/2020 10:19 AM, Leyi Rong wrote:
> Intrinsic function __mm512_bsrli_epi128 should be used in
> the environment which supports AVX512BW, so adds check for
> this flag.
> 
> Fixes: 5dd3b8f3af34 ("net/ice: add AVX512 vector path")
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>

Squashed into relevant commit in next-net, thanks.


Andrew, Ali, David,

Can you please confirm the issue is solved in the next-net/main?

Thanks,
ferruh

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

* Re: [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime
  2020-10-27 11:57 ` Ferruh Yigit
@ 2020-10-27 12:47   ` Andrew Rybchenko
  2020-10-27 13:12   ` Ali Alnubani
  2020-10-27 13:17   ` David Marchand
  2 siblings, 0 replies; 9+ messages in thread
From: Andrew Rybchenko @ 2020-10-27 12:47 UTC (permalink / raw)
  To: Ferruh Yigit, Leyi Rong, qi.z.zhang, bruce.richardson,
	wenzhuo.lu, Ali Alnubani, David Marchand
  Cc: dev

On 10/27/20 2:57 PM, Ferruh Yigit wrote:
> On 10/27/2020 10:19 AM, Leyi Rong wrote:
>> Intrinsic function __mm512_bsrli_epi128 should be used in
>> the environment which supports AVX512BW, so adds check for
>> this flag.
>>
>> Fixes: 5dd3b8f3af34 ("net/ice: add AVX512 vector path")
>>
>> Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> 
> Squashed into relevant commit in next-net, thanks.
> 
> 
> Andrew, Ali, David,
> 
> Can you please confirm the issue is solved in the next-net/main?

Yes, it solved build issues which I observed.

Andrew.


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

* Re: [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime
  2020-10-27 11:57 ` Ferruh Yigit
  2020-10-27 12:47   ` Andrew Rybchenko
@ 2020-10-27 13:12   ` Ali Alnubani
  2020-10-27 13:27     ` Bruce Richardson
  2020-10-27 13:17   ` David Marchand
  2 siblings, 1 reply; 9+ messages in thread
From: Ali Alnubani @ 2020-10-27 13:12 UTC (permalink / raw)
  To: Ferruh Yigit, Leyi Rong, qi.z.zhang, bruce.richardson,
	wenzhuo.lu, Andrew Rybchenko, David Marchand, Raslan Darawsheh
  Cc: dev

Hi,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Tuesday, October 27, 2020 1:57 PM
> To: Leyi Rong <leyi.rong@intel.com>; qi.z.zhang@intel.com;
> bruce.richardson@intel.com; wenzhuo.lu@intel.com; Ali Alnubani
> <alialnu@nvidia.com>; Andrew Rybchenko <arybchenko@solarflare.com>;
> David Marchand <david.marchand@redhat.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH] net/ice: add AVX512BW flag check both in build and
> runtime
> 
> On 10/27/2020 10:19 AM, Leyi Rong wrote:
> > Intrinsic function __mm512_bsrli_epi128 should be used in the
> > environment which supports AVX512BW, so adds check for this flag.
> >
> > Fixes: 5dd3b8f3af34 ("net/ice: add AVX512 vector path")
> >
> > Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> 
> Squashed into relevant commit in next-net, thanks.
> 
> 
> Andrew, Ali, David,
> 
> Can you please confirm the issue is solved in the next-net/main?
> 

The build failures in CentOS 7, Ubuntu 18.04 and in OpenSUSE Leap 15.2 no longer reproduce. But we just noticed that Ubuntu 16.04.7 (gcc 5.4.0) is also failing with a different error:

"""
drivers/net/ice/ice_rxtx_vec_avx512.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /* SPDX-License-Identifier: BSD-3-Clause
"""
Which is also caused by "net/ice: add AVX512 vector path".

Regards,
Ali

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

* Re: [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime
  2020-10-27 11:57 ` Ferruh Yigit
  2020-10-27 12:47   ` Andrew Rybchenko
  2020-10-27 13:12   ` Ali Alnubani
@ 2020-10-27 13:17   ` David Marchand
  2020-11-02  8:22     ` Ali Alnubani
  2 siblings, 1 reply; 9+ messages in thread
From: David Marchand @ 2020-10-27 13:17 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Leyi Rong, Qi Zhang, Bruce Richardson, Wenzhuo Lu, Ali Alnubani,
	Andrew Rybchenko, dev

On Tue, Oct 27, 2020 at 12:57 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 10/27/2020 10:19 AM, Leyi Rong wrote:
> > Intrinsic function __mm512_bsrli_epi128 should be used in
> > the environment which supports AVX512BW, so adds check for
> > this flag.
> >
> > Fixes: 5dd3b8f3af34 ("net/ice: add AVX512 vector path")
> >
> > Signed-off-by: Leyi Rong <leyi.rong@intel.com>
>
> Squashed into relevant commit in next-net, thanks.
>
>
> Andrew, Ali, David,
>
> Can you please confirm the issue is solved in the next-net/main?

Tree with HEAD at 5e12432f4be4 ("net/ice: fix Rx offload flags in SSE
path") looks good to me.
Thanks.

-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime
  2020-10-27 13:12   ` Ali Alnubani
@ 2020-10-27 13:27     ` Bruce Richardson
  2020-10-27 15:36       ` Rong, Leyi
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Richardson @ 2020-10-27 13:27 UTC (permalink / raw)
  To: Ali Alnubani
  Cc: Ferruh Yigit, Leyi Rong, qi.z.zhang, wenzhuo.lu,
	Andrew Rybchenko, David Marchand, Raslan Darawsheh, dev

On Tue, Oct 27, 2020 at 01:12:20PM +0000, Ali Alnubani wrote:
> Hi,
> 
> > -----Original Message-----
> > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > Sent: Tuesday, October 27, 2020 1:57 PM
> > To: Leyi Rong <leyi.rong@intel.com>; qi.z.zhang@intel.com;
> > bruce.richardson@intel.com; wenzhuo.lu@intel.com; Ali Alnubani
> > <alialnu@nvidia.com>; Andrew Rybchenko <arybchenko@solarflare.com>;
> > David Marchand <david.marchand@redhat.com>
> > Cc: dev@dpdk.org
> > Subject: Re: [PATCH] net/ice: add AVX512BW flag check both in build and
> > runtime
> > 
> > On 10/27/2020 10:19 AM, Leyi Rong wrote:
> > > Intrinsic function __mm512_bsrli_epi128 should be used in the
> > > environment which supports AVX512BW, so adds check for this flag.
> > >
> > > Fixes: 5dd3b8f3af34 ("net/ice: add AVX512 vector path")
> > >
> > > Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> > 
> > Squashed into relevant commit in next-net, thanks.
> > 
> > 
> > Andrew, Ali, David,
> > 
> > Can you please confirm the issue is solved in the next-net/main?
> > 
> 
> The build failures in CentOS 7, Ubuntu 18.04 and in OpenSUSE Leap 15.2 no longer reproduce. But we just noticed that Ubuntu 16.04.7 (gcc 5.4.0) is also failing with a different error:
> 
> """
> drivers/net/ice/ice_rxtx_vec_avx512.c:1:0: error: bad value (skylake-avx512) for -march= switch
>  /* SPDX-License-Identifier: BSD-3-Clause
> """
> Which is also caused by "net/ice: add AVX512 vector path".
> 

I think we can drop the -march=skylake-avx512 flag in the build command for
the avx512 file, since specifying the -mavx512f and -mavx512bw should be
enough. Testing in an ubuntu 16.04 VM (which has 5.5 rather than 5.4
compiler, but should be ok), shows that the avx512 instruction set flags
are recognised and enable the isntructions, which the -march one is not.

/Bruce

bruce@ubuntu-1604-vm:~$ gcc -mavx512f -mavx512bw -dM -E - < /dev/null | grep AVX
#define __AVX512F__ 1
#define __AVX512BW__ 1
#define __AVX__ 1
#define __AVX2__ 1
bruce@ubuntu-1604-vm:~$ gcc -march=skylake-avx512 -dM -E - < /dev/null | grep AVX
cc1: error: bad value (skylake-avx512) for -march= switch


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

* Re: [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime
  2020-10-27 13:27     ` Bruce Richardson
@ 2020-10-27 15:36       ` Rong, Leyi
  2020-10-27 15:57         ` Bruce Richardson
  0 siblings, 1 reply; 9+ messages in thread
From: Rong, Leyi @ 2020-10-27 15:36 UTC (permalink / raw)
  To: Richardson, Bruce, Ali Alnubani
  Cc: Yigit, Ferruh, Zhang, Qi Z, Lu, Wenzhuo, Andrew Rybchenko,
	David Marchand, Raslan Darawsheh, dev


> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, October 27, 2020 9:28 PM
> To: Ali Alnubani <alialnu@nvidia.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Rong, Leyi <leyi.rong@intel.com>;
> Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>;
> Andrew Rybchenko <arybchenko@solarflare.com>; David Marchand
> <david.marchand@redhat.com>; Raslan Darawsheh <rasland@nvidia.com>;
> dev@dpdk.org
> Subject: Re: [PATCH] net/ice: add AVX512BW flag check both in build and
> runtime
> 
> On Tue, Oct 27, 2020 at 01:12:20PM +0000, Ali Alnubani wrote:
> > Hi,
> >
> > > -----Original Message-----
> > > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > > Sent: Tuesday, October 27, 2020 1:57 PM
> > > To: Leyi Rong <leyi.rong@intel.com>; qi.z.zhang@intel.com;
> > > bruce.richardson@intel.com; wenzhuo.lu@intel.com; Ali Alnubani
> > > <alialnu@nvidia.com>; Andrew Rybchenko
> <arybchenko@solarflare.com>;
> > > David Marchand <david.marchand@redhat.com>
> > > Cc: dev@dpdk.org
> > > Subject: Re: [PATCH] net/ice: add AVX512BW flag check both in build
> > > and runtime
> > >
> > > On 10/27/2020 10:19 AM, Leyi Rong wrote:
> > > > Intrinsic function __mm512_bsrli_epi128 should be used in the
> > > > environment which supports AVX512BW, so adds check for this flag.
> > > >
> > > > Fixes: 5dd3b8f3af34 ("net/ice: add AVX512 vector path")
> > > >
> > > > Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> > >
> > > Squashed into relevant commit in next-net, thanks.
> > >
> > >
> > > Andrew, Ali, David,
> > >
> > > Can you please confirm the issue is solved in the next-net/main?
> > >
> >
> > The build failures in CentOS 7, Ubuntu 18.04 and in OpenSUSE Leap 15.2 no
> longer reproduce. But we just noticed that Ubuntu 16.04.7 (gcc 5.4.0) is also
> failing with a different error:
> >
> > """
> > drivers/net/ice/ice_rxtx_vec_avx512.c:1:0: error: bad value
> > (skylake-avx512) for -march= switch
> >  /* SPDX-License-Identifier: BSD-3-Clause """
> > Which is also caused by "net/ice: add AVX512 vector path".
> >
> 
> I think we can drop the -march=skylake-avx512 flag in the build command for
> the avx512 file, since specifying the -mavx512f and -mavx512bw should be
> enough. Testing in an ubuntu 16.04 VM (which has 5.5 rather than 5.4
> compiler, but should be ok), shows that the avx512 instruction set flags are
> recognised and enable the isntructions, which the -march one is not.
> 
> /Bruce
> 
> bruce@ubuntu-1604-vm:~$ gcc -mavx512f -mavx512bw -dM -E - < /dev/null
> | grep AVX #define __AVX512F__ 1 #define __AVX512BW__ 1 #define
> __AVX__ 1 #define __AVX2__ 1 bruce@ubuntu-1604-vm:~$ gcc -
> march=skylake-avx512 -dM -E - < /dev/null | grep AVX
> cc1: error: bad value (skylake-avx512) for -march= switch

Hi Bruce,

Drop -march=skylake-avx512 really impact the throughput performance in my test, although -avx512f and -avx512bw are set meanwhile.
Could we add a judgement before setting -march=skylake-avx512, the judgement can just like 
if (toolchain == 'gcc' and cc.version().version_compare('>=7.0.0'))

Leyi

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

* Re: [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime
  2020-10-27 15:36       ` Rong, Leyi
@ 2020-10-27 15:57         ` Bruce Richardson
  0 siblings, 0 replies; 9+ messages in thread
From: Bruce Richardson @ 2020-10-27 15:57 UTC (permalink / raw)
  To: Rong, Leyi
  Cc: Ali Alnubani, Yigit, Ferruh, Zhang, Qi Z, Lu, Wenzhuo,
	Andrew Rybchenko, David Marchand, Raslan Darawsheh, dev

On Tue, Oct 27, 2020 at 03:36:58PM +0000, Rong, Leyi wrote:
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Tuesday, October 27, 2020 9:28 PM
> > To: Ali Alnubani <alialnu@nvidia.com>
> > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Rong, Leyi <leyi.rong@intel.com>;
> > Zhang, Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>;
> > Andrew Rybchenko <arybchenko@solarflare.com>; David Marchand
> > <david.marchand@redhat.com>; Raslan Darawsheh <rasland@nvidia.com>;
> > dev@dpdk.org
> > Subject: Re: [PATCH] net/ice: add AVX512BW flag check both in build and
> > runtime
> >
> > On Tue, Oct 27, 2020 at 01:12:20PM +0000, Ali Alnubani wrote:
> > > Hi,
> > >
> > > > -----Original Message-----
> > > > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > > > Sent: Tuesday, October 27, 2020 1:57 PM
> > > > To: Leyi Rong <leyi.rong@intel.com>; qi.z.zhang@intel.com;
> > > > bruce.richardson@intel.com; wenzhuo.lu@intel.com; Ali Alnubani
> > > > <alialnu@nvidia.com>; Andrew Rybchenko
> > <arybchenko@solarflare.com>;
> > > > David Marchand <david.marchand@redhat.com>
> > > > Cc: dev@dpdk.org
> > > > Subject: Re: [PATCH] net/ice: add AVX512BW flag check both in build
> > > > and runtime
> > > >
> > > > On 10/27/2020 10:19 AM, Leyi Rong wrote:
> > > > > Intrinsic function __mm512_bsrli_epi128 should be used in the
> > > > > environment which supports AVX512BW, so adds check for this flag.
> > > > >
> > > > > Fixes: 5dd3b8f3af34 ("net/ice: add AVX512 vector path")
> > > > >
> > > > > Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> > > >
> > > > Squashed into relevant commit in next-net, thanks.
> > > >
> > > >
> > > > Andrew, Ali, David,
> > > >
> > > > Can you please confirm the issue is solved in the next-net/main?
> > > >
> > >
> > > The build failures in CentOS 7, Ubuntu 18.04 and in OpenSUSE Leap 15.2 no
> > longer reproduce. But we just noticed that Ubuntu 16.04.7 (gcc 5.4.0) is also
> > failing with a different error:
> > >
> > > """
> > > drivers/net/ice/ice_rxtx_vec_avx512.c:1:0: error: bad value
> > > (skylake-avx512) for -march= switch
> > >  /* SPDX-License-Identifier: BSD-3-Clause """
> > > Which is also caused by "net/ice: add AVX512 vector path".
> > >
> >
> > I think we can drop the -march=skylake-avx512 flag in the build command for
> > the avx512 file, since specifying the -mavx512f and -mavx512bw should be
> > enough. Testing in an ubuntu 16.04 VM (which has 5.5 rather than 5.4
> > compiler, but should be ok), shows that the avx512 instruction set flags are
> > recognised and enable the isntructions, which the -march one is not.
> >
> > /Bruce
> >
> > bruce@ubuntu-1604-vm:~$ gcc -mavx512f -mavx512bw -dM -E - < /dev/null
> > | grep AVX #define __AVX512F__ 1 #define __AVX512BW__ 1 #define
> > __AVX__ 1 #define __AVX2__ 1 bruce@ubuntu-1604-vm:~$ gcc -
> > march=skylake-avx512 -dM -E - < /dev/null | grep AVX
> > cc1: error: bad value (skylake-avx512) for -march= switch
> 
> Hi Bruce,
> 
> Drop -march=skylake-avx512 really impact the throughput performance in my test, although -avx512f and -avx512bw are set meanwhile.

We need to find out why this is, since it really should not matter? We
should be used the instruction set flags to turn on features rather than
relying on a particular CPU architecture. Can you try turning on the other
features present in "skylake-avx512" and see if that makes a difference.
For reference, they are avx512vl, avx512cd and avx512dq.

gcc -march=skylake-avx512 -dM -E - < /dev/null | grep AVX5
#define __AVX512F__ 1
#define __AVX512BW__ 1
#define __AVX512VL__ 1
#define __AVX512CD__ 1
#define __AVX512DQ__ 1


> Could we add a judgement before setting -march=skylake-avx512, the judgement can just like
> if (toolchain == 'gcc' and cc.version().version_compare('>=7.0.0'))
> 

We should never check for a specific compiler. Instead check for the
compiler flag directly.

/Bruce

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

* Re: [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime
  2020-10-27 13:17   ` David Marchand
@ 2020-11-02  8:22     ` Ali Alnubani
  0 siblings, 0 replies; 9+ messages in thread
From: Ali Alnubani @ 2020-11-02  8:22 UTC (permalink / raw)
  To: David Marchand, Ferruh Yigit
  Cc: Leyi Rong, Qi Zhang, Bruce Richardson, Wenzhuo Lu, Andrew Rybchenko, dev

Hi,

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, October 27, 2020 3:17 PM
> To: Ferruh Yigit <ferruh.yigit@intel.com>
> Cc: Leyi Rong <leyi.rong@intel.com>; Qi Zhang <qi.z.zhang@intel.com>;
> Bruce Richardson <bruce.richardson@intel.com>; Wenzhuo Lu
> <wenzhuo.lu@intel.com>; Ali Alnubani <alialnu@nvidia.com>; Andrew
> Rybchenko <arybchenko@solarflare.com>; dev <dev@dpdk.org>
> Subject: Re: [PATCH] net/ice: add AVX512BW flag check both in build and
> runtime
> 
> On Tue, Oct 27, 2020 at 12:57 PM Ferruh Yigit <ferruh.yigit@intel.com>
> wrote:
> >
> > On 10/27/2020 10:19 AM, Leyi Rong wrote:
> > > Intrinsic function __mm512_bsrli_epi128 should be used in the
> > > environment which supports AVX512BW, so adds check for this flag.
> > >
> > > Fixes: 5dd3b8f3af34 ("net/ice: add AVX512 vector path")
> > >
> > > Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> >
> > Squashed into relevant commit in next-net, thanks.
> >
> >
> > Andrew, Ali, David,
> >
> > Can you please confirm the issue is solved in the next-net/main?
> 
> Tree with HEAD at 5e12432f4be4 ("net/ice: fix Rx offload flags in SSE
> path") looks good to me.
> Thanks.
> 
> --
> David Marchand

I can reproduce right now in net/iavf on latest next-net/main "3197a1371 net/octeontx2: avoid per packet barrier with multi segment":
"""
drivers/net/iavf/iavf_rxtx_vec_avx512.c:1:0: error: bad value (skylake-avx512) for -march= switch
 /* SPDX-License-Identifier: BSD-3-Clause
"""

- Ali

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

end of thread, other threads:[~2020-11-02  8:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 10:19 [dpdk-dev] [PATCH] net/ice: add AVX512BW flag check both in build and runtime Leyi Rong
2020-10-27 11:57 ` Ferruh Yigit
2020-10-27 12:47   ` Andrew Rybchenko
2020-10-27 13:12   ` Ali Alnubani
2020-10-27 13:27     ` Bruce Richardson
2020-10-27 15:36       ` Rong, Leyi
2020-10-27 15:57         ` Bruce Richardson
2020-10-27 13:17   ` David Marchand
2020-11-02  8:22     ` Ali Alnubani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).