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

Nélio Laranjeiro nelio.laranjeiro at 6wind.com
Wed Jun 22 09:30:42 CEST 2016


On Tue, Jun 21, 2016 at 05:42:42PM +0100, Ferruh Yigit wrote:
> 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;
> 

Good catch, in fact as it is not processed by the PMD itself, it must be
compliant with the rte_kvargs_process().

I will fix in in the v4.

-- 
Nélio Laranjeiro
6WIND


More information about the dev mailing list