DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Power, Ciara" <ciara.power@intel.com>
To: Akhil Goyal <gakhil@marvell.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Zhang, Roy Fan" <roy.fan.zhang@intel.com>,
	Anoob Joseph <anoobj@marvell.com>,
	"mdr@ashroe.eu" <mdr@ashroe.eu>,
	"Doherty, Declan" <declan.doherty@intel.com>,
	Ankur Dwivedi <adwivedi@marvell.com>,
	"Tejasree Kondoj" <ktejasree@marvell.com>,
	"Griffin, John" <john.griffin@intel.com>,
	"Trahe, Fiona" <fiona.trahe@intel.com>,
	"Jain, Deepak K" <deepak.k.jain@intel.com>
Subject: RE: [EXT] [PATCH v3 1/4] crypto: use single buffer for asymmetric session
Date: Mon, 7 Feb 2022 14:22:31 +0000	[thread overview]
Message-ID: <MN2PR11MB3821E0F08A248EF0D3EB9DA3E62C9@MN2PR11MB3821.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CO6PR18MB4484C3F42BE8AC0724F363B2D82C9@CO6PR18MB4484.namprd18.prod.outlook.com>

Hi Akhil,

Left some replies inline. I will address all other comments in v4.

Thanks,
Ciara

>-----Original Message-----
>From: Akhil Goyal <gakhil@marvell.com>
>Sent: Monday 7 February 2022 08:20
>To: Power, Ciara <ciara.power@intel.com>; dev@dpdk.org
>Cc: Zhang, Roy Fan <roy.fan.zhang@intel.com>; Anoob Joseph
><anoobj@marvell.com>; mdr@ashroe.eu; Doherty, Declan
><declan.doherty@intel.com>; Ankur Dwivedi <adwivedi@marvell.com>;
>Tejasree Kondoj <ktejasree@marvell.com>; Griffin, John
><john.griffin@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>; Jain,
>Deepak K <deepak.k.jain@intel.com>
>Subject: RE: [EXT] [PATCH v3 1/4] crypto: use single buffer for asymmetric
>session
>
>> 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.
>
>This means asymmetric ops are not allowed with scheduler PMD.
>
[CP]  Yes, currently asymmetric isn't supported for scheduler PMD anyway so this shouldn't be an issue for this patchset.
For the approach to be applied to symmetric crypto also in future release, the scheduler PMD would need to be reworked to align with the new session usage.

<snip>
		return NULL;
>> @@ -1919,10 +1957,27 @@ rte_cryptodev_asym_session_create(struct
>> rte_mempool *mp)
>>  		return NULL;
>>  	}
>>
>> +	sess->driver_id = dev->driver_id;
>> +	sess->max_priv_session_sz = pool_priv->max_priv_session_sz;
>> +
>>  	/* Clear device session pointer.
>>  	 * Include the flag indicating presence of private data
>>  	 */
>> -	memset(sess, 0, session_size);
>> +	memset(sess->sess_private_data, 0, session_priv_data_sz);
>> +
>> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops-
>> >asym_session_configure, NULL);
>> +
>> +	if (sess->sess_private_data[0] == 0) {
>> +		ret = dev->dev_ops->asym_session_configure(dev,
>> +							xforms,
>> +							sess, mp);
>
>The mempool object is allocated in the library layer, so why is it need to be
>passed to PMD? PMD cannot get mempool object. Right?

[CP] Yes true, I don't think the mempool needs to be passed to the configure function anymore, same with dev,
these were just used to allocate private session data before I believe. Will remove these parameters altogether instead of leaving as rte_unused.

<snip>
>> -/**
>> - * Initialize asymmetric session on a device with specific asymmetric
>> xform
>> - *
>> - * @param   dev_id   ID of device that we want the session to be used on
>> - * @param   sess     Session to be set up on a device
>> - * @param   xforms   Asymmetric crypto transform operations to apply on
>flow
>> - *                   processed with this session
>> - * @param   mempool  Mempool to be used for internal allocation.
>> - *
>> - * @return
>> - *  - On success, zero.
>> - *  - -EINVAL if input parameters are invalid.
>> - *  - -ENOTSUP if crypto device does not support the crypto transform.
>> - *  - -ENOMEM if the private session could not be allocated.
>> - */
>
>These error numbers should be added in the create() API.
>I guess your subsequent patch is doing that.

[CP] Correct, the 4th patch changes the return values of the create() function and adds these errors numbers. 

<snip>

  reply	other threads:[~2022-02-07 14:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 16:04 [PATCH v3 0/4] crypto: improve asym session usage Ciara Power
2022-02-03 16:04 ` [PATCH v3 1/4] crypto: use single buffer for asymmetric session Ciara Power
2022-02-07  8:19   ` [EXT] " Akhil Goyal
2022-02-07 14:22     ` Power, Ciara [this message]
2022-02-03 16:04 ` [PATCH v3 2/4] crypto: hide asym session structure Ciara Power
2022-02-03 16:04 ` [PATCH v3 3/4] crypto: add asym session user data API Ciara Power
2022-02-07  8:41   ` [EXT] " Akhil Goyal
2022-02-03 16:04 ` [PATCH v3 4/4] crypto: modify return value for asym session create Ciara Power
2022-02-07  9:04   ` [EXT] " Akhil Goyal
2022-02-07 13:02     ` Thomas Monjalon
2022-02-07 14:50     ` Power, Ciara
2022-02-08 20:21       ` 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=MN2PR11MB3821E0F08A248EF0D3EB9DA3E62C9@MN2PR11MB3821.namprd11.prod.outlook.com \
    --to=ciara.power@intel.com \
    --cc=adwivedi@marvell.com \
    --cc=anoobj@marvell.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).