get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/80078/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 80078,
    "url": "https://patches.dpdk.org/api/patches/80078/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201008185645.12248-1-pallavi.kadam@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20201008185645.12248-1-pallavi.kadam@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201008185645.12248-1-pallavi.kadam@intel.com",
    "date": "2020-10-08T18:56:45",
    "name": "[v7] bus/pci: netuio interface for windows",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ec92a030c9c70eb51b3377ac6e90702821e54549",
    "submitter": {
        "id": 1177,
        "url": "https://patches.dpdk.org/api/people/1177/?format=api",
        "name": "Kadam, Pallavi",
        "email": "pallavi.kadam@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20201008185645.12248-1-pallavi.kadam@intel.com/mbox/",
    "series": [
        {
            "id": 12793,
            "url": "https://patches.dpdk.org/api/series/12793/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12793",
            "date": "2020-10-08T18:56:45",
            "name": "[v7] bus/pci: netuio interface for windows",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/12793/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/80078/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/80078/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id AC2EFA04BC;\n\tThu,  8 Oct 2020 21:01:23 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id F33241B708;\n\tThu,  8 Oct 2020 21:01:21 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id EBE341B6C1\n for <dev@dpdk.org>; Thu,  8 Oct 2020 21:01:19 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Oct 2020 12:01:17 -0700",
            "from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain)\n ([10.166.188.111])\n by FMSMGA003.fm.intel.com with ESMTP; 08 Oct 2020 12:01:17 -0700"
        ],
        "IronPort-SDR": [
            "\n DS+Yqa/Upl4zvXp5dIk/cXSG5rydddGZVgEWNJWFX/0cbAelgX/OO/NwOzrewtpRbDoj8Xjdfz\n xPPsWiAaB44g==",
            "\n BoPpSopwzAOGp9wWnYmahhLH5nevj7kA/AiCaS076j6NqczwVT8CAVtVx03jEJIU0Ehc1JvTpZ\n F1qtW58Om6kw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9768\"; a=\"164600680\"",
            "E=Sophos;i=\"5.77,351,1596524400\"; d=\"scan'208\";a=\"164600680\"",
            "E=Sophos;i=\"5.77,351,1596524400\"; d=\"scan'208\";a=\"354605890\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Pallavi Kadam <pallavi.kadam@intel.com>",
        "To": "dev@dpdk.org,\n\tthomas@monjalon.net",
        "Cc": "ranjit.menon@intel.com, John.Alexander@datapath.co.uk,\n dmitry.kozliuk@gmail.com, Narcisa.Vasile@microsoft.com, talshn@nvidia.com,\n khot@microsoft.com, pallavi.kadam@intel.com",
        "Date": "Thu,  8 Oct 2020 11:56:45 -0700",
        "Message-Id": "<20201008185645.12248-1-pallavi.kadam@intel.com>",
        "X-Mailer": "git-send-email 2.18.0.windows.1",
        "In-Reply-To": "<20201006215730.1584-1-pallavi.kadam@intel.com>",
        "References": "<20201006215730.1584-1-pallavi.kadam@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7] bus/pci: netuio interface for windows",
        "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>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch adds implementations to probe PCI devices bound to netuio\nwith the help of \"netuio\" class device changes.\nNow Windows will support both \"netuio\" and \"net\" device class and\ncan set kernel driver type based on the device class selection.\n\nNote: Few definitions and structures have been copied from\nnetuio_interface.h file from\n(\"[v5] windows/netuio: add Windows NetUIO kernel driver\") series\nand this will be fixed once the exact path for netuio source code is known.\n\nv7 changes:\n\tRemoved device property key from pci_netuio.c as Numa detection\n\tis done only in pci.c file\nv6 changes:\n\t- Split up the get_netuio_device_info() function into smaller\n\t  functions\n\t- Moved get numa node id code to get_device_resource_info() in\n\t  order to work on both RTE_PCI_KDRV_NONE and RTE_PCI_KDRV_NIC_UIO\nv5 changes:\n\tChanged when netuio driver handle is closed\nv4 changes:\n\tRemoved 'reserved' member as it is not used\nv3 changes:\n\tRemoved the casts\nv2 changes:\n\t- Moved all netuio specific definitions and functions to\n\t  pci_netuio.c and pci_netuio.h files\n\t- Added a single function call to scan all the devices\n\nSigned-off-by: John Alexander <John.Alexander@datapath.co.uk>\nSigned-off-by: Pallavi Kadam <pallavi.kadam@intel.com>\nReviewed-by: Ranjit Menon <ranjit.menon@intel.com>\n---\n drivers/bus/pci/meson.build          |   3 +-\n drivers/bus/pci/windows/pci.c        |  73 +++++++----\n drivers/bus/pci/windows/pci_netuio.c | 182 +++++++++++++++++++++++++++\n drivers/bus/pci/windows/pci_netuio.h |  59 +++++++++\n 4 files changed, 289 insertions(+), 28 deletions(-)\n create mode 100644 drivers/bus/pci/windows/pci_netuio.c\n create mode 100644 drivers/bus/pci/windows/pci_netuio.h",
    "diff": "diff --git a/drivers/bus/pci/meson.build b/drivers/bus/pci/meson.build\nindex b649a17c2..977800495 100644\n--- a/drivers/bus/pci/meson.build\n+++ b/drivers/bus/pci/meson.build\n@@ -18,7 +18,8 @@ if is_freebsd\n \tincludes += include_directories('bsd')\n endif\n if is_windows\n-\tsources += files('windows/pci.c')\n+\tsources += files('windows/pci.c',\n+\t\t\t'windows/pci_netuio.c')\n \tincludes += include_directories('windows')\n endif\n \ndiff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c\nindex 9e5c8fafb..30f218cc4 100644\n--- a/drivers/bus/pci/windows/pci.c\n+++ b/drivers/bus/pci/windows/pci.c\n@@ -4,10 +4,10 @@\n #include <rte_windows.h>\n #include <rte_errno.h>\n #include <rte_log.h>\n-#include <rte_eal_memconfig.h>\n #include <rte_eal.h>\n \n #include \"private.h\"\n+#include \"pci_netuio.h\"\n \n #include <devpkey.h>\n \n@@ -209,25 +209,27 @@ get_device_resource_info(HDEVINFO dev_info,\n \tDEVPROPTYPE property_type;\n \tDWORD numa_node;\n \tBOOL  res;\n+\tint ret;\n \n \tswitch (dev->kdrv) {\n \tcase RTE_PCI_KDRV_NONE:\n-\t\t/* Get NUMA node using DEVPKEY_Device_Numa_Node */\n-\t\tres = SetupDiGetDevicePropertyW(dev_info, dev_info_data,\n-\t\t\t&DEVPKEY_Device_Numa_Node, &property_type,\n-\t\t\t(BYTE *)&numa_node, sizeof(numa_node), NULL, 0);\n-\t\tif (!res) {\n-\t\t\tRTE_LOG_WIN32_ERR(\n-\t\t\t\t\"SetupDiGetDevicePropertyW\"\n-\t\t\t\t\"(DEVPKEY_Device_Numa_Node)\");\n-\t\t\treturn -1;\n-\t\t}\n-\t\tdev->device.numa_node = numa_node;\n \t\t/* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */\n \t\tdev->mem_resource[0].phys_addr = 0;\n \t\tdev->mem_resource[0].len = 0;\n \t\tdev->mem_resource[0].addr = NULL;\n \t\tbreak;\n+\tcase RTE_PCI_KDRV_NIC_UIO:\n+\t\t/* get device info from netuio kernel driver */\n+\t\tret = get_netuio_device_info(dev_info, dev_info_data, dev);\n+\t\tif (ret != 0) {\n+\t\t\tRTE_LOG(DEBUG, EAL,\n+\t\t\t\t\"Could not retrieve device info for PCI device \"\n+\t\t\t\tPCI_PRI_FMT,\n+\t\t\t\tdev->addr.domain, dev->addr.bus,\n+\t\t\t\tdev->addr.devid, dev->addr.function);\n+\t\t\treturn ret;\n+\t\t}\n+\t\tbreak;\n \tdefault:\n \t\t/* kernel driver type is unsupported */\n \t\tRTE_LOG(DEBUG, EAL,\n@@ -238,6 +240,17 @@ get_device_resource_info(HDEVINFO dev_info,\n \t\treturn -1;\n \t}\n \n+\t/* Get NUMA node using DEVPKEY_Device_Numa_Node */\n+\tres = SetupDiGetDevicePropertyW(dev_info, dev_info_data,\n+\t\t&DEVPKEY_Device_Numa_Node, &property_type,\n+\t\t(BYTE *)&numa_node, sizeof(numa_node), NULL, 0);\n+\tif (!res) {\n+\t\tRTE_LOG_WIN32_ERR(\"SetupDiGetDevicePropertyW\"\n+\t\t\t\"(DEVPKEY_Device_Numa_Node)\");\n+\t\treturn -1;\n+\t}\n+\tdev->device.numa_node = numa_node;\n+\n \treturn ERROR_SUCCESS;\n }\n \n@@ -286,13 +299,14 @@ parse_pci_hardware_id(const char *buf, struct rte_pci_id *pci_id)\n }\n \n static void\n-get_kernel_driver_type(struct rte_pci_device *dev)\n+set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data,\n+\tstruct rte_pci_device *dev)\n {\n-\t/*\n-\t * If another kernel driver is supported the relevant checking\n-\t * functions should be here\n-\t */\n-\tdev->kdrv = RTE_PCI_KDRV_NONE;\n+\t/* set kernel driver type based on device class */\n+\tif (IsEqualGUID(&(device_info_data->ClassGuid), &GUID_DEVCLASS_NETUIO))\n+\t\tdev->kdrv = RTE_PCI_KDRV_NIC_UIO;\n+\telse\n+\t\tdev->kdrv = RTE_PCI_KDRV_NONE;\n }\n \n static int\n@@ -335,7 +349,7 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data)\n \n \tpci_name_set(dev);\n \n-\tget_kernel_driver_type(dev);\n+\tset_kernel_driver_type(device_info_data, dev);\n \n \t/* get resources */\n \tif (get_device_resource_info(dev_info, device_info_data, dev)\n@@ -391,8 +405,8 @@ rte_pci_scan(void)\n \tif (!rte_eal_has_pci())\n \t\treturn 0;\n \n-\tdev_info = SetupDiGetClassDevs(&GUID_DEVCLASS_NET, TEXT(\"PCI\"), NULL,\n-\t\t\t\tDIGCF_PRESENT);\n+\tdev_info = SetupDiGetClassDevs(NULL, TEXT(\"PCI\"), NULL,\n+\t\tDIGCF_PRESENT | DIGCF_ALLCLASSES);\n \tif (dev_info == INVALID_HANDLE_VALUE) {\n \t\tRTE_LOG_WIN32_ERR(\"SetupDiGetClassDevs(pci_scan)\");\n \t\tRTE_LOG(ERR, EAL, \"Unable to enumerate PCI devices.\\n\");\n@@ -405,12 +419,17 @@ rte_pci_scan(void)\n \twhile (SetupDiEnumDeviceInfo(dev_info, device_index,\n \t    &device_info_data)) {\n \t\tdevice_index++;\n-\t\tret = pci_scan_one(dev_info, &device_info_data);\n-\t\tif (ret == ERROR_SUCCESS)\n-\t\t\tfound_device++;\n-\t\telse if (ret != ERROR_CONTINUE)\n-\t\t\tgoto end;\n-\n+\t\t/* we only want to enumerate net & netuio class devices */\n+\t\tif (IsEqualGUID(&(device_info_data.ClassGuid),\n+\t\t    &GUID_DEVCLASS_NET) ||\n+\t\t\tIsEqualGUID(&(device_info_data.ClassGuid),\n+\t\t\t    &GUID_DEVCLASS_NETUIO)) {\n+\t\t\tret = pci_scan_one(dev_info, &device_info_data);\n+\t\t\tif (ret == ERROR_SUCCESS)\n+\t\t\t\tfound_device++;\n+\t\t\telse if (ret != ERROR_CONTINUE)\n+\t\t\t\tgoto end;\n+\t\t}\n \t\tmemset(&device_info_data, 0, sizeof(SP_DEVINFO_DATA));\n \t\tdevice_info_data.cbSize = sizeof(SP_DEVINFO_DATA);\n \t}\ndiff --git a/drivers/bus/pci/windows/pci_netuio.c b/drivers/bus/pci/windows/pci_netuio.c\nnew file mode 100644\nindex 000000000..670194839\n--- /dev/null\n+++ b/drivers/bus/pci/windows/pci_netuio.c\n@@ -0,0 +1,182 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation.\n+ */\n+\n+#include <rte_windows.h>\n+#include <rte_errno.h>\n+#include <rte_log.h>\n+#include <rte_eal.h>\n+\n+#include \"private.h\"\n+#include \"pci_netuio.h\"\n+\n+static int\n+send_ioctl(HANDLE f, DWORD ioctl,\n+\tvoid *in_buf, DWORD in_buf_size, void *out_buf, DWORD out_buf_size)\n+{\n+\tBOOL res;\n+\tDWORD bytes_ret = 0;\n+\n+\tres = DeviceIoControl(f, ioctl, in_buf, in_buf_size,\n+\t\tout_buf, out_buf_size, &bytes_ret, NULL);\n+\tif (!res) {\n+\t\tRTE_LOG_WIN32_ERR(\"DeviceIoControl:IOCTL query failed\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn ERROR_SUCCESS;\n+}\n+\n+static HDEVINFO\n+get_netuio_device_information_set(HDEVINFO dev_info,\n+\tPSP_DEVINFO_DATA dev_info_data)\n+{\n+\tBOOL res;\n+\tDWORD required_size = 0;\n+\tTCHAR dev_instance_id[MAX_DEVICENAME_SZ];\n+\tHDEVINFO di_set = INVALID_HANDLE_VALUE;\n+\n+\t/* obtain the driver interface for this device */\n+\tres = SetupDiGetDeviceInstanceId(dev_info, dev_info_data,\n+\t\tdev_instance_id, sizeof(dev_instance_id), &required_size);\n+\tif (!res) {\n+\t\tRTE_LOG_WIN32_ERR(\"SetupDiGetDeviceInstanceId\");\n+\t\tgoto end;\n+\t}\n+\n+\t/* return the device information set for this device */\n+\tdi_set = SetupDiGetClassDevs(&GUID_DEVINTERFACE_NETUIO,\n+\t\tdev_instance_id, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);\n+\tif (di_set == INVALID_HANDLE_VALUE) {\n+\t\tRTE_LOG_WIN32_ERR(\"SetupDiGetClassDevs(device information set)\");\n+\t\tgoto end;\n+\t}\n+end:\n+\treturn di_set;\n+}\n+\n+static PSP_DEVICE_INTERFACE_DETAIL_DATA\n+get_netuio_device_interface_detail(HDEVINFO di_set)\n+{\n+\tBOOL res;\n+\tDWORD required_size = 0;\n+\tSP_DEVICE_INTERFACE_DATA  dev_ifx_data = { 0 };\n+\tPSP_DEVICE_INTERFACE_DETAIL_DATA dev_ifx_detail = NULL;\n+\n+\tdev_ifx_data.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);\n+\n+\t/* enumerate the netUIO interfaces for this device information set */\n+\tres = SetupDiEnumDeviceInterfaces(di_set, 0, &GUID_DEVINTERFACE_NETUIO,\n+\t\t0, &dev_ifx_data);\n+\tif (!res) {\n+\t\tRTE_LOG_WIN32_ERR(\"SetupDiEnumDeviceInterfaces: no device interface\");\n+\t\tgoto end;\n+\t}\n+\n+\t/* request and allocate required size for the device interface detail */\n+\trequired_size = 0;\n+\tres = SetupDiGetDeviceInterfaceDetail(di_set, &dev_ifx_data, NULL, 0,\n+\t\t&required_size, NULL);\n+\tif (!res) {\n+\t\t/* ERROR_INSUFFICIENT_BUFFER is expected */\n+\t\tif (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {\n+\t\t\tRTE_LOG_WIN32_ERR(\"SetupDiGetDeviceInterfaceDetail\");\n+\t\t\tgoto end;\n+\t\t}\n+\t}\n+\n+\tdev_ifx_detail = malloc(required_size);\n+\tif (!dev_ifx_detail) {\n+\t\tRTE_LOG(ERR, EAL, \"Could not allocate memory for dev interface.\\n\");\n+\t\tgoto end;\n+\t}\n+\tdev_ifx_detail->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);\n+\n+\tres = SetupDiGetDeviceInterfaceDetail(di_set, &dev_ifx_data,\n+\t\tdev_ifx_detail, required_size, NULL, NULL);\n+\tif (!res) {\n+\t\tRTE_LOG_WIN32_ERR(\"SetupDiGetDeviceInterfaceDetail\");\n+\t\tfree(dev_ifx_detail);\n+\t\tdev_ifx_detail = NULL;\n+\t\tgoto end;\n+\t}\n+\n+end:\n+\treturn dev_ifx_detail;\n+}\n+\n+/*\n+ * get device resource information by sending ioctl to netuio driver\n+ */\n+int\n+get_netuio_device_info(HDEVINFO dev_info, PSP_DEVINFO_DATA dev_info_data,\n+\tstruct rte_pci_device *dev)\n+{\n+\tint ret = -1;\n+\tHDEVINFO di_set = INVALID_HANDLE_VALUE;\n+\tPSP_DEVICE_INTERFACE_DETAIL_DATA dev_ifx_detail = NULL;\n+\tHANDLE netuio = INVALID_HANDLE_VALUE;\n+\tstruct device_info hw_info = { 0 };\n+\tunsigned int idx;\n+\n+\t/* obtain the device information set for this device */\n+\tdi_set = get_netuio_device_information_set(dev_info, dev_info_data);\n+\tif (di_set == INVALID_HANDLE_VALUE)\n+\t\tgoto end;\n+\n+\t/* obtain the device interface detail for this device */\n+\tdev_ifx_detail = get_netuio_device_interface_detail(di_set);\n+\tif (!dev_ifx_detail)\n+\t\tgoto end;\n+\n+\t/* open the kernel driver */\n+\tnetuio = CreateFile(dev_ifx_detail->DevicePath,\n+\t\tGENERIC_READ | GENERIC_WRITE,\n+\t\tFILE_SHARE_READ | FILE_SHARE_WRITE,\n+\t\tNULL,\n+\t\tOPEN_EXISTING,\n+\t\tFILE_ATTRIBUTE_NORMAL,\n+\t\tNULL);\n+\tif (netuio == INVALID_HANDLE_VALUE) {\n+\t\tRTE_LOG_WIN32_ERR(\"CreateFile\");\n+\t\tRTE_LOG(ERR, EAL, \"Unable to open driver file \\\"%s\\\".\\n\",\n+\t\t\tdev_ifx_detail->DevicePath);\n+\t\tgoto end;\n+\t}\n+\n+\t/* send ioctl to retrieve device information */\n+\tif (send_ioctl(netuio, IOCTL_NETUIO_MAP_HW_INTO_USERSPACE, NULL, 0,\n+\t\t&hw_info, sizeof(hw_info)) != ERROR_SUCCESS) {\n+\t\tRTE_LOG(ERR, EAL, \"Unable to send ioctl to driver.\\n\");\n+\t\tgoto end;\n+\t}\n+\n+\t/* set relevant values into the dev structure */\n+\tfor (idx = 0; idx < PCI_MAX_RESOURCE; idx++) {\n+\t\tdev->mem_resource[idx].phys_addr =\n+\t\t    hw_info.hw[idx].phys_addr.QuadPart;\n+\t\tdev->mem_resource[idx].addr =\n+\t\t    hw_info.hw[idx].user_mapped_virt_addr;\n+\t\tdev->mem_resource[idx].len = hw_info.hw[idx].size;\n+\t}\n+\n+\tret = ERROR_SUCCESS;\n+end:\n+\tif (ret != ERROR_SUCCESS) {\n+\t\t/* Only close the handle to the driver in case of an error.\n+\t\t * Otherwise, we want to keep the handle open. Closing it\n+\t\t * here will cause the driver to unmap all the process-mapped\n+\t\t * values resulting in invalid addresses.\n+\t\t */\n+\t\tif (netuio != INVALID_HANDLE_VALUE)\n+\t\t\tCloseHandle(netuio);\n+\t}\n+\n+\tif (dev_ifx_detail)\n+\t\tfree(dev_ifx_detail);\n+\n+\tif (di_set != INVALID_HANDLE_VALUE)\n+\t\tSetupDiDestroyDeviceInfoList(di_set);\n+\n+\treturn ret;\n+}\ndiff --git a/drivers/bus/pci/windows/pci_netuio.h b/drivers/bus/pci/windows/pci_netuio.h\nnew file mode 100644\nindex 000000000..9a77806b5\n--- /dev/null\n+++ b/drivers/bus/pci/windows/pci_netuio.h\n@@ -0,0 +1,59 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation\n+ */\n+\n+#ifndef _PCI_NETUIO_H_\n+#define _PCI_NETUIO_H_\n+\n+/* GUID definition for device class netUIO */\n+DEFINE_GUID(GUID_DEVCLASS_NETUIO, 0x78912bc1, 0xcb8e, 0x4b28,\n+\t0xa3, 0x29, 0xf3, 0x22, 0xeb, 0xad, 0xbe, 0x0f);\n+\n+/* GUID definition for the netuio device interface */\n+DEFINE_GUID(GUID_DEVINTERFACE_NETUIO, 0x08336f60, 0x0679, 0x4c6c,\n+\t0x85, 0xd2, 0xae, 0x7c, 0xed, 0x65, 0xff, 0xf7);\n+\n+/* IOCTL code definitions */\n+#define IOCTL_NETUIO_MAP_HW_INTO_USERSPACE \\\n+\tCTL_CODE(FILE_DEVICE_NETWORK, 51, METHOD_BUFFERED, \\\n+\t\t\t FILE_READ_ACCESS | FILE_WRITE_ACCESS)\n+\n+#define  MAX_DEVICENAME_SZ 255\n+\n+#pragma pack(push)\n+#pragma pack(8)\n+struct mem_region {\n+\tUINT64 size;  /* memory region size */\n+\tLARGE_INTEGER phys_addr;  /* physical address of the memory region */\n+\tPVOID virt_addr;  /* virtual address of the memory region */\n+\tPVOID user_mapped_virt_addr;  /* virtual address of the region mapped */\n+\t\t\t\t\t/* into user process context */\n+};\n+\n+#define PCI_MAX_BAR 6\n+\n+struct device_info {\n+\tstruct mem_region hw[PCI_MAX_BAR];\n+};\n+#pragma pack(pop)\n+\n+/**\n+ * Get device resource information by sending ioctl to netuio driver\n+ *\n+ * This function is private to EAL.\n+ *\n+ * @param dev_info\n+ *   HDEVINFO handle to device information set\n+ * @param dev_info_data\n+ *   SP_DEVINFO_DATA structure holding information about this enumerated device\n+ * @param dev\n+ *   PCI device context for this device\n+ * @return\n+ *   - 0 on success.\n+ *   - negative on error.\n+ */\n+int\n+get_netuio_device_info(HDEVINFO dev_info, PSP_DEVINFO_DATA dev_info_data,\n+\tstruct rte_pci_device *dev);\n+\n+#endif /* _PCI_NETUIO_H_ */\n",
    "prefixes": [
        "v7"
    ]
}