* [dpdk-dev] [PATCH] bus/pci/windows: support for PCI scan allowed and blocked lists @ 2021-02-18 5:40 Khoa To 2021-02-18 18:40 ` [dpdk-dev] [PATCH v2] " Khoa To 0 siblings, 1 reply; 10+ messages in thread From: Khoa To @ 2021-02-18 5:40 UTC (permalink / raw) To: dev; +Cc: dmitry.kozliuk, pallavi.kadam From: Khoa To <khot@microsoft.com> 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@microsoft.com> --- 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++; -- 2.29.0.vfs.0.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH v2] bus/pci/windows: support for PCI scan allowed and blocked lists 2021-02-18 5:40 [dpdk-dev] [PATCH] bus/pci/windows: support for PCI scan allowed and blocked lists Khoa To @ 2021-02-18 18:40 ` Khoa To 2021-02-18 18:53 ` Ranjit Menon 2021-03-01 6:22 ` [dpdk-dev] [PATCH v3] " Khoa To 0 siblings, 2 replies; 10+ messages in thread From: Khoa To @ 2021-02-18 18:40 UTC (permalink / raw) To: dev; +Cc: dmitry.kozliuk, pallavi.kadam 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++; -- 2.29.0.vfs.0.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] bus/pci/windows: support for PCI scan allowed and blocked lists 2021-02-18 18:40 ` [dpdk-dev] [PATCH v2] " Khoa To @ 2021-02-18 18:53 ` Ranjit Menon 2021-02-18 21:23 ` Dmitry Kozlyuk 2021-03-01 6:22 ` [dpdk-dev] [PATCH v3] " Khoa To 1 sibling, 1 reply; 10+ messages in thread From: Ranjit Menon @ 2021-02-18 18:53 UTC (permalink / raw) To: Khoa To, dev; +Cc: dmitry.kozliuk, pallavi.kadam 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. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] bus/pci/windows: support for PCI scan allowed and blocked lists 2021-02-18 18:53 ` Ranjit Menon @ 2021-02-18 21:23 ` Dmitry Kozlyuk 0 siblings, 0 replies; 10+ messages in thread From: Dmitry Kozlyuk @ 2021-02-18 21:23 UTC (permalink / raw) To: Ranjit Menon; +Cc: Khoa To, dev, pallavi.kadam 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(). ^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH v3] bus/pci/windows: support for PCI scan allowed and blocked lists 2021-02-18 18:40 ` [dpdk-dev] [PATCH v2] " Khoa To 2021-02-18 18:53 ` Ranjit Menon @ 2021-03-01 6:22 ` Khoa To 2021-03-01 6:52 ` [dpdk-dev] [PATCH v4] " Khoa To 1 sibling, 1 reply; 10+ messages in thread From: Khoa To @ 2021-03-01 6:22 UTC (permalink / raw) To: dev; +Cc: dmitry.kozliuk, pallavi.kadam 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> --- 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(-) diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index f66258452..968c7818b 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -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); -- 2.29.0.vfs.0.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH v4] bus/pci/windows: support for PCI scan allowed and blocked lists 2021-03-01 6:22 ` [dpdk-dev] [PATCH v3] " Khoa To @ 2021-03-01 6:52 ` Khoa To 2021-03-04 0:21 ` Ranjit Menon 2021-03-04 7:14 ` Dmitry Kozlyuk 0 siblings, 2 replies; 10+ messages in thread From: Khoa To @ 2021-03-01 6:52 UTC (permalink / raw) To: dev; +Cc: dmitry.kozliuk, pallavi.kadam 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> --- 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(-) diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index f66258452..0d184f24d 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -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); -- 2.29.0.vfs.0.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v4] bus/pci/windows: support for PCI scan allowed and blocked lists 2021-03-01 6:52 ` [dpdk-dev] [PATCH v4] " Khoa To @ 2021-03-04 0:21 ` Ranjit Menon 2021-03-04 0:26 ` Khoa To 2021-03-04 7:14 ` Dmitry Kozlyuk 1 sibling, 1 reply; 10+ messages in thread From: Ranjit Menon @ 2021-03-04 0:21 UTC (permalink / raw) To: Khoa To, dev; +Cc: dmitry.kozliuk, pallavi.kadam On 2/28/2021 10:52 PM, 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> > --- > 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(-) > > diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c > index f66258452..0d184f24d 100644 > --- a/drivers/bus/pci/windows/pci.c > +++ b/drivers/bus/pci/windows/pci.c > @@ -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); This last change appears to be a formatting change. Was it required by checkpatch? Other than that... Acked-by: Ranjit Menon <ranjit.menon@intel.com> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v4] bus/pci/windows: support for PCI scan allowed and blocked lists 2021-03-04 0:21 ` Ranjit Menon @ 2021-03-04 0:26 ` Khoa To 0 siblings, 0 replies; 10+ messages in thread From: Khoa To @ 2021-03-04 0:26 UTC (permalink / raw) To: Ranjit Menon; +Cc: Khoa To, dev, dmitry.kozliuk, pallavi.kadam On Wed, 3 Mar 2021, Ranjit Menon wrote: > On 2/28/2021 10:52 PM, 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> >> --- >> 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(-) >> > > This last change appears to be a formatting change. Was it required by > checkpatch? > > Other than that... > > Acked-by: Ranjit Menon <ranjit.menon@intel.com> > Thanks, Ranjit. Yes, v4 was just some white-space fixes for a CI warning. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v4] bus/pci/windows: support for PCI scan allowed and blocked lists 2021-03-01 6:52 ` [dpdk-dev] [PATCH v4] " Khoa To 2021-03-04 0:21 ` Ranjit Menon @ 2021-03-04 7:14 ` Dmitry Kozlyuk 2021-03-16 21:35 ` Thomas Monjalon 1 sibling, 1 reply; 10+ messages in thread From: Dmitry Kozlyuk @ 2021-03-04 7:14 UTC (permalink / raw) To: Khoa To; +Cc: dev, pallavi.kadam 2021-02-28 22:52, 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 <khot@linux.microsoft.com> > --- > 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(-) Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v4] bus/pci/windows: support for PCI scan allowed and blocked lists 2021-03-04 7:14 ` Dmitry Kozlyuk @ 2021-03-16 21:35 ` Thomas Monjalon 0 siblings, 0 replies; 10+ messages in thread From: Thomas Monjalon @ 2021-03-16 21:35 UTC (permalink / raw) To: Khoa To; +Cc: dev, pallavi.kadam, Dmitry Kozlyuk, talshn 04/03/2021 08:14, Dmitry Kozlyuk: > 2021-02-28 22:52, 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. not-only NetUIO > > > > Signed-off-by: Khoa To <khot@linux.microsoft.com> > > Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Applied with small rewording, thanks. ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2021-03-16 21:35 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-02-18 5:40 [dpdk-dev] [PATCH] bus/pci/windows: support for PCI scan allowed and blocked lists Khoa To 2021-02-18 18:40 ` [dpdk-dev] [PATCH v2] " Khoa To 2021-02-18 18:53 ` Ranjit Menon 2021-02-18 21:23 ` Dmitry Kozlyuk 2021-03-01 6:22 ` [dpdk-dev] [PATCH v3] " Khoa To 2021-03-01 6:52 ` [dpdk-dev] [PATCH v4] " Khoa To 2021-03-04 0:21 ` Ranjit Menon 2021-03-04 0:26 ` Khoa To 2021-03-04 7:14 ` Dmitry Kozlyuk 2021-03-16 21:35 ` Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).