[PATCH v1] bbdev: allow operation type enum for growth
Chautru, Nicolas
nicolas.chautru at intel.com
Fri Jun 17 18:12:22 CEST 2022
> From: Thomas Monjalon <thomas at monjalon.net>
>
> This solution is what I proposed to the techboard some years ago, but the
> preference was to completely remove the MAX values.
>
Thanks, good to see you had similar thought! I don't believe there is an actual recommendation captured in term of how to remove completely MAX values in that case below. I believe that this option is still compatible with the spirit of keeping AB future proof.
>
> 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.
Yes will do this.
>
> > @@ -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.
>
OK
More information about the dev
mailing list