[dpdk-dev] [PATCHv5 04/33] bus/fslmc: introducing fsl-mc bus driver

Ferruh Yigit ferruh.yigit at intel.com
Thu Jan 19 20:08:40 CET 2017


On 1/19/2017 1:23 PM, Hemant Agrawal wrote:
> The fslmc bus driver is a rte_bus driver which scans the fsl-mc bus
> for NXP DPAA2 SoCs.
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
> ---

<...>

> +#
> +# library name
> +#
> +LIB = librte_pmd_fslmcbus.a

Since now there is a bus folder/driver, what do you think nameming
library with librte_bus_ prefix, like: librte_bus_fslmc.a

<...>

> +
> +static int
> +rte_fslmc_probe(void)
> +{
> +	int ret = -1;

If any bus->probe() fails, rte_bus_probe() breaks and returns error,
which cause app to exit.
Here if there is no device or driver in the bus, function is returning
error, I guess it should be returning zero for this case.

> +	struct rte_dpaa2_device *dev;
> +	struct rte_dpaa2_driver *drv;
> +
> +	TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) {
> +		TAILQ_FOREACH(drv, &rte_fslmc_bus.driver_list, next) {
> +			ret = rte_fslmc_match(drv, dev);
> +			if (ret)
> +				continue;
> +
> +			if (!drv->probe)
> +				continue;
> +
> +			ret = drv->probe(drv, dev);
> +			if (ret)
> +				FSLMC_BUS_LOG(ERR, "Unable to probe.\n");
> +			break;
> +		}
> +	}
> +	return ret;
> +}

<...>


More information about the dev mailing list