bus/pci/windows: support for PCI scan allowed and blocked lists
PATCH 1/1 bus/pci/windows: support for PCI scan allowed and blocked lists
From: Khoa To <[email protected]>
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.
--- drivers/bus/pci/windows/pci.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/bus/pci/windows/pci.c +8 -0
@@ -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++;
Signature · 1 line
2.29.0.vfs.0.0
PATCH v2 1/1 bus/pci/windows: support for PCI scan allowed and blocked lists
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.
---
v2:
* Truncate commit description lines to 75 charaters or less
drivers/bus/pci/windows/pci.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/bus/pci/windows/pci.c +8 -0
@@ -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++;
Signature · 1 line
2.29.0.vfs.0.0
Hi Khoa,
Quoted 32 lines · 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 <[email protected]>---
v2:
* Truncate commit description lines to 75 charaters or lessdrivers/bus/pci/windows/pci.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/bus/pci/windows/pci.c +1
-0@@ -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)) {
drivers/bus/pci/windows/pci.c rte_pci_scan(void) · line 433
Quoted 10 lines
drivers/bus/pci/windows/pci.c +7
-0+ +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.
Quoted 13 lines · Ranjit Menon
drivers/bus/pci/windows/pci.c rte_pci_scan(void) · line 433
Quoted 10 lines
drivers/bus/pci/windows/pci.c +7
-0+ +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
Quoted 1 line
get_device_pci_address().
+1, even to place this check before other actions in pci_scan_one().
PATCH v3 1/1 bus/pci/windows: support for PCI scan allowed and blocked lists
In reply to Khoa ToEAL -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.
---
v3:
* Move the check inside pci_scan_one
* Small change to pci_scan_one to malloc only after checks succeeded v2:
* Truncate commit description lines to 75 charaters or less
drivers/bus/pci/windows/pci.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
drivers/bus/pci/windows/pci.c +16 -7
@@ -308,17 +308,24 @@ set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data,static int pci_scan_one (HDEVINFO dev_info,PSP_DEVINFO_DATA device_info_data) { -struct rte_pci_device *dev; +struct rte_pci_device *dev =NULL ;int ret =-1 ;char pci_device_info[REGSTR_VAL_MAX_HCID_LEN ];struct rte_pci_addr addr;struct rte_pci_id pci_id; - dev =malloc (sizeof (*dev)); -if (dev ==NULL ) + ret =get_device_pci_address (dev_info, device_info_data, &addr); +if (ret !=0 ) goto end; -memset (dev,0 ,sizeof (*dev)); +if (rte_pci_ignore_device (&addr)) { +/* +* We won't add this device, but we want to continue +* looking for supported devices +*/ + ret =ERROR_CONTINUE ; + goto end; + } ret =get_pci_hardware_id (dev_info, device_info_data, pci_device_info,sizeof (pci_device_info));
@@ -335,10 +342,12 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data) goto end; } - ret =get_device_pci_address (dev_info, device_info_data, &addr); -if (ret !=0 ) + dev =malloc (sizeof (*dev)); +if (dev ==NULL ) goto end; +memset (dev,0 ,sizeof (*dev)); + dev->addr = addr; dev->id = pci_id; dev->max_vfs =0 ;/* TODO: get max_vfs */
@@ -417,7 +426,7 @@ rte_pci_scan(void) device_index++;/* we only want to enumerate net & netuio class devices */ if (IsEqualGUID (&(device_info_data.ClassGuid), - &GUID_DEVCLASS_NET ) || + &GUID_DEVCLASS_NET ) ||IsEqualGUID (&(device_info_data.ClassGuid), &GUID_DEVCLASS_NETUIO )) { ret =pci_scan_one (dev_info, &device_info_data);
Signature · 1 line
2.29.0.vfs.0.0
PATCH v4 1/1 bus/pci/windows: support for PCI scan allowed and blocked lists
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.
---
v4:
* Fix coding style warning with unaligned comments
v3:
* Move the check inside pci_scan_one
* Small change to pci_scan_one to malloc only after checks succeeded v2:
* Truncate commit description lines to 75 charaters or less
drivers/bus/pci/windows/pci.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
drivers/bus/pci/windows/pci.c +16 -7
@@ -308,17 +308,24 @@ set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data,static int pci_scan_one (HDEVINFO dev_info,PSP_DEVINFO_DATA device_info_data) { -struct rte_pci_device *dev; +struct rte_pci_device *dev =NULL ;int ret =-1 ;char pci_device_info[REGSTR_VAL_MAX_HCID_LEN ];struct rte_pci_addr addr;struct rte_pci_id pci_id; - dev =malloc (sizeof (*dev)); -if (dev ==NULL ) + ret =get_device_pci_address (dev_info, device_info_data, &addr); +if (ret !=0 ) goto end; -memset (dev,0 ,sizeof (*dev)); +if (rte_pci_ignore_device (&addr)) { +/* +* We won't add this device, but we want to continue +* looking for supported devices +*/ + ret =ERROR_CONTINUE ; + goto end; + } ret =get_pci_hardware_id (dev_info, device_info_data, pci_device_info,sizeof (pci_device_info));
@@ -335,10 +342,12 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data) goto end; } - ret =get_device_pci_address (dev_info, device_info_data, &addr); -if (ret !=0 ) + dev =malloc (sizeof (*dev)); +if (dev ==NULL ) goto end; +memset (dev,0 ,sizeof (*dev)); + dev->addr = addr; dev->id = pci_id; dev->max_vfs =0 ;/* TODO: get max_vfs */
@@ -417,7 +426,7 @@ rte_pci_scan(void) device_index++;/* we only want to enumerate net & netuio class devices */ if (IsEqualGUID (&(device_info_data.ClassGuid), - &GUID_DEVCLASS_NET ) || + &GUID_DEVCLASS_NET ) ||IsEqualGUID (&(device_info_data.ClassGuid), &GUID_DEVCLASS_NETUIO )) { ret =pci_scan_one (dev_info, &device_info_data);
Signature · 1 line
2.29.0.vfs.0.0
Quoted 69 lines · 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 <[email protected]>---
v4:
* Fix coding style warning with unaligned comments
v3:
* Move the check insidepci_scan_one
* Small change topci_scan_oneto malloc only after checks succeeded v2:
* Truncate commit description lines to 75 charaters or lessdrivers/bus/pci/windows/pci.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)drivers/bus/pci/windows/pci.c +15
-6@@ -308,17 +308,24 @@ set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data,static int pci_scan_one (HDEVINFO dev_info,PSP_DEVINFO_DATA device_info_data) { -struct rte_pci_device *dev; +struct rte_pci_device *dev =NULL ;int ret =-1 ;char pci_device_info[REGSTR_VAL_MAX_HCID_LEN ];struct rte_pci_addr addr;struct rte_pci_id pci_id; - dev =malloc (sizeof (*dev)); -if (dev ==NULL ) + ret =get_device_pci_address (dev_info, device_info_data, &addr); +if (ret !=0 ) goto end; -memset (dev,0 ,sizeof (*dev)); +if (rte_pci_ignore_device (&addr)) { +/* +* We won't add this device, but we want to continue +* looking for supported devices +*/ + ret =ERROR_CONTINUE ; + goto end; + } ret =get_pci_hardware_id (dev_info, device_info_data, pci_device_info,sizeof (pci_device_info));@@ -335,10 +342,12 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data) goto end; } - ret =get_device_pci_address (dev_info, device_info_data, &addr); -if (ret !=0 ) + dev =malloc (sizeof (*dev)); +if (dev ==NULL ) goto end; +memset (dev,0 ,sizeof (*dev)); + dev->addr = addr; dev->id = pci_id; dev->max_vfs =0 ;/* TODO: get max_vfs */
drivers/bus/pci/windows/pci.c rte_pci_scan(void) · line 432
Quoted 8 lines
drivers/bus/pci/windows/pci.c +1
-1@@ -417,7 +426,7 @@ rte_pci_scan(void) device_index++;/* we only want to enumerate net & netuio class devices */ if (IsEqualGUID (&(device_info_data.ClassGuid), - &GUID_DEVCLASS_NET ) || + &GUID_DEVCLASS_NET ) ||IsEqualGUID (&(device_info_data.ClassGuid), &GUID_DEVCLASS_NETUIO )) { ret =pci_scan_one (dev_info, &device_info_data);
This last change appears to be a formatting change. Was it required by checkpatch?
Other than that...
Quoted 22 lines · Ranjit Menon
Quoted 17 lines · 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 <[email protected]>---
v4:
* Fix coding style warning with unaligned comments
v3:
* Move the check insidepci_scan_one
* Small change topci_scan_oneto malloc only after checks succeeded v2:
* Truncate commit description lines to 75 charaters or lessQuoted 3 lines
drivers/bus/pci/windows/pci.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
Quoted 6 lines
This last change appears to be a formatting change. Was it required by checkpatch?
Other than that...
Acked-by Ranjit Menon <[email protected]>
Thanks, Ranjit. Yes, v4 was just some white-space fixes for a CI warning.
2021-02-28 22:52, Khoa To:
Quoted 17 lines
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 <[email protected]>---
v4:
* Fix coding style warning with unaligned comments
v3:
* Move the check insidepci_scan_one
* Small change topci_scan_oneto malloc only after checks succeeded v2:
* Truncate commit description lines to 75 charaters or less
Quoted 2 lines
drivers/bus/pci/windows/pci.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
04/03/2021 08:14, Dmitry Kozlyuk:
Quoted 7 lines
2021-02-28 22:52, Khoa To:
Quoted 6 lines
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.
not-only NetUIO
Quoted 4 lines
Quoted 2 lines
Signed-off-by Khoa To <[email protected]>Acked-by Dmitry Kozlyuk <[email protected]>
Applied with small rewording, thanks.