[EXTERNAL] [PATCH 2/3] compress/uadk: support basic operations

Akhil Goyal gakhil at marvell.com
Thu May 23 17:38:06 CEST 2024


Hi Zhangfei,

Overall, a well written driver.
Please see below comment.

> +static int
> +uadk_compress_pmd_config(struct rte_compressdev *dev,
> +			 struct rte_compressdev_config *config)
> +{
> +	char mp_name[RTE_MEMPOOL_NAMESIZE];
> +	struct uadk_compress_priv *priv;
> +	struct rte_mempool *mp;
> +	int ret;
> +
> +	if (dev == NULL || config == NULL)
> +		return -EINVAL;
> +
> +	snprintf(mp_name, RTE_MEMPOOL_NAMESIZE,
> +		 "stream_mp_%u", dev->data->dev_id);
> +	priv = dev->data->dev_private;
> +
> +	/* alloc resources */
> +	ret = wd_comp_env_init(NULL);
> +	if (ret < 0)
> +		return -EINVAL;
> +
> +	mp = priv->mp;
> +	if (mp == NULL) {
> +		mp = rte_mempool_create(mp_name,
> +					config->max_nb_priv_xforms +
> +					config->max_nb_streams,
> +					sizeof(struct uadk_stream),
> +					0, 0, NULL, NULL, NULL,
> +					NULL, config->socket_id, 0);
> +		if (mp == NULL) {
> +			UADK_LOG(ERR, "Cannot create private xform pool on
> socket %d\n",
> +				 config->socket_id);
> +			ret = -ENOMEM;
> +			goto err_mempool;
> +		}
> +		priv->mp = mp;
> +	}

Do you really need a mempool here? It is for uadk_stream which is just struct of pointer and an enum.
It can simply be rte_malloc. 
And even you do not need uadk_compress_priv.
This can be simplified. Right?

Also remove the execution part of documentation from 1/3 and add it in 3/3
Since the PMD is complete in 3/3, release notes and execution part of documentation should be in last patch.



More information about the dev mailing list