[dpdk-dev] [PATCH v5 1/1] bus/pci: optimise scanning with whitelist/blacklist
David Marchand
david.marchand at redhat.com
Mon May 11 16:59:00 CEST 2020
On Sat, May 2, 2020 at 9:42 AM Sunil Kumar Kori <skori at marvell.com> wrote:
>
> rte_bus_scan API scans all the available PCI devices irrespective of white
> or black listing parameters then further devices are probed based on white
> or black listing parameters. So unnecessary CPU cycles are wasted during
> rte_pci_scan.
>
> For Octeontx2 platform with core frequency 2.4 Ghz, rte_bus_scan consumes
> around 26ms to scan around 90 PCI devices but all may not be used by the
> application. So for the application which uses 2 NICs, rte_bus_scan
> consumes few microseconds and rest time is saved with this patch.
>
> Patch restricts devices to be scanned as per below mentioned conditions:
> - All devices will be scanned if no parameters are passed.
> - Only white listed devices will be scanned if white list is available.
> - All devices, except black listed, will be scanned if black list is
> available.
>
> Signed-off-by: Sunil Kumar Kori <skori at marvell.com>
Acked-by: Gaetan Rivet <grive at u256.net>
> diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h
> index a205d4d9f..3a9da7322 100644
> --- a/drivers/bus/pci/private.h
> +++ b/drivers/bus/pci/private.h
> @@ -42,6 +42,17 @@ int rte_pci_scan(void);
> void
> pci_name_set(struct rte_pci_device *dev);
>
> +/**
> + * Validate whether a device with given pci address should be ignored or not.
PCI address
> + *
> + * @param pci_addr
> + * PCI address of device to be validated
> + * @return
> + * 1: if device is to be ignored,
> + * 0: if device is to be scanned,
On Sat, May 2, 2020 at 9:42 AM Sunil Kumar Kori <skori at marvell.com> wrote:
> diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h
> index a205d4d9f..3a9da7322 100644
> --- a/drivers/bus/pci/private.h
> +++ b/drivers/bus/pci/private.h
> @@ -42,6 +42,17 @@ int rte_pci_scan(void);
> void
> pci_name_set(struct rte_pci_device *dev);
>
> +/**
> + * Validate whether a device with given pci address should be ignored or not.
> + *
> + * @param pci_addr
> + * PCI address of device to be validated
> + * @return
> + * 1: if device is to be ignored,
> + * 0: if device is to be scanned,
true/false
> + */
> +bool rte_pci_ignore_device(const struct rte_pci_addr *pci_addr);
> +
> /**
> * Add a PCI device to the PCI Bus (append to PCI Device list). This function
> * also updates the bus references of the PCI Device (and the generic device
Applied, thanks.
--
David Marchand
More information about the dev
mailing list