> > > +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?
> 
> Yes, good idea, this can be simplified, and can remove
> uadk_compress_priv as well.
> 
> But it looks like rte_compressdev_pmd_create requires the priv data,
> otherwise it will return an error if private_data_size == 0.
> Could rte_compressdev_pmd_create be changed only alloc
> compressdev->data->dev_private only if data_size != 0.
> 
> Or I am checking whether to simply add one priv.

Normally, each PMD need some priv space.
Even you can also add capabilities in it instead of having global variable.

> 
> >
> > 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.
> OK.
> 
> One more question,
> rte_compressdev_pmd_init_params does not have .max_nb_queue_pairs as
> rte_cryptodev_pmd_init_params.
> So dpdk-test-compress-perf  will use 128 queues by default, except
> adding -l 1,2.
> Is this expected?
> 
rte_compressdev_pmd_init_params is internal for PMD-lib interaction and should 
not be used by app.
For application, rte_compressdev_info should be used and it has that 
max_nb_queue_pairs.

Reply via email to