[dpdk-dev] [PATCH v5 7/7] eal: allow probing a device again

Shreyansh Jain shreyansh.jain at nxp.com
Tue Oct 16 12:40:58 CEST 2018


On Monday 15 October 2018 02:17 AM, Thomas Monjalon wrote:
> In the devargs syntax for device representors, it is possible to add
> several devices at once: -w dbdf,representor=[0-3]
> It will become a more frequent case when introducing wildcards
> and ranges in the new devargs syntax.
> 
> If a devargs string is provided for probing, and updated with a bigger
> range for a new probing, then we do not want it to fail because
> part of this range was already probed previously.
> There can be new ports to create from an existing rte_device.
> 
> That's why the check for an already probed device
> is moved as bus responsibility.
> In the case of vdev, a global check is kept in insert_vdev(),
> assuming that a vdev will always have only one port.
> In the case of ifpga and vmbus, already probed devices are checked.
> In the case of NXP buses, the probing is done only once (no hotplug),
> though a check is added at bus level for consistency.
> In the case of PCI, a driver flag is added to allow PMD probing again.
> Only the PMD knows the ports attached to one rte_device.
> 
> As another consequence of being able to probe in several steps,
> the field rte_device.devargs must not be considered as a full
> representation of the rte_device, but only the latest probing args.
> Anyway, the field rte_device.devargs is used only for probing.
> 
> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> Reviewed-by: Andrew Rybchenko <arybchenko at solarflare.com>
> Tested-by: Andrew Rybchenko <arybchenko at solarflare.com>
> ---
>   drivers/bus/dpaa/dpaa_bus.c             |  3 +++
>   drivers/bus/fslmc/fslmc_bus.c           |  3 +++
>   drivers/bus/ifpga/ifpga_bus.c           | 14 ++++++-----
>   drivers/bus/pci/pci_common.c            | 33 ++++++++++++++++---------
>   drivers/bus/pci/rte_bus_pci.h           |  4 ++-
>   drivers/bus/vdev/vdev.c                 |  5 ++++
>   lib/librte_eal/common/eal_common_dev.c  |  7 ++----
>   lib/librte_eal/common/include/rte_dev.h |  2 +-
>   8 files changed, 47 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
> index 138e0f98d..89d1e415d 100644
> --- a/drivers/bus/dpaa/dpaa_bus.c
> +++ b/drivers/bus/dpaa/dpaa_bus.c
> @@ -555,6 +555,9 @@ rte_dpaa_bus_probe(void)
>   			if (ret)
>   				continue;
>   
> +			if (rte_dev_is_probed(&dev->device))
> +				continue;
> +
>   			if (!drv->probe ||
>   			    (dev->device.devargs &&
>   			    dev->device.devargs->policy == RTE_DEV_BLACKLISTED))
> diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
> index 960f55071..7ebd980aa 100644
> --- a/drivers/bus/fslmc/fslmc_bus.c
> +++ b/drivers/bus/fslmc/fslmc_bus.c
> @@ -386,6 +386,9 @@ rte_fslmc_probe(void)
>   			if (!drv->probe)
>   				continue;
>   
> +			if (rte_dev_is_probed(&dev->device))
> +				continue;
> +
>   			if (dev->device.devargs &&
>   			  dev->device.devargs->policy == RTE_DEV_BLACKLISTED) {
>   				DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping",

For the dpaa/fslmc part of this patch:

Acked-by: Shreyansh Jain <shreyansh.jain at nxp.com>


More information about the dev mailing list