From: Ranjit Menon <ranjit.menon@intel.com>
To: Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
dev@dpdk.org, thomas@monjalon.net, ocardona@microsoft.com,
haramakr@linux.microsoft.com, pallavi.kadam@intel.com,
dmitry.kozliuk@gmail.com
Cc: dmitrym@microsoft.com, Narcisa Vasile <navasile@microsoft.com>,
Harini Ramakrishnan <Harini.Ramakrishnan@microsoft.com>
Subject: Re: [dpdk-dev] [PATCH v4] windows/netuio: add Windows NetUIO kernel driver
Date: Tue, 22 Sep 2020 14:36:50 -0700 [thread overview]
Message-ID: <d7db159f-e20a-1617-8ad3-dc70cd01ccf6@intel.com> (raw)
In-Reply-To: <1600483953-28579-1-git-send-email-navasile@linux.microsoft.com>
On 9/18/2020 7:52 PM, Narcisa Ana Maria Vasile wrote:
> From: Narcisa Vasile <navasile@microsoft.com>
>
> The Windows netuio kernel driver provides the DPDK userspace application
> with direct access to hardware, by mapping the HW registers in userspace
> and allowing read/write operations from/to the device
> configuration space.
>
> Two IOCTLs are defined by the netuio interface:
> * IOCTL_NETUIO_MAP_HW_INTO_USERMODE
> - used for mapping the device registers into userspace
> * IOCTL_NETUIO_PCI_CONFIG_IO
> - used to read/write from/into the device configuration space
>
> Note:
> Requests to map the device BARs into userspace need to be processed
> in the thread context of the process that initiated the mapping request.
> Otherwise, the BARs might end up mapped into an arbitrary process
> address space.
> EvtIoInCallerContext is used to ensure the requests are handled
> in the right user thread context. Other requests (PCI config)
> are sent back to the framework and processed by the EvtIoDeviceControl
> callback.
>
> Cc: Harini Ramakrishnan <Harini.Ramakrishnan@microsoft.com>
> Cc: Omar Cardona <ocardona@microsoft.com>
> Cc: Dmitry Malloy <dmitrym@microsoft.com>
> Signed-off-by: Narcisa Vasile <navasile@microsoft.com>
> ---
>
> v4:
> Fixed issues reported by DmitryK:
> * Fix whitespaces issues
> * Fix status not checked
> * Remove NULL checks for device and file context getters
> * Use %x for BDF
> * Add comment for BAR traversing
> * Remove complex calculations that were only needed in ASSERT
> * Remove netuio_evt_driver_context_cleanup as not needed
> * Check GetBusData/SetBusData returned bytes
> * General cleanup
>
> windows/.gitattributes | 4 +
> windows/.gitignore | 2 +
> windows/netuio/README.rst | 58 +++++
> windows/netuio/netuio.inf | 77 ++++++
> windows/netuio/netuio.sln | 24 ++
> windows/netuio/netuio.vcxproj | 113 +++++++++
> windows/netuio/netuio.vcxproj.filters | 54 +++++
> windows/netuio/netuio_dev.c | 273 +++++++++++++++++++++
> windows/netuio/netuio_dev.h | 66 +++++
> windows/netuio/netuio_drv.c | 131 ++++++++++
> windows/netuio/netuio_drv.h | 30 +++
> windows/netuio/netuio_interface.h | 88 +++++++
> windows/netuio/netuio_queue.c | 334 ++++++++++++++++++++++++++
> windows/netuio/netuio_queue.h | 21 ++
> 14 files changed, 1275 insertions(+)
> create mode 100644 windows/.gitattributes
> create mode 100644 windows/.gitignore
> create mode 100644 windows/netuio/README.rst
> create mode 100644 windows/netuio/netuio.inf
> create mode 100644 windows/netuio/netuio.sln
> create mode 100644 windows/netuio/netuio.vcxproj
> create mode 100644 windows/netuio/netuio.vcxproj.filters
> create mode 100644 windows/netuio/netuio_dev.c
> create mode 100644 windows/netuio/netuio_dev.h
> create mode 100644 windows/netuio/netuio_drv.c
> create mode 100644 windows/netuio/netuio_drv.h
> create mode 100644 windows/netuio/netuio_interface.h
> create mode 100644 windows/netuio/netuio_queue.c
> create mode 100644 windows/netuio/netuio_queue.h
<snip>
> diff --git a/windows/netuio/netuio_interface.h b/windows/netuio/netuio_interface.h
> new file mode 100644
> index 000000000..232b5bc2d
> --- /dev/null
> +++ b/windows/netuio/netuio_interface.h
> @@ -0,0 +1,88 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2020 Microsoft Corporation.
> + */
> +
> + /**
> + * @file netuio kernel driver interface
> + */
> +
> +#ifndef NETUIO_INTERFACE_H
> +#define NETUIO_INTERFACE_H
> +
> +/**
> + * All structures in this file are packed on an 8B boundary.
> + */
> +#pragma pack(push)
> +#pragma pack(8)
> +
> +/**
> + * Define an Interface Guid so that any app can find the device and talk to it.
> + */
> +DEFINE_GUID (GUID_DEVINTERFACE_netUIO, 0x08336f60,0x0679,0x4c6c,0x85,0xd2,0xae,0x7c,0xed,0x65,0xff,0xf7); // {08336f60-0679-4c6c-85d2-ae7ced65fff7}
> +
> +/**
> + * Device name definitions
> + */
> +#define NETUIO_DEVICE_SYMBOLIC_LINK_UNICODE L"\\DosDevices\\netuio"
> +#define NETUIO_MAX_SYMLINK_LEN 255
> +
> +/**
> + * IOCTL_NETUIO_MAP_HW_INTO_USERMODE is used for mapping the device registers
> + * into userspace. It returns the physical address, virtual address
> + * and the size of the memory region where the BARs were mapped.
> + */
> +#define IOCTL_NETUIO_MAP_HW_INTO_USERMODE CTL_CODE(FILE_DEVICE_NETWORK, 51, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
Not critical, but can we rename this IOCTL code to
IOCTL_NETUIO_MAP_HW_INTO_USERSPACE since that seems more appropriate and it is what the comment is referring to?
<snip>
ranjit m.
next prev parent reply other threads:[~2020-09-22 21:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 22:23 [dpdk-dev] [PATCH v2] " Narcisa Ana Maria Vasile
2020-08-21 1:32 ` Ranjit Menon
2020-09-09 18:58 ` Narcisa Ana Maria Vasile
2020-08-24 20:53 ` Dmitry Kozlyuk
2020-09-09 18:53 ` Narcisa Ana Maria Vasile
2020-09-13 21:39 ` Dmitry Kozlyuk
2020-09-09 18:41 ` [dpdk-dev] [PATCH v3] " Narcisa Ana Maria Vasile
2020-09-13 21:39 ` Dmitry Kozlyuk
2020-09-19 2:52 ` [dpdk-dev] [PATCH v4] " Narcisa Ana Maria Vasile
2020-09-22 21:25 ` Dmitry Kozlyuk
2020-09-22 21:36 ` Ranjit Menon [this message]
2020-10-01 22:55 ` [dpdk-dev] [PATCH v5] " Narcisa Ana Maria Vasile
2020-10-02 18:21 ` Ranjit Menon
2020-10-05 19:34 ` Narcisa Ana Maria Vasile
2020-10-14 9:29 ` Thomas Monjalon
2020-10-02 18:33 ` Dmitry Kozlyuk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d7db159f-e20a-1617-8ad3-dc70cd01ccf6@intel.com \
--to=ranjit.menon@intel.com \
--cc=Harini.Ramakrishnan@microsoft.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=dmitrym@microsoft.com \
--cc=haramakr@linux.microsoft.com \
--cc=navasile@linux.microsoft.com \
--cc=navasile@microsoft.com \
--cc=ocardona@microsoft.com \
--cc=pallavi.kadam@intel.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).