src/dpdk/drivers/net/mlx4/mlx4.c
static int
mlx4_args(struct rte_devargs *devargs, struct mlx4_conf *conf)
{
	struct rte_kvargs *kvlist;
	unsigned int arg_count;
	int ret = 0;
	int i;

	if (devargs == NULL)
		return 0;
	kvlist = rte_kvargs_parse(devargs->args, pmd_mlx4_init_params);
	if (kvlist == NULL) {
		rte_errno = EINVAL;
		ERROR("failed to parse kvargs");
		return -rte_errno;
	}
	/* Process parameters. */
	for (i = 0; pmd_mlx4_init_params[i]; ++i) {
		arg_count = rte_kvargs_count(kvlist, pmd_mlx4_init_params[i]);
		while (arg_count-- > 0) {
			ret = rte_kvargs_process(kvlist,
						 pmd_mlx4_init_params[i],
						 (int (*)(const char *,
							  const char *,
							  void *))
						 mlx4_arg_parse,
						 conf);
			if (ret != 0)
				goto free_kvlist;
		}
	}
free_kvlist:
	rte_kvargs_free(kvlist);
	return ret;
}
/**
 * Parse device parameters.
 *
 * @param devargs
 *   Device arguments structure.
 *
 * @return
 *   0 on success, negative errno value otherwise and rte_errno is set.
 */
Parse device parameters.
@param devargs
Device arguments structure.

@return
0 on success, negative errno value otherwise and rte_errno is set.
Parse device parameters . @param devargs Device arguments structure . @return 0 on success negative errno value otherwise and rte_errno is set .
static int
mlx4_args(struct rte_devargs *devargs, struct mlx4_conf *conf)
{
	struct rte_kvargs *kvlist;
	unsigned int arg_count;
	int ret = 0;
	int i;
	if (devargs == NULL)
		return 0;
	kvlist = rte_kvargs_parse(devargs->args, pmd_mlx4_init_params);
	if (kvlist == NULL) {
		rte_errno = EINVAL;
		ERROR("failed to parse kvargs");
		return -rte_errno;
	}
	for (i = 0; pmd_mlx4_init_params[i]; ++i) {
		arg_count = rte_kvargs_count(kvlist, pmd_mlx4_init_params[i]);
		while (arg_count-- > 0) {
			ret = rte_kvargs_process(kvlist,
						 pmd_mlx4_init_params[i],
						 (int (*)(const char *,
							  const char *,
							  void *))
						 mlx4_arg_parse,
						 conf);
			if (ret != 0)
				goto free_kvlist;
		}
	}
free_kvlist:
	rte_kvargs_free(kvlist);
	return ret;
}
static int mlx4_args ( struct rte_devargs * devargs , struct mlx4_conf * conf ) { struct rte_kvargs * kvlist ; unsigned int arg_count ; int ret = 0 ; int i ; if ( devargs == NULL ) return 0 ; kvlist = rte_kvargs_parse ( devargs -> args , pmd_mlx4_init_params ) ; if ( kvlist == NULL ) { rte_errno = EINVAL ; ERROR ( " " ) ; return - rte_errno ; } for ( i = 0 ; pmd_mlx4_init_params [ i ] ; ++ i ) { arg_count = rte_kvargs_count ( kvlist , pmd_mlx4_init_params [ i ] ) ; while ( arg_count -- > 0 ) { ret = rte_kvargs_process ( kvlist , pmd_mlx4_init_params [ i ] , ( int ( * ) ( const char * , const char * , void * ) ) mlx4_arg_parse , conf ) ; if ( ret != 0 ) goto free_kvlist ; } } free_kvlist : rte_kvargs_free ( kvlist ) ; return ret ; }
Parse device parameters.
Parse device parameters .
/* Process parameters. */