diff mbox series

[v2] bus/pci/windows: support for PCI scan allowed and blocked lists

Message ID 1613673602-6291-1-git-send-email-khot@linux.microsoft.com (mailing list archive)
State New
Delegated to: David Marchand
Headers show
Series [v2] bus/pci/windows: support for PCI scan allowed and blocked lists | expand

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot success github build: passed
ci/travis-robot fail travis build: failed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Khoa To Feb. 18, 2021, 6:40 p.m. UTC
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 <khot@linux.microsoft.com>
---

v2:
* Truncate commit description lines to 75 charaters or less


 drivers/bus/pci/windows/pci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Ranjit Menon Feb. 18, 2021, 6:53 p.m. UTC | #1
Hi Khoa,

On 2/18/2021 10:40 AM, Khoa To wrote:
> 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 <khot@linux.microsoft.com>
> ---
>
> v2:
> * Truncate commit description lines to 75 charaters or less
>
>
>   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++;
I think this change can be made inside the pci_scan_one() function where 
we already call

get_device_pci_address().

ranjit m.
Dmitry Kozlyuk Feb. 18, 2021, 9:23 p.m. UTC | #2
On Thu, 18 Feb 2021 10:53:54 -0800, Ranjit Menon wrote:
> > +
> > +			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++;  
> I think this change can be made inside the pci_scan_one() function where 
> we already call
> 
> get_device_pci_address().

+1, even to place this check before other actions in pci_scan_one().
diff mbox series

Patch

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++;