DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Nicolas Chautru <nicolas.chautru@intel.com>
Cc: dev@dpdk.org, maxime.coquelin@redhat.com, trix@redhat.com,
	mdr@ashroe.eu, bruce.richardson@intel.com,
	hemant.agrawal@nxp.com, david.marchand@redhat.com,
	stephen@networkplumber.org, techboard@dpdk.org
Subject: Re: [PATCH v1] bbdev: allow operation type enum for growth
Date: Fri, 17 Jun 2022 10:21:36 +0200	[thread overview]
Message-ID: <6579285.Sb9uPGUboI@thomas> (raw)
In-Reply-To: <1655144675-14363-2-git-send-email-nicolas.chautru@intel.com>

This solution is what I proposed to the techboard some years ago,
but the preference was to completely remove the MAX values.


13/06/2022 20:24, Nicolas Chautru:
> Updating the last enum for rte_bbdev_op_type
> to allow for enum insertion.

Please explain that the reason is to keep ABI compatible,
and you want to keep the MAX value for array needs.

> --- a/lib/bbdev/rte_bbdev.c
> +++ b/lib/bbdev/rte_bbdev.c
> @@ -1122,7 +1122,10 @@ struct rte_mempool *
>  		"RTE_BBDEV_OP_TURBO_DEC",
>  		"RTE_BBDEV_OP_TURBO_ENC",
>  		"RTE_BBDEV_OP_LDPC_DEC",
> -		"RTE_BBDEV_OP_LDPC_ENC",
> +		"RTE_BBDEV_OP_RESERVED_1",
> +		"RTE_BBDEV_OP_RESERVED_2",
> +		"RTE_BBDEV_OP_RESERVED_3",
> +		"RTE_BBDEV_OP_RESERVED_4",

As Stephen said, you should make sure that using these values
with the API functions will lead to a clear and expected error.

> @@ -748,7 +748,7 @@ enum rte_bbdev_op_type {
>  	RTE_BBDEV_OP_TURBO_ENC,  /**< Turbo encode */
>  	RTE_BBDEV_OP_LDPC_DEC,  /**< LDPC decode */
>  	RTE_BBDEV_OP_LDPC_ENC,  /**< LDPC encode */
> -	RTE_BBDEV_OP_TYPE_COUNT,  /**< Count of different op types */
> +	RTE_BBDEV_OP_TYPE_COUNT = 8,  /**< Count of different op types */

You must update the comment to explain there may be a padding,
it is not exactly the count.
Maybe "MAX" is a better fit than "COUNT" in this case.



  parent reply	other threads:[~2022-06-17  8:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13 18:24 Nicolas Chautru
2022-06-13 18:24 ` Nicolas Chautru
2022-06-13 19:48   ` Stephen Hemminger
2022-06-13 20:19     ` Chautru, Nicolas
2022-06-17  8:21   ` Thomas Monjalon [this message]
2022-06-17 16:12     ` Chautru, Nicolas
2022-06-23 16:09     ` Ray Kinsella

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=6579285.Sb9uPGUboI@thomas \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mdr@ashroe.eu \
    --cc=nicolas.chautru@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=techboard@dpdk.org \
    --cc=trix@redhat.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).