From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D96BA09E9; Wed, 9 Dec 2020 01:09:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7D352C8FA; Wed, 9 Dec 2020 01:09:54 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id ED623C8F8 for ; Wed, 9 Dec 2020 01:09:51 +0100 (CET) IronPort-SDR: Ynh/a+JwweOEf7XVNt6Ncg/cvkxj623H/wsDK5bd3rBajlr3+AfBQsLuTFUz/7eq0vim1Nn10m xl6uH+xxjUhg== X-IronPort-AV: E=McAfee;i="6000,8403,9829"; a="192291369" X-IronPort-AV: E=Sophos;i="5.78,404,1599548400"; d="scan'208,217";a="192291369" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2020 16:09:44 -0800 IronPort-SDR: DLT/uc/o4SgE8uOWlW33ejYgPfH81xiqTGK6fRnLTKmlf92HcA+XMcbzumtwvgimYfVhG+c5hz Pkq/EQMOV6Mw== X-IronPort-AV: E=Sophos;i="5.78,404,1599548400"; d="scan'208,217";a="370588331" Received: from pkadam-mobl1.amr.corp.intel.com (HELO [10.209.7.12]) ([10.209.7.12]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2020 16:09:43 -0800 To: Dmitry Kozlyuk Cc: dev@dpdk.org, thomas@monjalon.net, ranjit.menon@intel.com, Narcisa.Vasile@microsoft.com, talshn@nvidia.com, ferruh.yigit@intel.com, beilei.xing@intel.com, jia.guo@intel.com References: <20201205011020.6276-1-pallavi.kadam@intel.com> <20201205011020.6276-3-pallavi.kadam@intel.com> <20201205165204.10e30d17@sovereign> From: "Kadam, Pallavi" Message-ID: <6417c836-8b8a-7f1d-d71f-fa7a7c655943@intel.com> Date: Tue, 8 Dec 2020 16:09:42 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201205165204.10e30d17@sovereign> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 2/3] net/i40e: add changes to support i40e PMD on windows 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 12/5/2020 5:52 AM, Dmitry Kozlyuk wrote: > On Fri, 4 Dec 2020 17:10:19 -0800, Pallavi Kadam wrote: > > You could drop "add changes" and "i40e PMD" from subject line, as any commit > changes something and topic is "net/i40e" already. > >> Adding build changes to compile i40e PMD on windows. > This is redundant given the commit subject. > Please use present simple tense for changes description (this applies to > sibling patches). Ok, I'll update the title and description in v2. > >> Disabling few warnings with Clang such as comparison of integers of >> different signs and macro redefinitions. >> Also, adding linking dependency source file rte_random.c file to >> Windows. >> >> Signed-off-by: Pallavi Kadam >> Reviewed-by: Ranjit Menon >> --- >> drivers/net/i40e/base/i40e_osdep.h | 3 +++ >> drivers/net/i40e/i40e_ethdev_vf.c | 3 ++- >> drivers/net/i40e/i40e_rxtx_vec_avx2.c | 2 ++ >> drivers/net/i40e/i40e_tm.c | 2 +- >> drivers/net/meson.build | 9 ++++++--- >> lib/librte_eal/common/meson.build | 1 + >> lib/librte_eal/rte_eal_exports.def | 1 + >> lib/librte_eal/windows/include/rte_windows.h | 5 +++++ >> 8 files changed, 21 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h >> index 9b5033024..fa22df122 100644 >> --- a/drivers/net/i40e/base/i40e_osdep.h >> +++ b/drivers/net/i40e/base/i40e_osdep.h >> @@ -67,8 +67,11 @@ typedef enum i40e_status_code i40e_status; >> #define false 0 >> #define true 1 >> >> +/* Avoid macro redifinition warning on Windows */ >> +#ifndef RTE_EXEC_ENV_WINDOWS >> #define min(a,b) RTE_MIN(a,b) >> #define max(a,b) RTE_MAX(a,b) >> +#endif > Windows min() and max() macros evaluate arguments twice [1], which can be > unacceptable in driver code if used with MMIO. Better #undef min and max > first, then let PMD define them. > > It seems we'll have to do that for many PMDs, because rte_os.h must not erase > platform-specific macros, and rte_windows.h is not for generic PMDs. > > [1]: https://docs.microsoft.com/en-us/windows/win32/multimedia/max Thanks for the suggestion. Will first #undef min and max in the same file in v2. > >> diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c >> index 7a558fc73..cf2dc88c5 100644 >> --- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c >> +++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c >> @@ -12,7 +12,9 @@ >> #include "i40e_rxtx.h" >> #include "i40e_rxtx_vec_common.h" >> >> +#ifndef RTE_EXEC_ENV_WINDOWS >> #include >> +#endif > Just #include , it takes care of x86intrin.h for Windows. Ok, will  #include instead. > >> diff --git a/lib/librte_eal/windows/include/rte_windows.h b/lib/librte_eal/windows/include/rte_windows.h >> index b82af34f6..822922c11 100644 >> --- a/lib/librte_eal/windows/include/rte_windows.h >> +++ b/lib/librte_eal/windows/include/rte_windows.h >> @@ -18,6 +18,11 @@ >> #define WIN32_LEAN_AND_MEAN >> #endif >> >> +#ifdef __clang__ >> +#undef _m_prefetchw >> +#define _m_prefetchw __m_prefetchw >> +#endif >> + > Please explain in the commit message which problem this solves. Sure, will explain it in v2. > Can't x86intrin.h be replaced by rte_vect.h in rte_random.c? Please correct if I am wrong. Here, cause of an error is indirectly due to rte_windows.h and not because of #include Please see below error: FAILED: lib/76b5a35@@rte_eal@sta/librte_eal_common_rte_random.c.obj clang @lib/76b5a35@@rte_eal@sta/librte_eal_common_rte_random.c.obj.rsp In file included from ../lib/librte_eal/common/rte_random.c:13: In file included from ..\lib/librte_eal/include\rte_eal.h:20: In file included from ..\lib/librte_eal/include\rte_per_lcore.h:25: In file included from ..\lib/librte_eal/windows/include\pthread.h:21: In file included from ..\lib/librte_eal/windows/include\rte_windows.h:27: In file included from C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\windows.h:171: In file included from C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\windef.h:24: In file included from C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\minwindef.h:182: C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h:3324:1: error: conflicting types for '_m_prefetchw' _m_prefetchw ( ^ C:\Program Files\LLVM\lib\clang\10.0.0\include\prfchwintrin.h:50:1: note: previous definition is here _m_prefetchw(void *__P) ^ 1 error generated. > If it's still necessary, __clang__ should be RTE_TOOLCHAIN_CLANG. will update this in v2. Thank you.