From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 128B82BD3 for ; Fri, 29 Mar 2019 00:24:54 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 16:24:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,282,1549958400"; d="scan'208";a="311303591" Received: from anandraw-devbx.amr.corp.intel.com ([10.19.242.57]) by orsmga005.jf.intel.com with ESMTP; 28 Mar 2019 16:24:52 -0700 From: Anand Rawat To: dev@dpdk.org Cc: anand.rawat@intel.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, jeffrey.b.shaw@intel.com, bruce.richardson@intel.com, thomas@monjalon.net Date: Thu, 28 Mar 2019 16:24:44 -0700 Message-Id: <20190328232451.16988-2-anand.rawat@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 In-Reply-To: <20190328232451.16988-1-anand.rawat@intel.com> References: <20190306041634.12976-1-anand.rawat@intel.com> <20190328232451.16988-1-anand.rawat@intel.com> Subject: [dpdk-dev] [PATCH v7 1/8] eal: eal stub to add windows support 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: Thu, 28 Mar 2019 23:24:55 -0000 Added initial stub source files for windows support and only the required meson changes for windows. Signed-off-by: Pallavi Kadam Signed-off-by: Anand Rawat Reviewed-by: Jeff Shaw Reviewed-by: Ranjit Menon --- config/meson.build | 23 ++++++++++++------ config/x86/meson.build | 14 ++++++----- lib/librte_eal/meson.build | 6 ++++- lib/librte_eal/windows/eal/eal.c | 14 +++++++++++ lib/librte_eal/windows/eal/eal_debug.c | 15 ++++++++++++ lib/librte_eal/windows/eal/eal_lcore.c | 32 +++++++++++++++++++++++++ lib/librte_eal/windows/eal/eal_thread.c | 18 ++++++++++++++ lib/librte_eal/windows/eal/meson.build | 10 ++++++++ 8 files changed, 118 insertions(+), 14 deletions(-) create mode 100644 lib/librte_eal/windows/eal/eal.c create mode 100644 lib/librte_eal/windows/eal/eal_debug.c create mode 100644 lib/librte_eal/windows/eal/eal_lcore.c create mode 100644 lib/librte_eal/windows/eal/eal_thread.c create mode 100644 lib/librte_eal/windows/eal/meson.build diff --git a/config/meson.build b/config/meson.build index 30a7261a5..4bd73b1e9 100644 --- a/config/meson.build +++ b/config/meson.build @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation +# Copyright(c) 2017-2019 Intel Corporation # set the major version, which might be used by drivers and libraries # depending on the configuration options @@ -80,18 +80,27 @@ dpdk_extra_ldflags += '-Wl,--no-as-needed' add_project_link_arguments('-pthread', language: 'c') dpdk_extra_ldflags += '-pthread' -# some libs depend on maths lib -add_project_link_arguments('-lm', language: 'c') -dpdk_extra_ldflags += '-lm' +# on some OS, maths functions are in a separate library +if cc.find_library('lm', required : false).found() + # some libs depend on maths lib + add_project_link_arguments('-lm', language: 'c') + dpdk_extra_ldflags += '-lm' +endif # for linux link against dl, for bsd execinfo if host_machine.system() == 'linux' link_lib = 'dl' -else +elif host_machine.system() == 'freebsd' link_lib = 'execinfo' +else + link_lib = '' +endif + +# if link_lib is empty, do not add it to project properties +if link_lib != '' + add_project_link_arguments('-l' + link_lib, language: 'c') + dpdk_extra_ldflags += '-l' + link_lib endif -add_project_link_arguments('-l' + link_lib, language: 'c') -dpdk_extra_ldflags += '-l' + link_lib # check for libraries used in multiple places in DPDK has_libnuma = 0 diff --git a/config/x86/meson.build b/config/x86/meson.build index 7504cb9e5..558edfda9 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -1,15 +1,17 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation +# Copyright(c) 2017-2019 Intel Corporation # for checking defines we need to use the correct compiler flags march_opt = ['-march=@0@'.format(machine)] # get binutils version for the workaround of Bug 97 -ldver = run_command('ld', '-v').stdout().strip() -if ldver.contains('2.30') - if cc.has_argument('-mno-avx512f') - march_opt += '-mno-avx512f' - message('Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97') +if host_machine.system() != 'windows' + ldver = run_command('ld', '-v').stdout().strip() + if ldver.contains('2.30') + if cc.has_argument('-mno-avx512f') + march_opt += '-mno-avx512f' + message('Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97') + endif endif endif diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index d48c5e11d..1863622c0 100644 --- a/lib/librte_eal/meson.build +++ b/lib/librte_eal/meson.build @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation +# Copyright(c) 2017-2019 Intel Corporation # Custom EAL processing. EAL is complicated enough that it can't just # have a straight list of headers and source files. @@ -17,6 +17,10 @@ elif host_machine.system() == 'freebsd' dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) subdir('freebsd/eal') +elif host_machine.system() == 'windows' + dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1) + subdir('windows/eal') + else error('unsupported system type "@0@"'.format(host_machine.system())) endif diff --git a/lib/librte_eal/windows/eal/eal.c b/lib/librte_eal/windows/eal/eal.c new file mode 100644 index 000000000..37ed42233 --- /dev/null +++ b/lib/librte_eal/windows/eal/eal.c @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include + + /* Launch threads, called at application init(). */ +int +rte_eal_init(int argc __rte_unused, char **argv __rte_unused) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return 0; +} diff --git a/lib/librte_eal/windows/eal/eal_debug.c b/lib/librte_eal/windows/eal/eal_debug.c new file mode 100644 index 000000000..a9705e257 --- /dev/null +++ b/lib/librte_eal/windows/eal/eal_debug.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include + + /* call abort(), it will generate a coredump if enabled */ +void +__rte_panic(const char *funcname __rte_unused, + const char *format __rte_unused, ...) +{ + /* TODO */ + /* This is a stub, not the expected result */ + abort(); +} diff --git a/lib/librte_eal/windows/eal/eal_lcore.c b/lib/librte_eal/windows/eal/eal_lcore.c new file mode 100644 index 000000000..e4fcb2615 --- /dev/null +++ b/lib/librte_eal/windows/eal/eal_lcore.c @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include + + /* Get the cpu core id value */ +unsigned int +eal_cpu_core_id(unsigned int lcore_id) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return lcore_id; +} + +/* Check if a cpu is present by the presence of the cpu information for it */ +int +eal_cpu_detected(unsigned int lcore_id __rte_unused) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return 1; +} + +/* Get CPU socket id (NUMA node) for a logical core */ +unsigned int +eal_cpu_socket_id(unsigned int cpu_id __rte_unused) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return 0; +} diff --git a/lib/librte_eal/windows/eal/eal_thread.c b/lib/librte_eal/windows/eal/eal_thread.c new file mode 100644 index 000000000..f701443c3 --- /dev/null +++ b/lib/librte_eal/windows/eal/eal_thread.c @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include + +#include + +typedef uintptr_t eal_thread_t; + +/* function to create threads */ +int +eal_thread_create(eal_thread_t *thread __rte_unused) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return 0; +} diff --git a/lib/librte_eal/windows/eal/meson.build b/lib/librte_eal/windows/eal/meson.build new file mode 100644 index 000000000..8b1735623 --- /dev/null +++ b/lib/librte_eal/windows/eal/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019 Intel Corporation + +env_objs = [] +env_headers = [] +env_sources = files('eal.c', + 'eal_debug.c', + 'eal_lcore.c', + 'eal_thread.c', +) -- 2.17.1.windows.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 94C43A0679 for ; Fri, 29 Mar 2019 00:25:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C4D412C19; Fri, 29 Mar 2019 00:24:59 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 128B82BD3 for ; Fri, 29 Mar 2019 00:24:54 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 16:24:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,282,1549958400"; d="scan'208";a="311303591" Received: from anandraw-devbx.amr.corp.intel.com ([10.19.242.57]) by orsmga005.jf.intel.com with ESMTP; 28 Mar 2019 16:24:52 -0700 From: Anand Rawat To: dev@dpdk.org Cc: anand.rawat@intel.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, jeffrey.b.shaw@intel.com, bruce.richardson@intel.com, thomas@monjalon.net Date: Thu, 28 Mar 2019 16:24:44 -0700 Message-Id: <20190328232451.16988-2-anand.rawat@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 In-Reply-To: <20190328232451.16988-1-anand.rawat@intel.com> References: <20190306041634.12976-1-anand.rawat@intel.com> <20190328232451.16988-1-anand.rawat@intel.com> Subject: [dpdk-dev] [PATCH v7 1/8] eal: eal stub to add windows support 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190328232444.Cy9sw86WxA5b9DD_UIzu-wJc0OoUFIHstgxnorGy1DQ@z> Added initial stub source files for windows support and only the required meson changes for windows. Signed-off-by: Pallavi Kadam Signed-off-by: Anand Rawat Reviewed-by: Jeff Shaw Reviewed-by: Ranjit Menon --- config/meson.build | 23 ++++++++++++------ config/x86/meson.build | 14 ++++++----- lib/librte_eal/meson.build | 6 ++++- lib/librte_eal/windows/eal/eal.c | 14 +++++++++++ lib/librte_eal/windows/eal/eal_debug.c | 15 ++++++++++++ lib/librte_eal/windows/eal/eal_lcore.c | 32 +++++++++++++++++++++++++ lib/librte_eal/windows/eal/eal_thread.c | 18 ++++++++++++++ lib/librte_eal/windows/eal/meson.build | 10 ++++++++ 8 files changed, 118 insertions(+), 14 deletions(-) create mode 100644 lib/librte_eal/windows/eal/eal.c create mode 100644 lib/librte_eal/windows/eal/eal_debug.c create mode 100644 lib/librte_eal/windows/eal/eal_lcore.c create mode 100644 lib/librte_eal/windows/eal/eal_thread.c create mode 100644 lib/librte_eal/windows/eal/meson.build diff --git a/config/meson.build b/config/meson.build index 30a7261a5..4bd73b1e9 100644 --- a/config/meson.build +++ b/config/meson.build @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation +# Copyright(c) 2017-2019 Intel Corporation # set the major version, which might be used by drivers and libraries # depending on the configuration options @@ -80,18 +80,27 @@ dpdk_extra_ldflags += '-Wl,--no-as-needed' add_project_link_arguments('-pthread', language: 'c') dpdk_extra_ldflags += '-pthread' -# some libs depend on maths lib -add_project_link_arguments('-lm', language: 'c') -dpdk_extra_ldflags += '-lm' +# on some OS, maths functions are in a separate library +if cc.find_library('lm', required : false).found() + # some libs depend on maths lib + add_project_link_arguments('-lm', language: 'c') + dpdk_extra_ldflags += '-lm' +endif # for linux link against dl, for bsd execinfo if host_machine.system() == 'linux' link_lib = 'dl' -else +elif host_machine.system() == 'freebsd' link_lib = 'execinfo' +else + link_lib = '' +endif + +# if link_lib is empty, do not add it to project properties +if link_lib != '' + add_project_link_arguments('-l' + link_lib, language: 'c') + dpdk_extra_ldflags += '-l' + link_lib endif -add_project_link_arguments('-l' + link_lib, language: 'c') -dpdk_extra_ldflags += '-l' + link_lib # check for libraries used in multiple places in DPDK has_libnuma = 0 diff --git a/config/x86/meson.build b/config/x86/meson.build index 7504cb9e5..558edfda9 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -1,15 +1,17 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation +# Copyright(c) 2017-2019 Intel Corporation # for checking defines we need to use the correct compiler flags march_opt = ['-march=@0@'.format(machine)] # get binutils version for the workaround of Bug 97 -ldver = run_command('ld', '-v').stdout().strip() -if ldver.contains('2.30') - if cc.has_argument('-mno-avx512f') - march_opt += '-mno-avx512f' - message('Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97') +if host_machine.system() != 'windows' + ldver = run_command('ld', '-v').stdout().strip() + if ldver.contains('2.30') + if cc.has_argument('-mno-avx512f') + march_opt += '-mno-avx512f' + message('Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97') + endif endif endif diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index d48c5e11d..1863622c0 100644 --- a/lib/librte_eal/meson.build +++ b/lib/librte_eal/meson.build @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corporation +# Copyright(c) 2017-2019 Intel Corporation # Custom EAL processing. EAL is complicated enough that it can't just # have a straight list of headers and source files. @@ -17,6 +17,10 @@ elif host_machine.system() == 'freebsd' dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) subdir('freebsd/eal') +elif host_machine.system() == 'windows' + dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1) + subdir('windows/eal') + else error('unsupported system type "@0@"'.format(host_machine.system())) endif diff --git a/lib/librte_eal/windows/eal/eal.c b/lib/librte_eal/windows/eal/eal.c new file mode 100644 index 000000000..37ed42233 --- /dev/null +++ b/lib/librte_eal/windows/eal/eal.c @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include + + /* Launch threads, called at application init(). */ +int +rte_eal_init(int argc __rte_unused, char **argv __rte_unused) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return 0; +} diff --git a/lib/librte_eal/windows/eal/eal_debug.c b/lib/librte_eal/windows/eal/eal_debug.c new file mode 100644 index 000000000..a9705e257 --- /dev/null +++ b/lib/librte_eal/windows/eal/eal_debug.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include + + /* call abort(), it will generate a coredump if enabled */ +void +__rte_panic(const char *funcname __rte_unused, + const char *format __rte_unused, ...) +{ + /* TODO */ + /* This is a stub, not the expected result */ + abort(); +} diff --git a/lib/librte_eal/windows/eal/eal_lcore.c b/lib/librte_eal/windows/eal/eal_lcore.c new file mode 100644 index 000000000..e4fcb2615 --- /dev/null +++ b/lib/librte_eal/windows/eal/eal_lcore.c @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include + + /* Get the cpu core id value */ +unsigned int +eal_cpu_core_id(unsigned int lcore_id) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return lcore_id; +} + +/* Check if a cpu is present by the presence of the cpu information for it */ +int +eal_cpu_detected(unsigned int lcore_id __rte_unused) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return 1; +} + +/* Get CPU socket id (NUMA node) for a logical core */ +unsigned int +eal_cpu_socket_id(unsigned int cpu_id __rte_unused) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return 0; +} diff --git a/lib/librte_eal/windows/eal/eal_thread.c b/lib/librte_eal/windows/eal/eal_thread.c new file mode 100644 index 000000000..f701443c3 --- /dev/null +++ b/lib/librte_eal/windows/eal/eal_thread.c @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#include + +#include + +typedef uintptr_t eal_thread_t; + +/* function to create threads */ +int +eal_thread_create(eal_thread_t *thread __rte_unused) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return 0; +} diff --git a/lib/librte_eal/windows/eal/meson.build b/lib/librte_eal/windows/eal/meson.build new file mode 100644 index 000000000..8b1735623 --- /dev/null +++ b/lib/librte_eal/windows/eal/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019 Intel Corporation + +env_objs = [] +env_headers = [] +env_sources = files('eal.c', + 'eal_debug.c', + 'eal_lcore.c', + 'eal_thread.c', +) -- 2.17.1.windows.2