From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 599F0A0550; Wed, 10 Feb 2021 21:47:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4042E1606BB; Wed, 10 Feb 2021 21:47:44 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 785EE4069D for ; Wed, 10 Feb 2021 21:47:42 +0100 (CET) IronPort-SDR: EQMHggmX4elUIbfuCG2cT0NZ6YFt11uk3ebxQhuzFfxDOM8Yk7ivicyhvbSiyj870YGTEkRIZ+ OVlAzjZGl3Vw== X-IronPort-AV: E=McAfee;i="6000,8403,9891"; a="266990089" X-IronPort-AV: E=Sophos;i="5.81,169,1610438400"; d="scan'208,217";a="266990089" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2021 12:47:41 -0800 IronPort-SDR: oE6UJ8UjreNUQyLqhPnYvhnoQLNcOsThVb3buBrteqCgR3qtcRBoN01O6HBye5YWB1gOtvGjFE BooZQeD7uJqw== X-IronPort-AV: E=Sophos;i="5.81,169,1610438400"; d="scan'208,217";a="396931503" Received: from pkadam-mobl1.amr.corp.intel.com (HELO [10.254.101.229]) ([10.254.101.229]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2021 12:47:40 -0800 To: Tal Shnaiderman , "dev@dpdk.org" , NBU-Contact-Thomas Monjalon Cc: "ranjit.menon@intel.com" , "dmitry.kozliuk@gmail.com" , "Narcisa.Vasile@microsoft.com" References: <20210210014008.11112-1-pallavi.kadam@intel.com> From: "Kadam, Pallavi" Message-ID: <82108b6e-5042-8801-0e4e-c5f96f693136@intel.com> Date: Wed, 10 Feb 2021 12:47:40 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH] bus/pci: fix probing for non-netuio bound devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 2/9/2021 10:00 PM, Tal Shnaiderman wrote: >> Subject: [PATCH] bus/pci: fix probing for non-netuio bound devices >> >> External email: Use caution opening links or attachments >> >> >> Implement rte_pci_map_device() to distinguish between the devices bound >> to netuio and NDIS devices. >> Only return success for the netuio devices. >> >> Suggested-by: Dmitry Kozlyuk >> Signed-off-by: Pallavi Kadam >> Reviewed-by: Ranjit Menon >> --- >> drivers/bus/pci/windows/pci.c | 15 +++++++-------- >> 1 file changed, 7 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c >> index f66258452..16edaa769 100644 >> --- a/drivers/bus/pci/windows/pci.c >> +++ b/drivers/bus/pci/windows/pci.c >> @@ -23,20 +23,19 @@ >> DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, >> 0x45bc, >> * the registry hive for PCI devices. >> */ >> >> -/* The functions below are not implemented on Windows, >> +/* Some of the functions below are not implemented on Windows, >> * but need to be defined for compilation purposes >> */ >> >> /* Map pci device */ >> int >> -rte_pci_map_device(struct rte_pci_device *dev __rte_unused) >> +rte_pci_map_device(struct rte_pci_device *dev) >> { >> - /* This function is not implemented on Windows. >> - * We really should short-circuit the call to these functions by >> - * clearing the RTE_PCI_DRV_NEED_MAPPING flag >> - * in the rte_pci_driver flags. >> - */ >> - return 0; >> + /* Only return success for devices bound to netuio */ > Maybe extend this comment to mention where the mapping is actually done? Modified the comment in v2. > >> + if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO) >> + return 0; >> + else >> + return -EINVAL; > The function should return -1 here to match the behavior with other OS implementations. Replaced the return value in v2. Thanks. > >> } >> >> /* Unmap pci device */ >> -- >> 2.18.0.windows.1