DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <gakhil@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>,
	Anoob Joseph <anoobj@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 v4 2/5] crypto: use single buffer for asymmetric session
Date: Wed, 9 Feb 2022 19:52:36 +0000	[thread overview]
Message-ID: <CO6PR18MB44844F53DFD58008F42DF3AFD82E9@CO6PR18MB4484.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20220209153854.2740455-3-ciara.power@intel.com>

Hi Ciara,
Few minor comments.

> -	/* setup asym session pool */
> -	unsigned int session_size = RTE_MAX(
> -		rte_cryptodev_asym_get_private_session_size(dev_id),
> -		rte_cryptodev_asym_get_header_session_size());
> -	/*
> -	 * Create mempool with TEST_NUM_SESSIONS * 2,
> -	 * to include the session headers
> -	 */
> -	ts_params->session_mpool = rte_mempool_create(
> -				"test_asym_sess_mp",
> -				TEST_NUM_SESSIONS * 2,
> -				session_size,
> -				0, 0, NULL, NULL, NULL,
> -				NULL, SOCKET_ID_ANY,
> -				0);
> +	ts_params->session_mpool =
> rte_cryptodev_asym_session_pool_create(
> +			"test_asym_sess_mp", TEST_NUM_SESSIONS * 2, 0,
> +			SOCKET_ID_ANY);

I believe TEST_NUM_SESSIONS * 2 is no more required.
It can be simply TEST_NUM_SESSIONS.

> 
>  	TEST_ASSERT_NOT_NULL(ts_params->session_mpool,
>  			"session mempool allocation failed");
> @@ -1107,14 +1052,6 @@ test_dh_gen_shared_sec(struct

<snip> 

> @@ -628,16 +626,9 @@ set_sym_session_private_data(struct
> rte_cryptodev_sym_session *sess,
>  }
> 
>  static inline void *
> -get_asym_session_private_data(const struct rte_cryptodev_asym_session
> *sess,
> -		uint8_t driver_id) {
> -	return sess->sess_private_data[driver_id];
> -}
> -
> -static inline void
> -set_asym_session_private_data(struct rte_cryptodev_asym_session *sess,
> -		uint8_t driver_id, void *private_data)
> +get_asym_session_private_data(struct rte_cryptodev_asym_session *sess)
>  {
> -	sess->sess_private_data[driver_id] = private_data;
> +	return sess->sess_private_data;
>  }

I think we can safely remove this get API as well and use sess->sess_private_data
Directly.
Since we are removing set API, get can also be removed as session struct is visible to PMD.

>  /**
>   * Create symmetric crypto session header (generic with no private data)
>   *
> @@ -971,15 +998,19 @@ rte_cryptodev_sym_session_create(struct
> rte_mempool *mempool);
>  /**
>   * Create asymmetric crypto session header (generic with no private data)

This line need an update.


>   *
> - * @param   mempool    mempool to allocate asymmetric session
> - *                     objects from
> + * @param   dev_id   ID of device that we want the session to be used on
> + * @param   xforms   Asymmetric crypto transform operations to apply on flow
> + *                   processed with this session
> + * @param   mp       mempool to allocate asymmetric session
> + *                   objects from
>   * @return
>   *  - On success return pointer to asym-session
>   *  - On failure returns NULL
>   */
>  __rte_experimental
>  struct rte_cryptodev_asym_session *
> -rte_cryptodev_asym_session_create(struct rte_mempool *mempool);
> +rte_cryptodev_asym_session_create(uint8_t dev_id,
> +		struct rte_crypto_asym_xform *xforms, struct rte_mempool
> *mp);

<snip>

> diff --git a/lib/cryptodev/rte_cryptodev_trace.h
> b/lib/cryptodev/rte_cryptodev_trace.h
> index d1f4f069a3..f4e1c870df 100644
> --- a/lib/cryptodev/rte_cryptodev_trace.h
> +++ b/lib/cryptodev/rte_cryptodev_trace.h
> @@ -83,10 +83,22 @@ RTE_TRACE_POINT(
>  	rte_trace_point_emit_u16(sess->user_data_sz);
>  )
> 
> +RTE_TRACE_POINT(
> +	rte_cryptodev_trace_asym_session_pool_create,
> +	RTE_TRACE_POINT_ARGS(const char *name, uint32_t nb_elts,
> +		uint32_t cache_size, void *mempool),
> +	rte_trace_point_emit_string(name);
> +	rte_trace_point_emit_u32(nb_elts);
> +	rte_trace_point_emit_u32(cache_size);
> +	rte_trace_point_emit_ptr(mempool);
> +)
> +
>  RTE_TRACE_POINT(
>  	rte_cryptodev_trace_asym_session_create,
> -	RTE_TRACE_POINT_ARGS(void *mempool,
> -		struct rte_cryptodev_asym_session *sess),
> +	RTE_TRACE_POINT_ARGS(uint8_t dev_id, void *xforms,
> +		void *mempool, struct rte_cryptodev_asym_session *sess),

Sess is not an argument to sess_create API yet. This would be updated in your later patch.

> +	rte_trace_point_emit_u8(dev_id);
> +	rte_trace_point_emit_ptr(xforms);
>  	rte_trace_point_emit_ptr(mempool);
>  	rte_trace_point_emit_ptr(sess);
>  )


  reply	other threads:[~2022-02-09 19:52 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   ` Akhil Goyal [this message]
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     ` [EXT] " Anoob Joseph
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=CO6PR18MB44844F53DFD58008F42DF3AFD82E9@CO6PR18MB4484.namprd18.prod.outlook.com \
    --to=gakhil@marvell.com \
    --cc=adwivedi@marvell.com \
    --cc=anoobj@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=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).