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 0C373A04B5; Wed, 9 Sep 2020 20:53:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 682881B9B7; Wed, 9 Sep 2020 20:53:56 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id 8C5301DB8 for ; Wed, 9 Sep 2020 20:53:54 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1059) id CDFAE20942AC; Wed, 9 Sep 2020 11:53:53 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CDFAE20942AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1599677633; bh=b1xd/QYMN7VsHjAyTCQATEGJWH7NS4TlSaeIv5dKDJo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rLfRSM3s7JewFsoo29BYBdQEgJNc16VYk1orC2LJpZzTyaJpt840GwP8PcxK7OO8H TKLpJNNOl5k+9ajlcnsdfwngGcrkewVIeC98ibaIPdrcm5jJ6iPoz5xaseMDwSRkOF e7I3IrMEPzRY9IcyIwrLIq9g9z8HhWblc8XhQ8TQ= Date: Wed, 9 Sep 2020 11:53:53 -0700 From: Narcisa Ana Maria Vasile To: Dmitry Kozlyuk Cc: dev@dpdk.org, thomas@monjalon.net, ocardona@microsoft.com, haramakr@linux.microsoft.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, dmitrym@microsoft.com, Narcisa Vasile , Harini Ramakrishnan Message-ID: <20200909185353.GA12124@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1597962235-4787-1-git-send-email-navasile@linux.microsoft.com> <20200824235344.5994cd13@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200824235344.5994cd13@sovereign> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v2] windows/netuio: add Windows NetUIO kernel driver 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" On Mon, Aug 24, 2020 at 11:53:44PM +0300, Dmitry Kozlyuk wrote: > On Thu, 20 Aug 2020 15:23:55 -0700, Narcisa Ana Maria Vasile wrote: > > From: Narcisa Vasile > > > > The Windows NetUIO kernel driver allows the DPDK userspace > > application to directly access the hardware. > > > > Cc: Harini Ramakrishnan > > Cc: Omar Cardona > > Signed-off-by: Narcisa Vasile > > --- > > Major questions: > > 1. Does NetUIO still need to allocate and map a contiguous memory segment > now, when DPDK has user-mode memory management? > > 2. IOCTLs require to specify PCI address on each call. This is very > inconvenient for DPDK consumers and also seems to serve no purpose. > > 3. There is a need to document driver's design, preferably in commit message, > specifically: > > 3.1) DMA remapping capability in INF (AFAIK, vendors are notified); > 3.2) manual BAR probing instead of using resource lists; > 3.3) reason to use EvtIoInCallerContext and IO queues; > 3.4) IOCTL format. > > Also, I agree with everything Ranjit has noted already. > > General suggestions to cleanup the code a bit. We can do it later if you > wish. This also brings up the question, which code style should Windows > kernel code for DPDK follow (off-topic for now). > > * Remove boilerplate code and comments generated by VS wizard. > * Place `_Use_decl_annotations` on definitions to make them simpler. > * Limit line length, try using shorted variable names (e.g. > "netuio_contextdata" may be "context" or "ctx" with no loss). > Thank you for you thorough review! > More specific comments inline. > > [snip] > > +[Strings] > > +SPSVCINST_ASSOCSERVICE= 0x00000002 > > +Intel = "Intel" > > +Broadcom = "Broadcom Corporation" > > IHVs are supposed to add this gradually. > Thanks! I've modified the inf to remove all the vendor specific strings but left the sections to avoid errors when generating the binary. > > +ClassName = "Windows UIO" > > +DiskName = "DPDK netUIO Installation Disk" > > +netuio.DeviceDesc = "netuio Device" > > +netuio.SVCDESC = "netuio Service" > > + > > + // Build symbolic link name as _BDF (bus/device/func) > > + CHAR symbolic_link[64] = { 0 }; > > + sprintf_s(symbolic_link, sizeof(symbolic_link), "%s_%04d%02d%02d", > > + NETUIO_DEVICE_SYMBOLIC_LINK_ANSI, netuio_contextdata->addr.bus_num, > > + netuio_contextdata->addr.dev_num, netuio_contextdata->addr.func_num); > > + > > + ANSI_STRING ansi_symbolic_link; > > + RtlInitAnsiString(&ansi_symbolic_link, symbolic_link); > > + > > + status = RtlAnsiStringToUnicodeString(&netuio_symbolic_link, &ansi_symbolic_link, TRUE); > > + if (!NT_SUCCESS(status)) > > + return status; > > Why not use Unicode directly? > It looks like either way, a cast will be needed (for example, if I use wchar for symbolic_link and then RtlInitUnicodeString()). I've left it as is, but let me know if there's an elegant solution that I didn't see. > > + > > + status = WdfDeviceCreateSymbolicLink(device, &netuio_symbolic_link); > > + > > + RtlFreeUnicodeString(&netuio_symbolic_link); > > + > > + return status;