[dpdk-dev] [PATCH v3 11/25] mlx5: add support for configuration through kvargs

Ferruh Yigit ferruh.yigit at intel.com
Tue Jun 21 18:42:42 CEST 2016


On 6/21/2016 8:23 AM, Nelio Laranjeiro wrote:
> The intent is to replace the remaining compile-time options and environment
> variables with a common mean of runtime configuration. This commit only
> adds the kvargs handling code, subsequent commits will update the rest.
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
> ---

...

> +static int
> +mlx5_args_check(const char *key, const char *val, void *opaque)
> +{
> +	struct priv *priv = opaque;
> +
> +	/* No parameters are expected at the moment. */
> +	(void)priv;
> +	(void)val;
> +	WARN("%s: unknown parameter", key);
> +	return EINVAL;
Returning positive value here will prevent rte_kvargs_process() to fail,
I guess that is the intention but returning EINVAL is misleading.

Also generating the checkpatch warning:
WARNING:USE_NEGATIVE_ERRNO: return of an errno should typically be
negative (ie: return -EINVAL)
#71: FILE: drivers/net/mlx5/mlx5.c:264:
+       return EINVAL;




More information about the dev mailing list