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 56616A0588; Thu, 16 Apr 2020 20:34:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3991C1DDD5; Thu, 16 Apr 2020 20:34:06 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 225C01D8E4 for ; Thu, 16 Apr 2020 20:34:04 +0200 (CEST) IronPort-SDR: uYZZFKsi4IK6UdP802Jb6AuBK9/nq1kHdEi/SeWmfk2To+xOI5JAJyh0ax8t7oInlaEwpNitO+ hbu93Rl+RIQw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2020 11:34:03 -0700 IronPort-SDR: Dta88T9xDdOb96jCDRGUn+u8x1qrG6P19MT69A6Go3Pcd1vCRRnOWgBku9n5E2dHCcZBXGGF9y iJG7ZHHyFK0A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,391,1580803200"; d="scan'208";a="253954839" Received: from rmenon-mobl.amr.corp.intel.com (HELO [10.212.13.42]) ([10.212.13.42]) by orsmga003.jf.intel.com with ESMTP; 16 Apr 2020 11:34:02 -0700 To: Dmitry Kozlyuk , "dev@dpdk.org" Cc: "Dmitry Malloy (MESHCHANINOV)" , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Thomas Monjalon , Harini Ramakrishnan , Omar Cardona , "Kadam, Pallavi" , "Mcnamara, John" , "Kovacevic, Marko" , "Burakov, Anatoly" , "Richardson, Bruce" References: <20200410164342.1194634-1-dmitry.kozliuk@gmail.com> <20200414194426.1640704-1-dmitry.kozliuk@gmail.com> <20200414194426.1640704-11-dmitry.kozliuk@gmail.com> From: Ranjit Menon Message-ID: Date: Thu, 16 Apr 2020 11:34:02 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200414194426.1640704-11-dmitry.kozliuk@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 10/10] eal/windows: implement basic memory management 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 4/14/2020 12:44 PM, Dmitry Kozlyuk wrote: > Basic memory management supports core libraries and PMDs operating in > IOVA as PA mode. It uses a kernel-mode driver, virt2phys, to obtain > IOVAs of hugepages allocated from user-mode. > > Signed-off-by: Dmitry Kozlyuk > --- > diff --git a/lib/librte_eal/windows/include/rte_virt2phys.h b/lib/librte_eal/windows/include/rte_virt2phys.h > new file mode 100644 > index 000000000..4bb2b4aaf > --- /dev/null > +++ b/lib/librte_eal/windows/include/rte_virt2phys.h > @@ -0,0 +1,34 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright (c) 2020 Dmitry Kozlyuk > + */ > + > +/** > + * @file virt2phys driver interface > + */ > + > +/** > + * Driver device interface GUID {539c2135-793a-4926-afec-d3a1b61bbc8a}. > + */ > +DEFINE_GUID(GUID_DEVINTERFACE_VIRT2PHYS, > + 0x539c2135, 0x793a, 0x4926, > + 0xaf, 0xec, 0xd3, 0xa1, 0xb6, 0x1b, 0xbc, 0x8a); > + > +/** > + * Driver device type for IO control codes. > + */ > +#define VIRT2PHYS_DEVTYPE 0x8000 > + > +/** > + * Translate a valid non-paged virtual address to a physical address. > + * > + * Note: A physical address zero (0) is reported if input address > + * is paged out or not mapped. However, if input is a valid mapping > + * of I/O port 0x0000, output is also zero. There is no way > + * to distinguish between these cases by return value only. > + * > + * Input: a non-paged virtual address (PVOID). > + * > + * Output: the corresponding physical address (LARGE_INTEGER). > + */ > +#define IOCTL_VIRT2PHYS_TRANSLATE CTL_CODE( \ > + VIRT2PHYS_DEVTYPE, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS) This file is a duplicate of: : windows/virt2phys/virt2phys.h This is by design, since it documents the driver interface. So, to prevent the two files going out-of-sync, should we: 1. Make the two filenames the same? 2. Add comments to both files referencing each other and the need to keep them both in sync? 3. Do both (1) and (2)? This will also be an issue for the upcoming Windows netuio kernel driver and I reckon this could be an issue for Linux kernel modules too. Thoughts? ranjit m.