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 2FCA6A0530; Mon, 3 Feb 2020 19:19:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7C8764C74; Mon, 3 Feb 2020 19:19:03 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 1388E1BFB2 for ; Mon, 3 Feb 2020 19:19:01 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2020 10:19:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,398,1574150400"; d="scan'208,217";a="431249110" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by fmsmga006.fm.intel.com with ESMTP; 03 Feb 2020 10:19:00 -0800 Received: from orsmsx157.amr.corp.intel.com (10.22.240.23) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 3 Feb 2020 10:19:00 -0800 Received: from orsmsx112.amr.corp.intel.com ([169.254.3.36]) by ORSMSX157.amr.corp.intel.com ([169.254.9.76]) with mapi id 14.03.0439.000; Mon, 3 Feb 2020 10:19:00 -0800 From: "Menon, Ranjit" To: Stephen Hemminger , Dmitry Kozliuk , "dev@dpdk.org" CC: Thomas Monjalon , "Kadam, Pallavi" , "Burakov, Anatoly" , Harini Ramakrishnan Thread-Topic: [EXTERNAL] Windows Support Plan Thread-Index: AQHV2gi1zpz0hp3jdECubTdGSf0da6gJtyOAgAAQ5dA= Date: Mon, 3 Feb 2020 18:18:59 +0000 Message-ID: <7603DC8746F9FC4D82EF0929C467267A737C5A1E@ORSMSX112.amr.corp.intel.com> References: <20200202233736.74bdf47f@Sovereign> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWI1YjhiZDgtZThmMi00Y2M0LWE0YTMtZjI4YzZmMTRkOTk1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYzFHZjdveUFHcXREbXdMV2NhcWlDTTlxdlM4WXp4TGR5Z0c2aVE2S2xWYllDY05qazg0S0tpTVgybkpFbU9BRCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action 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_SetDate=2020-02-03T09:12:52.5385472Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [EXTERNAL] Windows Support Plan 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" Dmitry... There is a DPDK Windows community meeting every second Wednesday at 8:00am = (Pacific Time). If this time works for you, we can have Harini add you to this meeting seri= es. thanks, ranjit m. From: Stephen Hemminger Sent: Monday, February 3, 2020 1:16 AM To: Dmitry Kozliuk ; dev@dpdk.org Cc: Thomas Monjalon ; Kadam, Pallavi ; Burakov, Anatoly ; Menon, Ranjit ; Harini Ramakrishnan Subject: Re: [EXTERNAL] Windows Support Plan You should talk to the Windows DPDK developers. They have been presenting regularly at dpdk summits. Look up videos for mor= e info. The initial port is focused on running DPDK on bare metal with Intel NIC. Y= our version looks more aligned with Windows as guest in KVM. Get Outlook for Android ________________________________ From: Dmitry Kozliuk > Sent: Sunday, February 2, 2020 9:37:36 PM To: dev@dpdk.org > Cc: Thomas Monjalon >; Pall= avi Kadam >; Anatol= y Burakov >; Ra= njit Menon >; Harini = Ramakrishnan >; Stephen Hemminger > Subject: [EXTERNAL] Windows Support Plan Hi everyone! Where do I find a high-level plan of comprehensive Windows support: design decisions, implementation order, etc? Information on the subject is very scarce, one may think it is abandoned. Googling for "site:dpdk.org/ml/archives/dev/ windows" yields only two pages of disjoint messages. I learned about "netuio" days ago from a tiny remark = in a "Minutes of Technical Board Meetings" email, and even then it took enumerating "dpdk-next-windows" branches to find the source. The matter is, as a New Year's holiday project of mine I implemented Window= s support from scratch to the point it runs in QEMU with virtio-pci [0]. It i= s not of production quality, cuts some corners and lacks major features (see bottom). My primary goal was fun^W making it work. Comparing it to "windpdk-v18.08" branch of "dpdk-next-windows", I can see that 1) our implementations take rather different approaches in some cases, and 2) both have severe issues and would benefit from amalgamation. I'd like to contribute to Windows support with this code, but to do so, coordination is required, because changes are significant. Primary topics to discuss: 1. Memory management (@Anatoly) 1.1. MM changed radically since v18.08 and dpdk-next-windows does not implement it properly anyway, it allocates segment lists in a PCI b= us driver. My implementation closely follows the Linux one using VirtualAlloc2() with XXX_PLACEHOLDER flags to reserve and commit memory, but does not map hugepages to files. Is there a consensus on MM approach in Windows? Anyway, I think EAL private MM API would have to be changed, because memory reservation, allocation, and mapping are completely different operations. Hiding this with an mmap() shim doesn't look right, because mmap()'s behavior differs even among Unix platforms. 1.2. In Windows, there is no /dev/mem to implement rte_virt2iova(), so a simple kernel driver is required for mapping. Moreover, Windows kernel abstracts IOMMU, so those physical addresses may be unsuitable for DMA at all (see below). 2. Kernel drivers (@Harini, @Stephen) 2.1. The most serious issue is that Windows formally prohibits using arbitrary physical addresses with DMA in favor of allocating special buffers (presumably because IOMMU may be engaged, and there is no way to check). We can either live with it (technically, everything works with PA mode), or we could revive DMA allocation API from ethdev to ask the driver for a proper DMA buffer. 2.2. Neither netuio, nor my driver (userpci) support interrupts. I see not inherent difficulty here, but interface should be designed carefully. 2.3. Windows allows mapping I/O ports into user-space, but there is no API to change IOPL, which makes mapping useless and requires a syscall for every I/O port access. This demolishes virtio-legacy performance. Perhaps Microsoft could give some advice here. OTOH, PIO is all legacy, so might be much effort is not justified. 2.4. I believe GUIDs approach for identifying compatible devices should be strictly preferred, and not DosDevices symlinks. Think of Mellanox OFED on Linux, which uses a different driver, but could provide a compatible interface. Another reason is that a single driver can implement multiple kernel interfaces with appropriate GUIDs. 2.5. DPDK Windows driver guidelines, driver review, and certification. The quality of both netuio and userpci is below standards now (e. g. netuio does not mind its context when mapping memory, and userpci lacks synchronization), code style is a mix of Windows and DPDK, logging may be insufficient. 3. POSIX shim vs EAL wrappers (@Thomas, @Pallavi, @Ranjit) What is the policy: to implement a POSIX shim in EAL (as the latest patches from Pallavi Kadam do), or to add dependencies (as [1] suggests)= ? IMO creating a shim is wrong. First, some POSIX concepts do not easily map to Windows, like poll() interface and I/O model in general. Second, there are numerous getopt, pthread, etc. implementations for Windows, no point wasting resources and repeat them, adding bugs. I can think of two exceptions: * , which is header-only. * Berkeley sockets. Adding to public headers creates more trouble that its worth: definitions for a few structures and constants. May be there should be some to abstract platform differences. Some highlights on my implementation: * Major features NOT supported: * multi-process (due to limited time) * interrupts (limited time + explained above) * eventdev (requires access to physical memory) * hot-plug (due to limited time and Windows knowledge) * bbdev (see comments in config/common_windows) * FreeBSD (trivial, I just don't use it) * DPDK is built using MinGW-w64 with GNUmake or Meson. Drivers are built using DDK (msbuild or Visual Studio). Actually, I cross-compile DPDK and build drivers natively. * Only tested on Windows 10 in QEMU with virtio-legacy. * No docs, but there's nothing unusual for those familiar with Windows. Bind virt2phys driver to Root\virt2phys, bind userpci driver to device(s)= . * Commit history is squashed, because it was a mess from experiments. There also may be some leftover changes, but those commits are not proper patches anyway. References: [0]: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgi= thub.com%2FPlushBeaver%2Fdpdk%2Fcommits%2Fwindows&data=3D02%7C01%7Csthe= mmin%40microsoft.com%7C485559de220c43a1fe2408d7a81fd5e9%7C72f988bf86f141af9= 1ab2d7cd011db47%7C1%7C0%7C637162727454625299&sdata=3DW%2BrqF4EWaBmwEOb7= t3fRrKfmu7GkHpIyNJ2us6Dx6QU%3D&reserved=3D0 [1]: https://nam06.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fmai= ls.dpdk.org%2Farchives%2Fdev%2F2015-February%2F014245.html&data=3D02%7C= 01%7Csthemmin%40microsoft.com%7C485559de220c43a1fe2408d7a81fd5e9%7C72f988bf= 86f141af91ab2d7cd011db47%7C1%7C0%7C637162727454625299&sdata=3DHb%2FCD99= bjzhDlfrcbKdBN%2FlFkqQyN3F%2BvYlPl1VIz8w%3D&reserved=3D0 -- Dmitry Kozlyuk