[dpdk-dev] [PATCH v3] ethdev: report error on name truncation

Thomas Monjalon thomas at monjalon.net
Thu Jan 17 16:38:54 CET 2019


17/01/2019 15:13, Nithin Kumar Dabilpuram:
> Currently this api doesn't report error if name is
> truncated and so user is not sure about uniqueness
> of name. This change reports error to help user.
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram at marvell.com>
> ---
> +	rc = snprintf(z_name, sizeof(z_name), "eth_p%d_q%d_%s",
> +		      dev->data->port_id, queue_id, ring_name);
> +
> +	if (rc >= RTE_MEMZONE_NAMESIZE) {
> +		RTE_ETHDEV_LOG(ERR, "ring name too long\n");
> +		rte_errno = ENAMETOOLONG;
> +		return NULL;
> +	}

Usually we don't insert a blank line before a test of a return value.
It's really a nitpick, so Ferruh, it's up to you to keep it or not when applying.

Acked-by: Thomas Monjalon <thomas at monjalon.net>




More information about the dev mailing list