From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga07.intel.com (mga07.intel.com [134.134.136.100])
 by dpdk.org (Postfix) with ESMTP id 0BEE11B6FF
 for <dev@dpdk.org>; Wed,  9 May 2018 17:37:21 +0200 (CEST)
X-Amp-Result: UNSCANNABLE
X-Amp-File-Uploaded: False
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 09 May 2018 08:37:20 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.49,382,1520924400"; d="scan'208";a="47939245"
Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.55])
 by FMSMGA003.fm.intel.com with SMTP; 09 May 2018 08:37:16 -0700
Received: by  (sSMTP sendmail emulation); Wed, 09 May 2018 16:37:13 +0100
Date: Wed, 9 May 2018 16:37:12 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: "Zhang, Tianfei" <tianfei.zhang@intel.com>
Cc: Thomas Monjalon <thomas@monjalon.net>, "Xu, Rosen" <rosen.xu@intel.com>,
 "dev@dpdk.org" <dev@dpdk.org>, "Zhang, Roy Fan" <roy.fan.zhang@intel.com>,
 "Doherty, Declan" <declan.doherty@intel.com>,
 "shreyansh.jain@nxp.com" <shreyansh.jain@nxp.com>,
 "Yigit, Ferruh" <ferruh.yigit@intel.com>,
 "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
 "Liu, Song" <song.liu@intel.com>, "Wu, Hao" <hao.wu@intel.com>,
 "gaetan.rivet@6wind.com" <gaetan.rivet@6wind.com>,
 "Wu, Yanglong" <yanglong.wu@intel.com>
Message-ID: <20180509153712.GA19692@bricha3-MOBL.ger.corp.intel.com>
References: <1521553556-62982-1-git-send-email-rosen.xu@intel.com>
 <1525851801-16101-1-git-send-email-rosen.xu@intel.com>
 <1525851801-16101-4-git-send-email-rosen.xu@intel.com>
 <2225742.ccNGmmKHOr@xps>
 <BA6F50564D52C24884F9840E07E32DEC4DD78BE6@CDSMSX104.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BA6F50564D52C24884F9840E07E32DEC4DD78BE6@CDSMSX104.ccr.corp.intel.com>
Organization: Intel Research and Development Ireland Ltd.
User-Agent: Mutt/1.9.4 (2018-02-28)
Subject: Re: [dpdk-dev] [PATCH v10 3/3] iFPGA: Add Intel FPGA BUS Rawdev
 Driver
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 09 May 2018 15:37:23 -0000

On Wed, May 09, 2018 at 04:33:45PM +0100, Zhang, Tianfei wrote:
> 
> 
> > -----Original Message-----
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > Sent: Wednesday, May 9, 2018 10:47 PM
> > To: Xu, Rosen <rosen.xu@intel.com>
> > Cc: dev@dpdk.org; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Doherty,
> > Declan <declan.doherty@intel.com>; Richardson, Bruce
> > <bruce.richardson@intel.com>; shreyansh.jain@nxp.com; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; Zhang, Tianfei <tianfei.zhang@intel.com>;
> > Liu, Song <song.liu@intel.com>; Wu, Hao <hao.wu@intel.com>;
> > gaetan.rivet@6wind.com; Wu, Yanglong <yanglong.wu@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH v10 3/3] iFPGA: Add Intel FPGA BUS Rawdev
> > Driver
> > 
> > 09/05/2018 09:43, Xu, Rosen:
> > > From: Rosen Xu <rosen.xu@intel.com>
> > >
> > > Add Intel FPGA BUS Rawdev Driver which is based on librte_rawdev
> > > library.
> > >
> > > Signed-off-by: Rosen Xu <rosen.xu@intel.com>
> > > Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> > > Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
> > > Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> > 
> > I have a compilation error:
> > 	drivers/raw/ifpga_rawdev/base/ifpga_fme_pr.c:10:15: error:
> > 	instruction requires: AVX-512 ISA
> > 
> > because of vmovdqu64:
> > 
> > #if defined(RTE_ARCH_X86_64)
> > static inline void copy512(const void *src, void *dst) {
> >     asm volatile("vmovdqu64 (%0), %%zmm0;"
> >              "vmovntdq %%zmm0, (%1);"
> >              :
> >              : "r"(src), "r"(dst));
> > }
> > #else
> > static inline void copy512(const void *src, void *dst) {
> >     UNUSED(src);
> >     UNUSED(dst);
> >     WARN_ON(1);
> > }
> > #endif
> > 
> > I suggest to fix it quickly without waiting a v11 with this:
> > 
> > static inline void copy512(const void *src, void *dst) { #ifdef
> > CC_SUPPORT_AVX512F
> >     asm volatile("vmovdqu64 (%0), %%zmm0;"
> >              "vmovntdq %%zmm0, (%1);"
> >              :
> >              : "r"(src), "r"(dst));
> > #else
> >     UNUSED(src);
> >     UNUSED(dst);
> >     WARN_ON(1);
> > #endif
> > }
> > 
> > It does not make any runtime detection, but it's better than previously.
> > 
> 
> Which linux distribution are you use? We can compile it on Ubuntu 16.04 and RHEL 7.4.
> We will fix it on V11.
> 

This shows up with meson builds for non-avx-512 architectures using clang.
The makefile has the following snippet that doesn't have an equivalent in
the meson.build file.

 26 ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)$
 27 >-------CFLAGS_ifpga_fme_pr.o += -march=knl$
 28 endif$

However, it does also bring up the questions as to the unconditional use of
AVX-512 code? What happens if this code is run on a system without AVX-512
support?

Regards,
/Bruce