From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ocardona@microsoft.com>
Received: from NAM01-BY2-obe.outbound.protection.outlook.com
 (mail-eopbgr810091.outbound.protection.outlook.com [40.107.81.91])
 by dpdk.org (Postfix) with ESMTP id 47F9A1B437
 for <dev@dpdk.org>; Tue, 26 Mar 2019 23:50:50 +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=E6ePIliVzhGB8CK2mGhLkGApu7yDBwQGFAy2omiZBlc=;
 b=KV5uBUDNp4ClPm07VwT+BozKa9hkwFnaZ2Pnj9BOzrKYVEgHjvBagz2evMKeWqVkx5mip/X3MPVrT9nPocyeH6RP3pwlv7O0Y3pM/y8Bq7Vjhx/dLN2teiXeJZYFMkdfAta59R+nL5AR1Y2B/lYvFZsZ0/tPGc0dB5m9EX209to=
Received: from DM5PR2101MB0871.namprd21.prod.outlook.com (10.167.110.167) by
 DM5PR2101MB0919.namprd21.prod.outlook.com (52.132.132.164) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.1771.6; Tue, 26 Mar 2019 22:50:48 +0000
Received: from DM5PR2101MB0871.namprd21.prod.outlook.com
 ([fe80::3418:4261:ef8b:d68a]) by DM5PR2101MB0871.namprd21.prod.outlook.com
 ([fe80::3418:4261:ef8b:d68a%3]) with mapi id 15.20.1771.006; Tue, 26 Mar 2019
 22:50:48 +0000
From: Omar Cardona <ocardona@microsoft.com>
To: "dev@dpdk.org" <dev@dpdk.org>
CC: Harini Ramakrishnan <Harini.Ramakrishnan@microsoft.com>,
 "anand.rawat@intel.com" <anand.rawat@intel.com>, "pallavi.kadam@intel.com"
 <pallavi.kadam@intel.com>, "ranjit.menon@intel.com" <ranjit.menon@intel.com>, 
 "jeffrey.b.shaw@intel.com" <jeffrey.b.shaw@intel.com>,
 "bruce.richardson@intel.com" <bruce.richardson@intel.com>,
 "thomas@monjalon.net" <thomas@monjalon.net>
Thread-Topic: [dpdk-dev] [PATCH v5 1/8] eal: eal stub to add windows support
Thread-Index: AQHU45mOozAkwTcCnk6LRN8kNwZV1aYegSSggAAEGYA=
Date: Tue, 26 Mar 2019 22:50:48 +0000
Message-ID: <DM5PR2101MB0871DD905629DB5EAFF77B89DA5F0@DM5PR2101MB0871.namprd21.prod.outlook.com>
References: <20190306041634.12976-1-anand.rawat@intel.com>
 <20190326060238.9884-1-anand.rawat@intel.com>
 <20190326060238.9884-2-anand.rawat@intel.com>
 <MWHPR21MB0638113CDE9F61F8EC3E63D0EF5F0@MWHPR21MB0638.namprd21.prod.outlook.com>
In-Reply-To: <MWHPR21MB0638113CDE9F61F8EC3E63D0EF5F0@MWHPR21MB0638.namprd21.prod.outlook.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-26T22:35:18.4144898Z;
 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=b9ffa69a-37cb-4aad-b591-7af94e04aec1;
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic
x-originating-ip: [2001:4898:80e8:9:9dac:2345:4fa1:8fa2]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 75964618-5df6-4830-9440-08d6b23d7d41
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:DM5PR2101MB0919; 
x-ms-traffictypediagnostic: DM5PR2101MB0919:
x-microsoft-antispam-prvs: <DM5PR2101MB09198CF79C98DFBF9A135641DA5F0@DM5PR2101MB0919.namprd21.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:5236;
x-forefront-prvs: 09888BC01D
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10019020)(346002)(396003)(136003)(39860400002)(376002)(366004)(13464003)(199004)(189003)(93886005)(71200400001)(478600001)(305945005)(71190400001)(7736002)(229853002)(8990500004)(6116002)(74316002)(5660300002)(2501003)(7696005)(99286004)(10290500003)(33656002)(14454004)(316002)(9686003)(55016002)(105586002)(186003)(6246003)(53936002)(6346003)(102836004)(6436002)(22452003)(52536014)(54906003)(25786009)(86612001)(4326008)(86362001)(5640700003)(8936002)(106356001)(1730700003)(81166006)(2906002)(68736007)(6916009)(81156014)(53546011)(76176011)(6506007)(2351001)(11346002)(8676002)(446003)(46003)(476003)(10090500001)(256004)(486006)(97736004);
 DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0919;
 H:DM5PR2101MB0871.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; A:1; MX:1; 
received-spf: None (protection.outlook.com: microsoft.com does not designate
 permitted sender hosts)
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=ocardona@microsoft.com; 
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: NpPZ2eHsECqdfDg5ZQzFlOFCc+0NenecAXaTqwUDKEL6hgxkxaCQQA00yP+R3T2cjWiUmzjkhIOMscSg0BcqWnjQqDIM+jfRqqcQ2EYApJi7sVH6bBH47p1ovLhGTcBwLWSQC3vUXPjovFSM6x/02X4M1ziE3nqhVzNEG/akFcmvx3R7K13EsUVZK4CHU3eggRexT/+leIJX6FKDzjKgQ+kIPoPHjSpM8gqd1LTQPTx0cg4bUa6uENrIoNRUThE/Ap8KSMhVJw5duhgPeKbuATJgfDwvQdSCs1M5fRuLycviN02SdyWa4ZxUZEkC9BPUcUdq4GXtYWrOU52XZXcMT93e5Kn+KAf0boqd1fQiKD02FzdaO6QlFaSAZE7tY0UEXXJgw4zAObudBIqVVFrYP0ns3nq7qYEr5+TEvteFeHc=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 75964618-5df6-4830-9440-08d6b23d7d41
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 22:50:48.1604 (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: DM5PR2101MB0919
Subject: Re: [dpdk-dev] [PATCH v5 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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Mar 2019 22:50:50 -0000

Acked-by: Omar Cardona <ocardona@microsoft.com>

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Anand Rawat
Sent: Monday, March 25, 2019 11:03 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 v5 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 <pallavi.kadam@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 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 ++++++++
 meson.build                             |  3 ++-
 9 files changed, 120 insertions(+), 15 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 0419607d3..71a01=
20b6 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 machine type and cflags for it  if meson.is_cross_build() @@ -52=
,18 +52,27 @@ dpdk_extra_ldflags +=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..13e41ea30
--- /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 "rte_common.h"
+
+ /* 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..6e07fe10c
--- /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 "rte_common.h"
+
+ /* 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..4ddf51aa8
--- /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 "rte_common.h"
+
+ /* 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..e74f8893b
--- /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 <windows.h>
+
+#include "rte_common.h"
+
+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',
+)
diff --git a/meson.build b/meson.build
index 69833de82..9959dc54f 100644
--- a/meson.build
+++ b/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
 project('DPDK', 'C',
 	version: '19.05.0-rc0',
@@ -13,6 +13,7 @@ cc =3D meson.get_compiler('c')  dpdk_conf =3D configurati=
on_data()  dpdk_libraries =3D []  dpdk_static_libraries =3D []
+driver_classes =3D []
 dpdk_drivers =3D []
 dpdk_extra_ldflags =3D []
 dpdk_app_link_libraries =3D []
--
2.17.1.windows.2

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 52BFBA05D3
	for <public@inbox.dpdk.org>; Tue, 26 Mar 2019 23:50:53 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 0ADDA1B440;
	Tue, 26 Mar 2019 23:50:52 +0100 (CET)
Received: from NAM01-BY2-obe.outbound.protection.outlook.com
 (mail-eopbgr810091.outbound.protection.outlook.com [40.107.81.91])
 by dpdk.org (Postfix) with ESMTP id 47F9A1B437
 for <dev@dpdk.org>; Tue, 26 Mar 2019 23:50:50 +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=E6ePIliVzhGB8CK2mGhLkGApu7yDBwQGFAy2omiZBlc=;
 b=KV5uBUDNp4ClPm07VwT+BozKa9hkwFnaZ2Pnj9BOzrKYVEgHjvBagz2evMKeWqVkx5mip/X3MPVrT9nPocyeH6RP3pwlv7O0Y3pM/y8Bq7Vjhx/dLN2teiXeJZYFMkdfAta59R+nL5AR1Y2B/lYvFZsZ0/tPGc0dB5m9EX209to=
Received: from DM5PR2101MB0871.namprd21.prod.outlook.com (10.167.110.167) by
 DM5PR2101MB0919.namprd21.prod.outlook.com (52.132.132.164) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.1771.6; Tue, 26 Mar 2019 22:50:48 +0000
Received: from DM5PR2101MB0871.namprd21.prod.outlook.com
 ([fe80::3418:4261:ef8b:d68a]) by DM5PR2101MB0871.namprd21.prod.outlook.com
 ([fe80::3418:4261:ef8b:d68a%3]) with mapi id 15.20.1771.006; Tue, 26 Mar 2019
 22:50:48 +0000
From: Omar Cardona <ocardona@microsoft.com>
To: "dev@dpdk.org" <dev@dpdk.org>
CC: Harini Ramakrishnan <Harini.Ramakrishnan@microsoft.com>,
 "anand.rawat@intel.com" <anand.rawat@intel.com>, "pallavi.kadam@intel.com"
 <pallavi.kadam@intel.com>, "ranjit.menon@intel.com" <ranjit.menon@intel.com>, 
 "jeffrey.b.shaw@intel.com" <jeffrey.b.shaw@intel.com>,
 "bruce.richardson@intel.com" <bruce.richardson@intel.com>,
 "thomas@monjalon.net" <thomas@monjalon.net>
Thread-Topic: [dpdk-dev] [PATCH v5 1/8] eal: eal stub to add windows support
Thread-Index: AQHU45mOozAkwTcCnk6LRN8kNwZV1aYegSSggAAEGYA=
Date: Tue, 26 Mar 2019 22:50:48 +0000
Message-ID:
 <DM5PR2101MB0871DD905629DB5EAFF77B89DA5F0@DM5PR2101MB0871.namprd21.prod.outlook.com>
References: <20190306041634.12976-1-anand.rawat@intel.com>
 <20190326060238.9884-1-anand.rawat@intel.com>
 <20190326060238.9884-2-anand.rawat@intel.com>
 <MWHPR21MB0638113CDE9F61F8EC3E63D0EF5F0@MWHPR21MB0638.namprd21.prod.outlook.com>
In-Reply-To: <MWHPR21MB0638113CDE9F61F8EC3E63D0EF5F0@MWHPR21MB0638.namprd21.prod.outlook.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-26T22:35:18.4144898Z;
 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=b9ffa69a-37cb-4aad-b591-7af94e04aec1;
 MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic
x-originating-ip: [2001:4898:80e8:9:9dac:2345:4fa1:8fa2]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 75964618-5df6-4830-9440-08d6b23d7d41
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:DM5PR2101MB0919; 
x-ms-traffictypediagnostic: DM5PR2101MB0919:
x-microsoft-antispam-prvs: <DM5PR2101MB09198CF79C98DFBF9A135641DA5F0@DM5PR2101MB0919.namprd21.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:5236;
x-forefront-prvs: 09888BC01D
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10019020)(346002)(396003)(136003)(39860400002)(376002)(366004)(13464003)(199004)(189003)(93886005)(71200400001)(478600001)(305945005)(71190400001)(7736002)(229853002)(8990500004)(6116002)(74316002)(5660300002)(2501003)(7696005)(99286004)(10290500003)(33656002)(14454004)(316002)(9686003)(55016002)(105586002)(186003)(6246003)(53936002)(6346003)(102836004)(6436002)(22452003)(52536014)(54906003)(25786009)(86612001)(4326008)(86362001)(5640700003)(8936002)(106356001)(1730700003)(81166006)(2906002)(68736007)(6916009)(81156014)(53546011)(76176011)(6506007)(2351001)(11346002)(8676002)(446003)(46003)(476003)(10090500001)(256004)(486006)(97736004);
 DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0919;
 H:DM5PR2101MB0871.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; A:1; MX:1; 
received-spf: None (protection.outlook.com: microsoft.com does not designate
 permitted sender hosts)
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=ocardona@microsoft.com; 
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: NpPZ2eHsECqdfDg5ZQzFlOFCc+0NenecAXaTqwUDKEL6hgxkxaCQQA00yP+R3T2cjWiUmzjkhIOMscSg0BcqWnjQqDIM+jfRqqcQ2EYApJi7sVH6bBH47p1ovLhGTcBwLWSQC3vUXPjovFSM6x/02X4M1ziE3nqhVzNEG/akFcmvx3R7K13EsUVZK4CHU3eggRexT/+leIJX6FKDzjKgQ+kIPoPHjSpM8gqd1LTQPTx0cg4bUa6uENrIoNRUThE/Ap8KSMhVJw5duhgPeKbuATJgfDwvQdSCs1M5fRuLycviN02SdyWa4ZxUZEkC9BPUcUdq4GXtYWrOU52XZXcMT93e5Kn+KAf0boqd1fQiKD02FzdaO6QlFaSAZE7tY0UEXXJgw4zAObudBIqVVFrYP0ns3nq7qYEr5+TEvteFeHc=
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: 75964618-5df6-4830-9440-08d6b23d7d41
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 22:50:48.1604 (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: DM5PR2101MB0919
Subject: Re: [dpdk-dev] [PATCH v5 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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190326225048.jyqR9qXP0HhxbqC6bKuGuSthEC3MqW__-YDJCyGiCy8@z>

Acked-by: Omar Cardona <ocardona@microsoft.com>

-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Anand Rawat
Sent: Monday, March 25, 2019 11:03 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 v5 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 <pallavi.kadam@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 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 ++++++++
 meson.build                             |  3 ++-
 9 files changed, 120 insertions(+), 15 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 0419607d3..71a01=
20b6 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 machine type and cflags for it  if meson.is_cross_build() @@ -52=
,18 +52,27 @@ dpdk_extra_ldflags +=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..13e41ea30
--- /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 "rte_common.h"
+
+ /* 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..6e07fe10c
--- /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 "rte_common.h"
+
+ /* 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..4ddf51aa8
--- /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 "rte_common.h"
+
+ /* 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..e74f8893b
--- /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 <windows.h>
+
+#include "rte_common.h"
+
+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',
+)
diff --git a/meson.build b/meson.build
index 69833de82..9959dc54f 100644
--- a/meson.build
+++ b/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
 project('DPDK', 'C',
 	version: '19.05.0-rc0',
@@ -13,6 +13,7 @@ cc =3D meson.get_compiler('c')  dpdk_conf =3D configurati=
on_data()  dpdk_libraries =3D []  dpdk_static_libraries =3D []
+driver_classes =3D []
 dpdk_drivers =3D []
 dpdk_extra_ldflags =3D []
 dpdk_app_link_libraries =3D []
--
2.17.1.windows.2