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 626C0A054F; Wed, 10 Feb 2021 02:49:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 680611606DE; Wed, 10 Feb 2021 02:49:18 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 8860C40693 for ; Wed, 10 Feb 2021 02:49:16 +0100 (CET) IronPort-SDR: +8fxSPMMqYbN97mqJKPDfjTIi0tECTSHIGWOmFh1rNTFHT5Kii3OqXBqx2N+KJLd8Uf5dJ1g6C 8trAyVOxfdWQ== X-IronPort-AV: E=McAfee;i="6000,8403,9890"; a="182060998" X-IronPort-AV: E=Sophos;i="5.81,166,1610438400"; d="scan'208";a="182060998" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2021 17:49:15 -0800 IronPort-SDR: WcpqOESsl8lIKajU0JKlS9Jub3nH1lQ3nLKBJDU95W6mUazvDI0U89iUO0Z2gbFZs5HJO0b/Lb WY2Ajfm/mMFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,166,1610438400"; d="scan'208";a="420256218" Received: from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain) ([10.166.188.111]) by fmsmga002.fm.intel.com with ESMTP; 09 Feb 2021 17:49: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: Tue, 9 Feb 2021 17:40:08 -0800 Message-Id: <20210210014008.11112-1-pallavi.kadam@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 Subject: [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" 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 */ + if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO) + return 0; + else + return -EINVAL; } /* Unmap pci device */ -- 2.18.0.windows.1