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 BE5B4A0550; Wed, 10 Feb 2021 21:45:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3774640693; Wed, 10 Feb 2021 21:45:18 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id A858E40142 for ; Wed, 10 Feb 2021 21:45:16 +0100 (CET) IronPort-SDR: I68wtiquSmkgMyR2ZZSBcXP8Gg6zoEZ9TqQeTSH1RyMqvY+x4pKeC8uVJq1ViMd9SA1ahl1Kt+ WiFjos+gFCHQ== X-IronPort-AV: E=McAfee;i="6000,8403,9891"; a="169274965" X-IronPort-AV: E=Sophos;i="5.81,169,1610438400"; d="scan'208";a="169274965" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2021 12:45:15 -0800 IronPort-SDR: 3NXHH+fB4s+JSBBh5L4IdbZtACRfEZSymldZj1evZAND+VdyEJedR30OfsGE4sjUd6G/8BemqX JaRooalNiJoA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,169,1610438400"; d="scan'208";a="361471636" Received: from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain) ([10.166.188.111]) by fmsmga007.fm.intel.com with ESMTP; 10 Feb 2021 12:45:14 -0800 From: Pallavi Kadam To: dev@dpdk.org, thomas@monjalon.net Cc: ranjit.menon@intel.com, dmitry.kozliuk@gmail.com, Narcisa.Vasile@microsoft.com, talshn@nvidia.com, pallavi.kadam@intel.com Date: Wed, 10 Feb 2021 12:36:54 -0800 Message-Id: <20210210203654.10132-1-pallavi.kadam@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 In-Reply-To: <20210210014008.11112-1-pallavi.kadam@intel.com> References: <20210210014008.11112-1-pallavi.kadam@intel.com> Subject: [dpdk-dev] [PATCH v2] 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" Implement rte_pci_map_device() to distinguish between the devices bound to netuio and NDIS devices. Only return success for the netuio devices. v2 changes: - Extended the comment to mention about mapping - replaced the return errno value with -1 Suggested-by: Dmitry Kozlyuk Signed-off-by: Pallavi Kadam Reviewed-by: Ranjit Menon --- drivers/bus/pci/windows/pci.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index f66258452..00e7849b0 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -23,20 +23,22 @@ 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. + /* Only return success for devices bound to netuio. + * Devices that are bound to netuio are mapped at + * the bus probing stage. */ - return 0; + if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO) + return 0; + else + return -1; } /* Unmap pci device */ -- 2.18.0.windows.1