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 6BDE8A04C7; Tue, 15 Sep 2020 22:13:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 434321BE8E; Tue, 15 Sep 2020 22:13:27 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 7778EE07 for ; Tue, 15 Sep 2020 22:13:25 +0200 (CEST) IronPort-SDR: 9XE0ug3SOAEslOvPvrLxbRSjCprdAauo1d7Ea3CgPtuuEwSkiMmhIv1tNG+KipKVhIJwjGW+Vi 5iV60kEQNwLA== X-IronPort-AV: E=McAfee;i="6000,8403,9745"; a="244177183" X-IronPort-AV: E=Sophos;i="5.76,430,1592895600"; d="scan'208";a="244177183" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2020 13:13:23 -0700 IronPort-SDR: ljSgNeM1W6hTEqupaB5SHUZqt+Qe7niMDVJbJi9TSNDwgJza2HCMBObdPTsDo5xheCy76R0bFC WhWF0AWzWbPw== X-IronPort-AV: E=Sophos;i="5.76,430,1592895600"; d="scan'208";a="451566785" Received: from rmenon-desk.amr.corp.intel.com (HELO [10.166.30.253]) ([10.166.30.253]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2020 13:13:22 -0700 To: Tal Shnaiderman , Pallavi Kadam , "dev@dpdk.org" , NBU-Contact-Thomas Monjalon Cc: "dmitry.kozliuk@gmail.com" , "Narcisa.Vasile@microsoft.com" References: <20200911015947.20044-1-pallavi.kadam@intel.com> From: Ranjit Menon Message-ID: <5097faac-6d2e-2186-8585-e24b3f432d99@intel.com> Date: Tue, 15 Sep 2020 13:13:20 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Tal On 9/13/2020 11:42 AM, Tal Shnaiderman wrote: >> Subject: [PATCH] bus/pci: netuio interface for windows >> >> This patch adds implementations to probe PCI devices bound to netuio with >> the help of "netuio" class device changes. >> Now Windows will support both "netuio" and "net" device class and can set >> kernel driver type based on the device class selection. >> >> Note: Few definitions and structures have been copied from >> netuio_interface.h file from ("[v3] windows/netuio: add Windows NetUIO >> kernel driver") series and this will be fixed once the exact path for netuio >> source code is known. >> >> Signed-off-by: Pallavi Kadam >> Reviewed-by: Ranjit Menon >> --- >> drivers/bus/pci/windows/pci.c | 293 +++++++++++++++++++++++++++++-- >> --- >> 1 file changed, 257 insertions(+), 36 deletions(-) >> >> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c >> index c80bd5571..38db87a2a 100644 >> --- a/drivers/bus/pci/windows/pci.c >> +++ b/drivers/bus/pci/windows/pci.c > I think it will be better to split the pci implementation into 2 files and add pci_netuio.c > (similarly to Linux with pci_uio.c and pci_vfio.c), moving all of the netuio-specific definitions and functions in this patch to the new file. > > [snip] I think this is a good suggestion. We'll work on this in V2. >> -int >> -rte_pci_scan(void) >> +static int >> +pci_scan_device_class(const GUID *guid) >> { >> int ret = -1; >> DWORD device_index = 0, found_device = 0; >> HDEVINFO dev_info; >> SP_DEVINFO_DATA device_info_data; >> + const char *class; >> >> - /* for debug purposes, PCI can be disabled */ >> - if (!rte_eal_has_pci()) >> - return 0; >> + if (IsEqualGUID((const void *)guid, >> + (const void *)&GUID_DEVCLASS_NETUIO)) >> + class = netuio_class; >> + else >> + class = net_class; >> >> - dev_info = SetupDiGetClassDevs(&GUID_DEVCLASS_NET, TEXT("PCI"), >> NULL, >> - DIGCF_PRESENT); >> + dev_info = SetupDiGetClassDevs(guid, TEXT("PCI"), NULL, >> + DIGCF_PRESENT); > Is there a way to get both GUID_DEVCLASS_NET and GUID_DEVCLASS_NETUIO in a single call here? > We could avoid calling this function twice if we could get all of the devices. Yes. I think we have a way to make it work so that we can avoid calling this function twice. We can scan for all device classes and then only filter out net and netuio class devices. >> if (dev_info == INVALID_HANDLE_VALUE) { >> RTE_LOG_WIN32_ERR("SetupDiGetClassDevs(pci_scan)"); >> - RTE_LOG(ERR, EAL, "Unable to enumerate PCI devices.\n"); >> + RTE_LOG(ERR, EAL, "Unable to enumerate %s PCI devices.\n", >> + class); >> goto end; >> } >> >> @@ -415,7 +614,8 @@ rte_pci_scan(void) >> device_info_data.cbSize = sizeof(SP_DEVINFO_DATA); >> } >> >> - RTE_LOG(DEBUG, EAL, "PCI scan found %lu devices\n", found_device); >> + RTE_LOG(DEBUG, EAL, "PCI scan found %lu %s devices\n", >> + found_device, class); >> ret = 0; >> end: >> if (dev_info != INVALID_HANDLE_VALUE) @@ -423,3 +623,24 @@ >> rte_pci_scan(void) >> >> return ret; >> } >> + >> +/* >> + * Scan the contents of the PCI bus looking for devices */ int >> +rte_pci_scan(void) >> +{ >> + int ret = -1; >> + >> + /* for debug purposes, PCI can be disabled */ >> + if (!rte_eal_has_pci()) >> + return 0; >> + >> + /* first, scan for netUIO class devices */ >> + ret = pci_scan_device_class(&GUID_DEVCLASS_NETUIO); > ret is overwritten later on. > >> + >> + /* then, scan for the standard net class devices */ >> + ret = pci_scan_device_class(&GUID_DEVCLASS_NET); >> + >> + return ret; >> +} >> -- >> 2.18.0.windows.1 > thanks, ranjit m.