From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 39135378B for ; Mon, 4 Sep 2017 04:20:57 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 03 Sep 2017 19:20:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,473,1498546800"; d="scan'208";a="1191201812" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 03 Sep 2017 19:20:56 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 3 Sep 2017 19:20:56 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 3 Sep 2017 19:20:55 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.168]) by shsmsx102.ccr.corp.intel.com ([169.254.2.39]) with mapi id 14.03.0319.002; Mon, 4 Sep 2017 10:20:52 +0800 From: "Li, Xiaoyun" To: "O Mahony, Billy" , "dev@dpdk.org" CC: "stephen@networkplumber.org" , "Lu, Wenzhuo" , "Wang, Zhihong" , "Zhang, Qi Z" , "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH 1/3] eal/x86: run-time dispatch over Thread-Index: AdMjEHcRIwiTdXbRTda0ZvQPpJR8HgCEJ6tw Date: Mon, 4 Sep 2017 02:20:52 +0000 Message-ID: References: <03135AEA779D444E90975C2703F148DC58C1741C@IRSMSX107.ger.corp.intel.com> In-Reply-To: <03135AEA779D444E90975C2703F148DC58C1741C@IRSMSX107.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWNmMDRmMzYtOTMwNy00N2JlLWIxMTgtNDZhN2I4OTlhMzE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlN0QnpzRlwvRGN4eGZRZ3JGZVFHcDdZbEpocWlcL1drYk9iSmZXXC9icU1yaDA9In0= x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/3] eal/x86: run-time dispatch over X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 02:20:58 -0000 I've skimmed the bug. It seems that it has problems to call the implementat= ion codes and only call the resolver codes. But in fact, I only use FMV to avoid compilation issues (example: AVX512 ar= en't support if doesn't have compilation option -mavx512). I just add the attribution such as " __attribute__((target("avx512f")))" to= each function to enable the function pass the compilation. I didn't use the ifunc as the attribution. I tried -O0, it works well. Best Regards, Xiaoyun Li -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O Mahony, Billy Sent: Friday, September 1, 2017 18:55 To: dev@dpdk.org Cc: stephen@networkplumber.org; Lu, Wenzhuo ; Wang, Z= hihong ; Zhang, Qi Z ; Richar= dson, Bruce Subject: Re: [dpdk-dev] [PATCH 1/3] eal/x86: run-time dispatch over Hi, FYI, Just to note a bug I found when using FMV with -O flag: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D81128 I see the fix is on the trunk now but not sure if it's been back ported to = other point releases so dev's might need to be careful about which gcc vers= ions they use and be aware that compiler support in the wild could be an is= sue. The only version marked 'Known to work' on the bug ticket is 8.0. Apologies if this does not get added to the correct thread - I don't subsc= ribe to this dev list so I didn't have the original email to reply to. Regards, Billy. > -------- Forwarded Message -------- > Subject: Re: [dpdk-dev] [PATCH 1/3] eal/x86: run-time dispatch over > memcpy > Date: Thu, 31 Aug 2017 05:24:25 +0000 > From: Li, Xiaoyun > > To: Stephen Hemminger=20 > >, Lu,=20 > Wenzhuo > > > CC: Wang, Zhihong=20 > >,=20 > dev@dpdk.org > >, Zhang, Qi Z=20 > >, Richardson, Bruce > > > > About gcc FMV, I tried it several days ago. > But the way that the same function name with different attributions > only works in C++. > And then I tried GCC6 since it is said that GCC6 would support both C > and > C++. > But it doesn't work. > > However, if using different function names with attributions, it works. > And the function with attribution AVX512 means this function would be > compiled via AVX512. > So I add attribution for each function and delete -mavx512 in makefile. > But I haven't sent the patch. > Because there are some compilation issues. > > Before, only if both compiler and cpu support AVX512 and users want, > the > AVX512 codes would be compiled since the macro > RTE_MACHINE_CPUFLAG_AVX512. > Now, we hope to compiler them all and choose one at runtime based on cpu. > But only above gcc4.9 and newest clang would support AVX512. > So I am thinking adding a macro switch in mk which will determine > whether the compiler supports AVX512 and whether users hope to use 512. > (don't need cpu support because it will be determined at run-time) > Only if the compiler supports AVX512 and users hope to use 512, the > 512 codes would be compiled. > > > Best Regards, > Xiaoyun Li > > > > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Thursday, August 31, 2017 13:06 > To: Lu, Wenzhuo > > Cc: Wang, Zhihong=20 > >;=20 > dev@dpdk.org; Zhang, Qi Z > >; Li, Xiaoyun=20 > >; > Richardson, Bruce=20 > > > Subject: RE: [dpdk-dev] [PATCH 1/3] eal/x86: run-time dispatch over > memcpy > > I was referring to gcc multiversion > > https://gcc.gnu.org/wiki/FunctionMultiVersioning > > > On Aug 30, 2017 6:24 PM, "Lu, Wenzhuo" > >> wrote: > Hi Stephen, > > > > -----Original Message----- > > From: Stephen Hemminger > > > [mailto:stephen@networkplumber.org rg>] > > Sent: Thursday, August 31, 2017 2:01 AM > > To: Li, Xiaoyun=20 > > > intel.com%3cmailto:xiaoyun.li@intel.com>>> > > Cc: Richardson, Bruce > > > :bruce.richardson@intel.com%3cmailto:bruce.richardson@intel.com>>>; > > dev@dpdk.org > dk.org>>; Lu, Wenzhuo > > > intel.com%3cmailto:wenzhuo.lu@intel.com>>>; Wang, Zhihong > > > .wang@intel.com%3cmailto:zhihong.wang@intel.com>>>; Zhang, Qi Z > > > intel.com%3cmailto:qi.z.zhang@intel.com>>> > > Subject: Re: [dpdk-dev] [PATCH 1/3] eal/x86: run-time dispatch over > > memcpy > > > > On Fri, 25 Aug 2017 10:06:11 +0800 > > Xiaoyun Li >> wrote: > > > > > This patch dynamically selects functions of memcpy at run-time > > > based on CPU flags that current machine supports. This patch uses > > > function pointers which are bind to the relative functions at constrc= tor time. > > > To make AVX512 instructions pass compilation, enable the switch in > > > makefile. > > > > > > Signed-off-by: Xiaoyun Li > > > > > i@intel.com%3cmailto:xiaoyun.li@intel.com>>> > > > > Recent versions of GCC also have better ways to handle this. > I think the assumption of using the instructions is that we believe we > can do better than the compiler. If it turns out not, maybe we need to=20 > change the instructions back to C. But it's another stor