[dpdk-dev] [PATCH v4 4/5] bus: add device arguments name parsing API

Thomas Monjalon thomas at monjalon.net
Mon Apr 12 23:16:37 CEST 2021


10/04/2021 16:23, Xueming Li:
> +	/* Resolve devarg's name. */

s/devarg's name/devargs name/

> +	if (bus && bus->devargs_parse)

Please make checks explicits with != NULL

> +		ret = bus->devargs_parse(devargs);
> +	else if (layers[0].kvlist != NULL)
> +		ret = devargs_bus_parse_default(devargs, layers[0].kvlist);
[...]
> +/**
> + * Parse device arguments, setting the device name in the devargs as a result.

It should be
"
Parse bus part of the device arguments.

The field name of the struct rte_devargs will be set.
"

> + *
> + * On error rte_errno is set.

This sentence can be below  (in @return section).

> + *
> + * @param da
> + *	Pointer to the devargs to parse.
> + *	The 'bus_str' field must be set.

Why "must"?
It should be optional, so this sentence should be removed.

> + *
> + * @return
> + *	0 on successful parsing.
> + *	-EINVAL: on parsing error.
> + *	-ENODEV: if no key matching a device argument is specified.
> + *	-E2BIG: device name is too long.
> + */
> +typedef int (*rte_bus_devargs_parse_t)(struct rte_devargs *da);

[...]
> +	rte_bus_devargs_parse_t devargs_parse; /**< Parse device arguments */

Should be "Parse bus devargs"





More information about the dev mailing list