From patchwork Thu Feb 18 05:40:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khoa To X-Patchwork-Id: 87967 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 212A7A0558; Thu, 18 Feb 2021 06:40:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BE3E40698; Thu, 18 Feb 2021 06:40:44 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 167B740697 for ; Thu, 18 Feb 2021 06:40:43 +0100 (CET) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 1027220B57A0; Wed, 17 Feb 2021 21:40:42 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1027220B57A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1613626842; bh=4mIHBqO6mk0TQkXSGM+p8xnUzD9ZJCJost/wSCIna/I=; h=From:To:Cc:Subject:Date:From; b=HLW0v+7Y/jJLtKaDFF1qdFvCfGGuFOY1P5K7cDZMI0zqhPE0vv31SrqBBp8Mf2Hhh SdjyqXsHdgLuOi3NcRJlRJMMteG7CTH+nKjXEzsnxQK6/nqVZ3P6DBabMAdazJC4IC l5KznEqUWfthmy028pYQhbtTWX1Pp+M9GnmPe8Pk= From: Khoa To To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, pallavi.kadam@intel.com Date: Wed, 17 Feb 2021 21:40:05 -0800 Message-Id: <1613626805-9313-1-git-send-email-khot@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] bus/pci/windows: support for PCI scan allowed and blocked lists 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" From: Khoa To EAL -a and -b options are used to specify which PCI devices are explicitly allowed or blocked during PCI bus scan. This evaluation is missing in the Windows implementation of rte_pci_scan. This patch provides this missing functionality, so that apps can specify which NetUIO devices to ignore during PCI bus scan. Signed-off-by: Khoa To --- drivers/bus/pci/windows/pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index f66258452..0bba05eb4 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -396,6 +396,7 @@ rte_pci_scan(void) DWORD device_index = 0, found_device = 0; HDEVINFO dev_info; SP_DEVINFO_DATA device_info_data; + struct rte_pci_addr addr; /* for debug purposes, PCI can be disabled */ if (!rte_eal_has_pci()) @@ -420,6 +421,13 @@ rte_pci_scan(void) &GUID_DEVCLASS_NET) || IsEqualGUID(&(device_info_data.ClassGuid), &GUID_DEVCLASS_NETUIO)) { + + if (get_device_pci_address(dev_info, &device_info_data, &addr) != 0) + continue; + + if (rte_pci_ignore_device(&addr)) + continue; + ret = pci_scan_one(dev_info, &device_info_data); if (ret == ERROR_SUCCESS) found_device++;