DPDK patches and discussions
 help / color / mirror / Atom feed
From: Zhangfei Gao <zhangfei.gao@linaro.org>
To: Akhil Goyal <gakhil@marvell.com>
Cc: Fan Zhang <fanzhang.oss@gmail.com>,
	Ashish Gupta <ashishg@marvell.com>,
	 "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [EXTERNAL] [PATCH 2/3] compress/uadk: support basic operations
Date: Fri, 24 May 2024 22:45:04 +0800	[thread overview]
Message-ID: <CABQgh9EG3JVrDUGuLsK+2kUyuBrAQ=d_b-zikK0NCO8PuOBebg@mail.gmail.com> (raw)
In-Reply-To: <CO6PR18MB44848E2516E8CF79C786F90FD8F52@CO6PR18MB4484.namprd18.prod.outlook.com>

On Fri, 24 May 2024 at 18:20, Akhil Goyal <gakhil@marvell.com> wrote:
>
> > > > +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.

Yes, understand.

>
> >
> > >
> > > 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.
>

Is there a method to configure the max_nb_queue_pairs?
Seems not workable to use RTE_PMD_REGISTER_PARAM_STRING like crypto,
which only sets the init_params, which has no member.
Or have to use a fixed value?

Thanks

  reply	other threads:[~2024-05-24 14:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 14:30 [PATCH 0/3] Introduce UADK compression driver Zhangfei Gao
2024-04-22 14:31 ` [PATCH 1/3] compress/uadk: " Zhangfei Gao
2024-05-23 16:20   ` Stephen Hemminger
2024-05-23 16:30     ` Konstantin Ananyev
2024-05-23 16:42       ` Tyler Retzlaff
2024-05-24  9:43       ` Zhangfei Gao
2024-04-22 14:31 ` [PATCH 2/3] compress/uadk: support basic operations Zhangfei Gao
2024-05-23 15:38   ` [EXTERNAL] " Akhil Goyal
2024-05-24 10:01     ` Zhangfei Gao
2024-05-24 10:20       ` Akhil Goyal
2024-05-24 14:45         ` Zhangfei Gao [this message]
2024-05-24 14:54           ` Akhil Goyal
2024-04-22 14:31 ` [PATCH 3/3] compress/uadk: support burst enqueue/dequeue Zhangfei Gao
2024-05-11  3:05 ` [PATCH 0/3] Introduce UADK compression driver Zhangfei Gao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABQgh9EG3JVrDUGuLsK+2kUyuBrAQ=d_b-zikK0NCO8PuOBebg@mail.gmail.com' \
    --to=zhangfei.gao@linaro.org \
    --cc=ashishg@marvell.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=gakhil@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).