DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anoob Joseph <anoobj@marvell.com>
To: Ciara Power <ciara.power@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "roy.fan.zhang@intel.com" <roy.fan.zhang@intel.com>,
	Akhil Goyal <gakhil@marvell.com>, "mdr@ashroe.eu" <mdr@ashroe.eu>,
	Declan Doherty <declan.doherty@intel.com>,
	Ankur Dwivedi <adwivedi@marvell.com>,
	Tejasree Kondoj <ktejasree@marvell.com>,
	John Griffin <john.griffin@intel.com>,
	Fiona Trahe <fiona.trahe@intel.com>,
	Deepak Kumar Jain <deepak.k.jain@intel.com>
Subject: RE: [EXT] [PATCH v5 2/5] crypto: use single buffer for asymmetric session
Date: Thu, 10 Feb 2022 14:34:03 +0000	[thread overview]
Message-ID: <SA1PR18MB466187060EA5A565735604A5DF2F9@SA1PR18MB4661.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20220210140153.3439676-3-ciara.power@intel.com>

Hi Ciara,

Minor nit inline. With that

Series Acked-by: Anoob Joseph <anoobj@marvell.com>

Thanks,
Anoob

> -----Original Message-----
> From: Ciara Power <ciara.power@intel.com>
> Sent: Thursday, February 10, 2022 7:32 PM
> To: dev@dpdk.org
> Cc: roy.fan.zhang@intel.com; Akhil Goyal <gakhil@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>; mdr@ashroe.eu; Ciara Power
> <ciara.power@intel.com>; Declan Doherty <declan.doherty@intel.com>; Ankur
> Dwivedi <adwivedi@marvell.com>; Tejasree Kondoj <ktejasree@marvell.com>;
> John Griffin <john.griffin@intel.com>; Fiona Trahe <fiona.trahe@intel.com>;
> Deepak Kumar Jain <deepak.k.jain@intel.com>
> Subject: [EXT] [PATCH v5 2/5] crypto: use single buffer for asymmetric session
> 
> External Email
> 
> ----------------------------------------------------------------------
> Rather than using a session buffer that contains pointers to private
> session data elsewhere, have a single session buffer.
> This session is created for a driver ID, and the mempool element
> contains space for the max session private data needed for any driver.
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
> 
> ---
> v5:
>   - Removed get API for session private data, can be accessed directly.
>   - Modified test application to create a session mempool for
>     TEST_NUM_SESSIONS rather than TEST_NUM_SESSIONS * 2.
>   - Reworded create session function description.
>   - Removed sess parameter from create session trace,
>     to be added in a later patch.
> v4:
>   - Merged asym crypto session clear and free functions.
>   - Reordered some function parameters.
>   - Updated trace function for asym crypto session create.
>   - Fixed cnxk clear, the PMD no longer needs to put private data
>     back into a mempool.
>   - Renamed struct field for max private session size.
>   - Replaced __extension__ with RTE_STD_C11.
>   - Moved some parameter validity checks to before functional code.
>   - Reworded release note.
>   - Removed mempool parameter from session configure function.
>   - Removed docs code additions, these are included due to patch 1
>     changing sample doc to use literal includes.
> v3:
>   - Corrected formatting of struct comments.
>   - Increased size of max_priv_session_sz to uint16_t.
>   - Removed trace for asym session init function that was
>     previously removed.
>   - Added documentation.
> v2:
>   - Renamed function typedef from "free" to "clear" as session private
>     data isn't being freed in that function.
>   - Moved user data API to separate patch.
>   - Minor fixes to comments, formatting, return values.
> ---
>  app/test-crypto-perf/cperf_ops.c             |  14 +-
>  app/test-crypto-perf/cperf_test_throughput.c |   8 +-
>  app/test/test_cryptodev_asym.c               | 272 +++++--------------
>  doc/guides/prog_guide/cryptodev_lib.rst      |  21 +-
>  doc/guides/rel_notes/release_22_03.rst       |   7 +
>  drivers/crypto/cnxk/cn10k_cryptodev_ops.c    |   8 +-
>  drivers/crypto/cnxk/cn9k_cryptodev_ops.c     |   8 +-
>  drivers/crypto/cnxk/cnxk_cryptodev_ops.c     |  22 +-
>  drivers/crypto/cnxk/cnxk_cryptodev_ops.h     |   3 +-
>  drivers/crypto/octeontx/otx_cryptodev_ops.c  |  32 +--
>  drivers/crypto/openssl/rte_openssl_pmd.c     |   4 +-
>  drivers/crypto/openssl/rte_openssl_pmd_ops.c |  24 +-
>  drivers/crypto/qat/qat_asym.c                |  54 +---
>  drivers/crypto/qat/qat_asym.h                |   5 +-
>  lib/cryptodev/cryptodev_pmd.h                |  23 +-
>  lib/cryptodev/cryptodev_trace_points.c       |   9 +-
>  lib/cryptodev/rte_cryptodev.c                | 213 ++++++++-------
>  lib/cryptodev/rte_cryptodev.h                |  97 ++++---
>  lib/cryptodev/rte_cryptodev_trace.h          |  38 ++-
>  lib/cryptodev/version.map                    |   7 +-
>  20 files changed, 315 insertions(+), 554 deletions(-)
> 

[snip]

> diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
> b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
> index a5fb68da02..72f5f1a6fe 100644
> --- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
> +++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
> @@ -658,10 +658,9 @@ void
>  cnxk_ae_session_clear(struct rte_cryptodev *dev,
>  		      struct rte_cryptodev_asym_session *sess)
>  {
> -	struct rte_mempool *sess_mp;
>  	struct cnxk_ae_sess *priv;
> 
> -	priv = get_asym_session_private_data(sess, dev->driver_id);
> +	priv = (struct cnxk_ae_sess *) sess->sess_private_data;
>  	if (priv == NULL)
>  		return;
> 
> @@ -670,40 +669,29 @@ cnxk_ae_session_clear(struct rte_cryptodev *dev,
> 
>  	/* Reset and free object back to pool */
>  	memset(priv, 0, cnxk_ae_session_size_get(dev));
> -	sess_mp = rte_mempool_from_obj(priv);
> -	set_asym_session_private_data(sess, dev->driver_id, NULL);
> -	rte_mempool_put(sess_mp, priv);
>  }
> 
>  int
>  cnxk_ae_session_cfg(struct rte_cryptodev *dev,
>  		    struct rte_crypto_asym_xform *xform,
> -		    struct rte_cryptodev_asym_session *sess,
> -		    struct rte_mempool *pool)
> +		    struct rte_cryptodev_asym_session *sess)
>  {
>  	struct cnxk_cpt_vf *vf = dev->data->dev_private;
>  	struct roc_cpt *roc_cpt = &vf->cpt;
> -	struct cnxk_ae_sess *priv;
> +	struct cnxk_ae_sess *priv =
> +			(struct cnxk_ae_sess *) sess->sess_private_data;

[Anoob] Rest of the code in cnxk follows reverse xmas tree. May be, can you move this up? Or may be just split declaration and assignment and you can retain the existing order?


  reply	other threads:[~2022-02-10 14:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 15:38 [PATCH v4 0/5] crypto: improve asym session usage Ciara Power
2022-02-09 15:38 ` [PATCH v4 1/5] doc: replace asym crypto code with literal includes Ciara Power
2022-02-09 15:38 ` [PATCH v4 2/5] crypto: use single buffer for asymmetric session Ciara Power
2022-02-09 19:52   ` [EXT] " Akhil Goyal
2022-02-09 15:38 ` [PATCH v4 3/5] crypto: hide asym session structure Ciara Power
2022-02-09 15:38 ` [PATCH v4 4/5] crypto: add asym session user data API Ciara Power
2022-02-09 20:09   ` [EXT] " Akhil Goyal
2022-02-09 15:38 ` [PATCH v4 5/5] crypto: modify return value for asym session create Ciara Power
2022-02-09 20:19   ` [EXT] " Akhil Goyal
2022-02-10 14:01 ` [PATCH v5 0/5] crypto: improve asym session usage Ciara Power
2022-02-10 14:01   ` [PATCH v5 1/5] doc: replace asym crypto code with literal includes Ciara Power
2022-02-10 14:01   ` [PATCH v5 2/5] crypto: use single buffer for asymmetric session Ciara Power
2022-02-10 14:34     ` Anoob Joseph [this message]
2022-02-10 14:01   ` [PATCH v5 3/5] crypto: hide asym session structure Ciara Power
2022-02-10 14:01   ` [PATCH v5 4/5] crypto: add asym session user data API Ciara Power
2022-02-10 14:01   ` [PATCH v5 5/5] crypto: modify return value for asym session create Ciara Power
2022-02-10 15:53 ` [PATCH v6 0/5] crypto: improve asym session usage Ciara Power
2022-02-10 15:54   ` [PATCH v6 1/5] doc: replace asym crypto code with literal includes Ciara Power
2022-02-10 16:36     ` Zhang, Roy Fan
2022-02-10 15:54   ` [PATCH v6 2/5] crypto: use single buffer for asymmetric session Ciara Power
2022-02-10 15:54   ` [PATCH v6 3/5] crypto: hide asym session structure Ciara Power
2022-02-10 15:54   ` [PATCH v6 4/5] crypto: add asym session user data API Ciara Power
2022-02-10 15:54   ` [PATCH v6 5/5] crypto: modify return value for asym session create Ciara Power
2022-02-10 22:37   ` [EXT] [PATCH v6 0/5] crypto: improve asym session usage Akhil Goyal
2022-02-11  9:29 ` [PATCH v7 " Ciara Power
2022-02-11  9:29   ` [PATCH v7 1/5] doc: replace asym crypto code with literal includes Ciara Power
2022-02-11  9:29   ` [PATCH v7 2/5] crypto: use single buffer for asymmetric session Ciara Power
2022-02-11  9:29   ` [PATCH v7 3/5] crypto: hide asym session structure Ciara Power
2022-02-11  9:29   ` [PATCH v7 4/5] crypto: add asym session user data API Ciara Power
2022-02-11  9:29   ` [PATCH v7 5/5] crypto: modify return value for asym session create Ciara Power
2022-02-11 14:29   ` [EXT] [PATCH v7 0/5] crypto: improve asym session usage 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=SA1PR18MB466187060EA5A565735604A5DF2F9@SA1PR18MB4661.namprd18.prod.outlook.com \
    --to=anoobj@marvell.com \
    --cc=adwivedi@marvell.com \
    --cc=ciara.power@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=gakhil@marvell.com \
    --cc=john.griffin@intel.com \
    --cc=ktejasree@marvell.com \
    --cc=mdr@ashroe.eu \
    --cc=roy.fan.zhang@intel.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).