Hi Anoob,
> 
> From: Kanaka Durga Kotamarthy <kkotamar...@marvell.com>
> 
> Add helper functions to get meta len for asymmetric operations
> 
> Signed-off-by: Anoob Joseph <ano...@marvell.com>
> Signed-off-by: Kanaka Durga Kotamarthy <kkotamar...@marvell.com>
> Signed-off-by: Sunila Sahu <ss...@marvell.com>
> ---

<snip>

> diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
> b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
> index ad64bf4..0543494 100644
> --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
> +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c
> @@ -412,24 +412,34 @@ otx_cpt_metabuf_mempool_create(const struct
> rte_cryptodev *dev,
>                              int nb_elements)
>  {
>       char mempool_name[RTE_MEMPOOL_NAMESIZE];
> -     int sg_mlen, lb_mlen, max_mlen, ret;
>       struct cpt_qp_meta_info *meta_info;
>       struct rte_mempool *pool;
> +     int max_mlen = 0;
> +     int sg_mlen = 0;
> +     int lb_mlen = 0;
> +     int ret;
> 
> -     /* Get meta len for scatter gather mode */
> -     sg_mlen = cpt_pmd_ops_helper_get_mlen_sg_mode();
> +     if (dev->feature_flags & RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO) {
> 
> -     /* Extra 32B saved for future considerations */
> -     sg_mlen += 4 * sizeof(uint64_t);
> +             /* Get meta len for scatter gather mode */
> +             sg_mlen = cpt_pmd_ops_helper_get_mlen_sg_mode();
> 
> -     /* Get meta len for linear buffer (direct) mode */
> -     lb_mlen = cpt_pmd_ops_helper_get_mlen_direct_mode();
> +             /* Extra 32B saved for future considerations */
> +             sg_mlen += 4 * sizeof(uint64_t);
> 
> -     /* Extra 32B saved for future considerations */
> -     lb_mlen += 4 * sizeof(uint64_t);
> +             /* Get meta len for linear buffer (direct) mode */
> +             lb_mlen = cpt_pmd_ops_helper_get_mlen_direct_mode();
> 
> -     /* Check max requirement for meta buffer */
> -     max_mlen = RTE_MAX(lb_mlen, sg_mlen);
> +             /* Extra 32B saved for future considerations */
> +             lb_mlen += 4 * sizeof(uint64_t);
> +
> +             /* Check max requirement for meta buffer */
> +             max_mlen = RTE_MAX(lb_mlen, sg_mlen);
> +     } else if (dev->feature_flags &
> RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO) {
> +
> +             /* Get meta len for asymmetric operations */
> +             max_mlen = cpt_pmd_ops_helper_asym_get_mlen();
> +     }

I am not sure how this is working.
In your octeontx device, you will have both RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO
and RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO will be set together. So it will not go 
in else
in any case.
Please check in rest of the PMD also if this assumption is made somewhere else 
also.

> 
>       /* Allocate mempool */
> 
> --
> 2.7.4

Reply via email to