DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <akhil.goyal@nxp.com>
To: Anoob Joseph <anoobj@marvell.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>
Cc: Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Narayana Prasad <pathreya@marvell.com>,
	Fiona Trahe <fiona.trahe@intel.com>,
	Shally Verma <shallyv@marvell.com>,
	Sunila Sahu <ssahu@marvell.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 4/8] common/cpt: add helper functions for asymmetric crypto
Date: Tue, 1 Oct 2019 13:04:46 +0000	[thread overview]
Message-ID: <VE1PR04MB6639C8A91C7711E100AB796CE69D0@VE1PR04MB6639.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <1568035687-25492-5-git-send-email-anoobj@marvell.com>

Hi Anoob,
> 
> From: Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>
> 
> Add helper functions to get meta len for asymmetric operations
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Signed-off-by: Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>
> Signed-off-by: Sunila Sahu <ssahu@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	other threads:[~2019-10-01 13:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 13:27 [dpdk-dev] [PATCH 0/8] add asym support in crypto_octeontx PMD Anoob Joseph
2019-09-09 13:28 ` [dpdk-dev] [PATCH 1/8] crypto/octeontx: add device type mailbox routine Anoob Joseph
2019-09-09 13:28 ` [dpdk-dev] [PATCH 2/8] crypto/octeontx: add RSA and modexp asym capabilities Anoob Joseph
2019-10-01 12:38   ` Akhil Goyal
2019-10-02 10:48     ` Anoob Joseph
2019-10-03  8:03       ` Akhil Goyal
2019-09-09 13:28 ` [dpdk-dev] [PATCH 3/8] crypto/octeontx: add asymmetric session operations Anoob Joseph
2019-10-01 12:57   ` Akhil Goyal
2019-10-02 11:18     ` Anoob Joseph
2019-09-09 13:28 ` [dpdk-dev] [PATCH 4/8] common/cpt: add helper functions for asymmetric crypto Anoob Joseph
2019-10-01 13:04   ` Akhil Goyal [this message]
2019-10-02 11:13     ` Anoob Joseph
2019-10-04  7:32       ` Anoob Joseph
2019-09-09 13:28 ` [dpdk-dev] [PATCH 5/8] crypto/octeontx: add asymmetric op enqueue function Anoob Joseph
2019-09-09 13:28 ` [dpdk-dev] [PATCH 6/8] crypto/octeontx: add asymmetric op dequeue function Anoob Joseph
2019-09-09 13:28 ` [dpdk-dev] [PATCH 7/8] app/test: register octeontx PMD to asym testsuite Anoob Joseph
2019-09-09 13:28 ` [dpdk-dev] [PATCH 8/8] doc: update octeontx asymmetric features Anoob Joseph
2019-10-01 13:27   ` Akhil Goyal
2019-10-02 11:04     ` Anoob Joseph
2019-10-03  8:01       ` Akhil Goyal
2019-09-09 15:51 ` [dpdk-dev] [PATCH 0/8] add asym support in crypto_octeontx PMD Shally Verma
2019-10-11 13:01 ` [dpdk-dev] [PATCH v2 0/5] " Anoob Joseph
2019-10-11 13:01   ` [dpdk-dev] [PATCH v2 1/5] crypto/octeontx: add device type mailbox routine Anoob Joseph
2019-10-11 13:01   ` [dpdk-dev] [PATCH v2 2/5] crypto/octeontx: add asymmetric session operations Anoob Joseph
2019-10-11 13:01   ` [dpdk-dev] [PATCH v2 3/5] common/cpt: add helper functions for asymmetric crypto Anoob Joseph
2019-10-11 13:01   ` [dpdk-dev] [PATCH v2 4/5] crypto/octeontx: add asymmetric enqueue/dequeue ops Anoob Joseph
2019-10-11 13:01   ` [dpdk-dev] [PATCH v2 5/5] app/test: register octeontx PMD to asym testsuite Anoob Joseph
2019-10-15 12:46   ` [dpdk-dev] [PATCH v2 0/5] add asym support in crypto_octeontx PMD Akhil Goyal
2019-10-15 13:31     ` Akhil Goyal
2019-10-16  4:57     ` Anoob Joseph
2019-10-16  5:57       ` Akhil Goyal

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=VE1PR04MB6639C8A91C7711E100AB796CE69D0@VE1PR04MB6639.eurprd04.prod.outlook.com \
    --to=akhil.goyal@nxp.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=jerinj@marvell.com \
    --cc=kkotamarthy@marvell.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=pathreya@marvell.com \
    --cc=shallyv@marvell.com \
    --cc=ssahu@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).