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 B3A3DA0679 for ; Thu, 28 Mar 2019 20:28:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F2102C19; Thu, 28 Mar 2019 20:28:02 +0100 (CET) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680111.outbound.protection.outlook.com [40.107.68.111]) by dpdk.org (Postfix) with ESMTP id 348EE1DB8 for ; Thu, 28 Mar 2019 20:28:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZfoLbSrOPrfFGCFFyg8SZyU/mfG2wv3pI4x3blK7VEQ=; b=hhnICSsz/VKetT8qp6aI6I6C+eGScWMZjT3i/ZpSJz82W0zX+3XP11LhPbmHIyd9Xccr4wfLKPXm5uNsUe5l2QTp5tXQ4R6xWCZBq7+m9IHoH9AsEy2X98nnCrYBn9pkvvzgTDOrTUSDEog0b6mCl9J//eTppwqgsEfQembv9CQ= ARC-Seal: i=1; a=rsa-sha256; s=testarcselector01; d=microsoft.com; cv=none; b=V3pPFRfthVFX0BZ8YChqAPtkVt9E0A0QzBsc2HTLydwNSiTne4nWdavftG/bgS28ffteDcuKMLbPRHo3Eeb2Qb8O3k/smW8K3MHLthkzXRkmaPIoGJ8uPTBWOOMrTRmidIwB0lP4fqIpe3mKVtiTKMOzOTbMMMNjXXkvwoXJ4Cc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=testarcselector01; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZfoLbSrOPrfFGCFFyg8SZyU/mfG2wv3pI4x3blK7VEQ=; b=VX+wQ3heiB+uxVE3930n7ANjH68qr0gM8L+/8DuIrdqzMhU+AtVgyNnpcaMF0NbLayoHCcjJcChx3PaNIcSXnczM+CwHEQAC2+24AzJzMOF8VTuhDXZZcPwdxatVFB5oHRlu90tJKSU2pxiP5a2iE85P2IdEy0CVF7PWD8TrYjA= ARC-Authentication-Results: =?us-ascii?Q?i=3D1; _test.office365.com_1; =0D=0A=09=09dmarc=3Dnone_action?= =?us-ascii?Q?=3Dnone_header.from=3Dmicrosoft.com;=0D=0A=09=09arc=3Dnone?= Received: from MWHPR21MB0638.namprd21.prod.outlook.com (10.175.141.139) by MWHPR21MB0768.namprd21.prod.outlook.com (10.173.51.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1771.2; Thu, 28 Mar 2019 19:27:57 +0000 Received: from MWHPR21MB0638.namprd21.prod.outlook.com ([fe80::c4e7:ece1:887e:b983]) by MWHPR21MB0638.namprd21.prod.outlook.com ([fe80::c4e7:ece1:887e:b983%3]) with mapi id 15.20.1771.002; Thu, 28 Mar 2019 19:27:57 +0000 From: Harini Ramakrishnan To: Anand Rawat , "dev@dpdk.org" CC: "pallavi.kadam@intel.com" , "ranjit.menon@intel.com" , "jeffrey.b.shaw@intel.com" , "bruce.richardson@intel.com" , "thomas@monjalon.net" Thread-Topic: [dpdk-dev] [PATCH v6 1/8] eal: eal stub to add windows support Thread-Index: AQHU5Qz6GXBbq/W4A0mSJ3O8+XD9f6Yhbm/g Date: Thu, 28 Mar 2019 19:27:57 +0000 Message-ID: References: <20190306041634.12976-1-anand.rawat@intel.com> <20190328022115.4660-1-anand.rawat@intel.com> <20190328022115.4660-2-anand.rawat@intel.com> In-Reply-To: <20190328022115.4660-2-anand.rawat@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=haramakr@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-03-28T19:27:55.4280221Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=8dba8964-6277-4041-b36d-03e3a8e54d01; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic x-originating-ip: [2001:4898:80e8:a:84e2:1334:627:d48e] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b3fd90ec-9aac-445d-86e1-08d6b3b37bce x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:MWHPR21MB0768; x-ms-traffictypediagnostic: MWHPR21MB0768: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Harini.Ramakrishnan@microsoft.com; x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 0990C54589 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(366004)(136003)(396003)(39860400002)(376002)(189003)(199004)(13464003)(6116002)(186003)(25786009)(102836004)(6506007)(256004)(8936002)(68736007)(105586002)(53546011)(4326008)(71190400001)(99286004)(486006)(2906002)(71200400001)(476003)(81166006)(11346002)(446003)(74316002)(46003)(9686003)(33656002)(305945005)(7736002)(8676002)(22452003)(10090500001)(86612001)(54906003)(110136005)(8990500004)(55016002)(316002)(2501003)(81156014)(53936002)(76176011)(7696005)(6436002)(5660300002)(52536014)(10290500003)(72206003)(14454004)(97736004)(229853002)(106356001)(6246003)(86362001)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR21MB0768; H:MWHPR21MB0638.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: iLsC5sd3JG3svvP7G5NAjLi1EJcnZ5Pc2m8SfuKsjpc5DgX8EiFxPt5y8RT+CuDlqWtCjzX4U5KaJS/jkgHoXnnKX2+vfRoooSuhv8h9DM0l/KnDC42BGyK29Hh1igZfr+/1LCuB/ETyAYuj3jFHHxhdztk4ecd+tgdco1OQjRcJLrJ1768mpFb+yTyVtZy+31l7b2wlpDRRVLVpDzwuTg0i81alijV19mu7L1PPxpIxEAODVvHDplQYYA5k7pKGwzyPlUPYGBZTUVoUV62WU9XqndITc5mFZvuvgVz+Kl7XDNppB/au8R/CGkwYTfnGWrdhpeCyuJTfQRJqdazgDvTNLwmtFJmcv8Fuma0kgR5md0mYeTHDGmwmpgz7YW0AWmeTvbhNIjoPxM6KWTo1re5Qs1caoWLjBs3AQaBigOQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3fd90ec-9aac-445d-86e1-08d6b3b37bce X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2019 19:27:57.6103 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0768 Subject: Re: [dpdk-dev] [PATCH v6 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" Message-ID: <20190328192757.qRlLeC_FfqpPLmw3G8Jxym54idkWNFaih4uYH73WUxk@z> Acked-by: Harini Ramakrishnan -----Original Message----- From: dev On Behalf Of Anand Rawat Sent: Wednesday, March 27, 2019 7:21 PM 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 Subject: [dpdk-dev] [PATCH v6 1/8] eal: eal stub to add windows support Added initial stub source files for windows support and only the required m= eson 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/win= dows/eal/eal_thread.c | 18 ++++++++++++++ lib/librte_eal/windows/eal/meson= .build | 10 ++++++++ 8 files changed, 118 insertions(+), 14 deletions(-) create mode 100644 li= b/librte_eal/windows/eal/eal.c create mode 100644 lib/librte_eal/windows/e= al/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..4bd73= b1e9 100644 --- a/config/meson.build +++ b/config/meson.build @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017 Intel Corpora= tion +# Copyright(c) 2017-2019 Intel Corporation =20 # set the major version, which might be used by drivers and libraries # d= epending on the configuration options @@ -80,18 +80,27 @@ dpdk_extra_ldflag= s +=3D '-Wl,--no-as-needed' add_project_link_arguments('-pthread', language: 'c') dpdk_extra_ldflags = +=3D '-pthread' =20 -# some libs depend on maths lib -add_project_link_arguments('-lm', language: 'c') -dpdk_extra_ldflags +=3D = '-lm' +# on some OS, maths functions are in a separate library if=20 +cc.find_library('lm', required : false).found() + # some libs depend on maths lib + add_project_link_arguments('-lm', language: 'c') + dpdk_extra_ldflags +=3D '-lm' +endif =20 # for linux link against dl, for bsd execinfo if host_machine.system() = =3D=3D 'linux' link_lib =3D 'dl' -else +elif host_machine.system() =3D=3D 'freebsd' link_lib =3D 'execinfo' +else + link_lib =3D '' +endif + +# if link_lib is empty, do not add it to project properties if link_lib=20 +!=3D '' + add_project_link_arguments('-l' + link_lib, language: 'c') + dpdk_extra_ldflags +=3D '-l' + link_lib endif -add_project_link_arguments('-l' + link_lib, language: 'c') -dpdk_extra_ldf= lags +=3D '-l' + link_lib =20 # check for libraries used in multiple places in DPDK has_libnuma =3D 0 d= iff --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 Corpora= tion +# Copyright(c) 2017-2019 Intel Corporation =20 # for checking defines we need to use the correct compiler flags march_op= t =3D ['-march=3D@0@'.format(machine)] =20 # get binutils version for the workaround of Bug 97 -ldver =3D run_command= ('ld', '-v').stdout().strip() -if ldver.contains('2.30') - if cc.has_argument('-mno-avx512f') - march_opt +=3D '-mno-avx512f' - message('Binutils 2.30 detected, disabling AVX512 support as workaround = for bug #97') +if host_machine.system() !=3D 'windows' + ldver =3D run_command('ld', '-v').stdout().strip() + if ldver.contains('2.30') + if cc.has_argument('-mno-avx512f') + march_opt +=3D '-mno-avx512f' + message('Binutils 2.30 detected, disabling AVX512 support as workaround= for bug #97') + endif endif endif =20 diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index = c592c6747..c2249855a 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 Corpora= tion +# Copyright(c) 2017-2019 Intel Corporation =20 # Custom EAL processing. EAL is complicated enough that it can't just # h= ave a straight list of headers and source files. @@ -17,6 +17,10 @@ elif host_machine.system() =3D=3D 'freebsd' dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) subdir('freebsd/eal') =20 +elif host_machine.system() =3D=3D '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=20 +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/window= s/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=20 +__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/window= s/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=20 +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=20 +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/windo= ws/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/window= s/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=20 +Corporation + +env_objs =3D [] +env_headers =3D [] +env_sources =3D files('eal.c', + 'eal_debug.c', + 'eal_lcore.c', + 'eal_thread.c', +) -- 2.17.1.windows.2