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 5AF5DA0520; Sat, 27 Jun 2020 03:46:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C3C31B9BF; Sat, 27 Jun 2020 03:46:56 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id E54E4F04 for ; Sat, 27 Jun 2020 03:46:53 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1059) id 27A2E20B4901; Fri, 26 Jun 2020 18:46:53 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 27A2E20B4901 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1593222413; bh=avfbUHwDQpyY0/A/6WafvRn8GHMajiIZkWH9cjzJz78=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y7qWvo5bwfNmVxtAInDxMWnyJd3Fclc2SMR1ht5HJnwpzGLnB883ox7HpeYegTaPv lg4eB3W63EnmJOi4j9m88O96Tf7y4a3R0Q4CpptA9pQizM5jeFshC5bl7on+wGYpNS XV0LrAyQNear30Nqu3a40fwuknpCkiOvAWDLghqY= Date: Fri, 26 Jun 2020 18:46:53 -0700 From: Narcisa Ana Maria Vasile To: talshn@mellanox.com Cc: dev@dpdk.org, thomas@monjalon.net, pallavi.kadam@intel.com, dmitry.kozliuk@gmail.com, david.marchand@redhat.com, grive@u256.net, ranjit.menon@intel.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, anatoly.burakov@intel.com, fady@mellanox.com, bruce.richardson@intel.com Message-ID: <20200627014653.GA10439@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20200622075529.24180-2-talshn@mellanox.com> <20200624082847.21344-1-talshn@mellanox.com> <20200624082847.21344-10-talshn@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624082847.21344-10-talshn@mellanox.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v9 09/10] bus/pci: support Windows with bifurcated drivers 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 Wed, Jun 24, 2020 at 11:28:46AM +0300, talshn@mellanox.com wrote: > From: Tal Shnaiderman > > Uses SetupAPI.h functions to scan PCI tree. > Uses DEVPKEY_Device_Numa_Node to get the PCI NUMA node. > Uses SPDRP_BUSNUMBER and SPDRP_BUSNUMBER to get the BDF. > scanning currently supports types RTE_KDRV_NONE. > > Signed-off-by: Tal Shnaiderman > --- > drivers/bus/pci/windows/pci.c | 263 ++++++++++++++++++++++++++- > lib/librte_eal/rte_eal_exports.def | 1 + > lib/librte_eal/windows/include/rte_windows.h | 1 + > 3 files changed, 261 insertions(+), 4 deletions(-) > > int > rte_pci_scan(void) > { > - return 0; > + int ret = -1; > + DWORD device_index = 0, found_device = 0; > + HDEVINFO dev_info; > + SP_DEVINFO_DATA device_info_data; > + > + /* for debug purposes, PCI can be disabled */ > + if (!rte_eal_has_pci()) > + return 0; > + > + dev_info = SetupDiGetClassDevs(&GUID_DEVCLASS_NET, TEXT("PCI"), NULL, > + DIGCF_PRESENT); Should we search for PCI devices by all classes to account for future support of drivers that are not part of the the Net class (e.g. netuio driver)? E.g.: SetupDiGetClassDevs(NULL, TEXT("PCI"), NULL, DIGCF_PRESENT | DIGCF_ALLCLASSES); Alternatively, since this patchset supports only RTE_KDRV_NONE, we can change it when introducing support for other types. > + if (dev_info == INVALID_HANDLE_VALUE) { > + RTE_LOG_WIN32_ERR("SetupDiGetClassDevs(pci_scan)"); > + RTE_LOG(ERR, EAL, "Unable to enumerate PCI devices.\n"); > + goto end; > +