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 BE65EA04B3; Wed, 29 Jan 2020 00:34:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C453D1C2A9; Wed, 29 Jan 2020 00:34:03 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 4F1BB1C29D for ; Wed, 29 Jan 2020 00:34:02 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jan 2020 15:34:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,375,1574150400"; d="scan'208,217";a="217781121" Received: from unknown (HELO [10.241.225.137]) ([10.241.225.137]) by orsmga007.jf.intel.com with ESMTP; 28 Jan 2020 15:34:01 -0800 To: Thomas Monjalon Cc: dev@dpdk.org, Harini.Ramakrishnan@microsoft.com, keith.wiles@intel.com, bruce.richardson@intel.com, david.marchand@redhat.com, jerinjacobk@gmail.com, ranjit.menon@intel.com, antara.ganesh.kolar@intel.com, stephen@networkplumber.org References: <20200109031312.6344-1-pallavi.kadam@intel.com> <20200113215534.10084-1-pallavi.kadam@intel.com> <20200113215534.10084-4-pallavi.kadam@intel.com> <1736661.tdWV9SEqCh@xps> From: Pallavi Kadam Message-ID: Date: Tue, 28 Jan 2020 15:34:01 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <1736661.tdWV9SEqCh@xps> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v5 3/9] eal: add windows compatible header files 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 1/27/2020 2:41 PM, Thomas Monjalon wrote: > 13/01/2020 22:55, Pallavi Kadam: >> Modified \common\include\arch\x86\rte_vect.h >> to include SSE4 header for Windows. >> >> Adding dlfcn.h on Windows to support common code. >> >> Adding eal_filesystem.h to support functions and >> path defines for files and directories on Windows. > I don't see any relationship between these 3 items, > so I think they should be 3 separate patches. Ok, will submit 3 separate patches in v6. > >> --- a/lib/librte_eal/common/include/arch/x86/rte_vect.h >> +++ b/lib/librte_eal/common/include/arch/x86/rte_vect.h >> @@ -15,7 +15,9 @@ >> #include >> #include "generic/rte_vect.h" >> >> -#if (defined(__ICC) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) >> +#if (defined(__ICC) || \ >> + (defined(_WIN64)) || \ >> + (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) >> >> #include /* SSE4 */ > I trust you on this change :) > >> --- /dev/null >> +++ b/lib/librte_eal/windows/eal/include/dlfcn.h >> @@ -0,0 +1,21 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2019 Intel Corporation >> + */ >> + >> +#ifndef _DLFCN_H_ >> +#define _DLFCN_H_ >> + >> +/** >> + * This file is added to support common code in eal_common_options.c >> + * as Microsoft libc does not contain dlfcn.h. This may be removed >> + * in future releases. >> + */ >> + >> +/* The windows port does not currently support dynamic loading of libraries, >> + * so fail these calls >> + */ >> +#define dlopen(lib, flag) (0) >> +#define RTLD_NOW 0 >> +#define dlerror() ("Not supported!") > This is only for the function eal_plugins_init(). > The plugin logic and directory search might be different on Windows. > I believe it would be better handled directly in eal_plugins_init(). > For now, my advice is to not compile this function (and not call it > in Windows init of course): > > int > eal_plugins_init(void) > { > #ifndef RTE_EXEC_ENV_WINDOWS > > The right fix would be to move this "common" function in an UNIX-only file: > What about creating eal_unix_options.c file? > Could be in lib/librte_eal/unix/ directory? Ok. For now will include #ifndef RTE_EXEC_ENV_WINDOWSin v6 and will start working on this new 'unix' directory to add all unix based functions. > > >> --- /dev/null >> +++ b/lib/librte_eal/windows/eal/include/eal_filesystem.h >> @@ -0,0 +1,99 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright(c) 2019 Intel Corporation >> + */ >> + >> +/** >> + * @file >> + * Stores functions and path defines for files and directories >> + * on the filesystem for Windows, that are used by the Windows EAL. >> + */ > [...] >> +/** Function to read a single numeric value from a file on the filesystem. >> + * Used to read information from files on /sys >> + */ >> +int eal_parse_sysfs_value(const char *filename, unsigned long *val); > Given that sysfs is a Linux system, I guess you don't need this function at all. Thanks, will remove this function in v6. > >