[dpdk-dev] [PATCH v2 06/15] bus: add configuration interface for buses

Ferruh Yigit ferruh.yigit at intel.com
Mon Sep 4 18:23:50 CEST 2017


On 7/14/2017 10:12 PM, Jan Blunck wrote:
> Signed-off-by: Jan Blunck <jblunck at infradead.org>
> ---
>  lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  1 +
>  lib/librte_eal/common/eal_common_bus.c          | 16 ++++++++++++++++
>  lib/librte_eal/common/include/rte_bus.h         |  9 +++++++++
>  lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
>  4 files changed, 27 insertions(+)
> 

<...>

>  
> +int rte_bus_configure(struct rte_bus *bus, const struct rte_bus_conf *conf)
> +{
> +	if (bus == NULL)
> +		return -1;
> +
> +	/* only set bus scan policy if it was unset before */
> +	if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) {
> +		RTE_LOG(DEBUG, EAL, "Bus [%s] scan_mode=%d\n", bus->name,
> +			conf->scan_mode);
> +		bus->conf.scan_mode = conf->scan_mode;
> +	} else if (bus->conf.scan_mode != conf->scan_mode)
> +		return -1;

Right now "struct rte_bus_conf" has only field "scan_mode", so this
function implemented as set scan_mode is no issue.

But if in the future, "struct rte_bus_conf" extended to have another
field, this same function will be used and this will be confusing.

What do you think make this function rte_bus_configure_scan_mode(), is
it overkill?

> +
> +	return 0;
> +}
> +

<...>


More information about the dev mailing list