[PATCH v4 1/7] cryptodev: add APIs to get/set event metadata
Anoob Joseph
anoobj at marvell.com
Mon May 2 11:01:06 CEST 2022
Hi Akhil,
Minor nit inline.
With that addressed,
Series Acked-by: Anoob Joseph <anoobj at marvell.com>
Thanks,
Anoob
> -----Original Message-----
> From: Akhil Goyal <gakhil at marvell.com>
> Sent: Monday, May 2, 2022 12:55 AM
> To: dev at dpdk.org
> Cc: Anoob Joseph <anoobj at marvell.com>; Jerin Jacob Kollanukkaran
> <jerinj at marvell.com>; abhinandan.gujjar at intel.com;
> jay.jayatheerthan at intel.com; narender.vangati at intel.com; Volodymyr
> Fialko <vfialko at marvell.com>; Akhil Goyal <gakhil at marvell.com>; Fan Zhang
> <roy.fan.zhang at intel.com>
> Subject: [PATCH v4 1/7] cryptodev: add APIs to get/set event metadata
>
> From: Volodymyr Fialko <vfialko at marvell.com>
>
> Currently, crypto session userdata is used to set event crypto metadata from
> the application and the driver is dereferencing it in driver which is not correct.
> User data is meant to be opaque to the driver.
> To support this, new API is added to get and set event crypto metadata. The
> new API, rte_cryptodev_set_session_event_mdata,
> allows setting event metadata in session private data which is filled inside
> PMD using a new cryptodev op. This operation can be performed on any of
> the PMD supported sessions (sym/asym/security).
> For SW abstraction of event crypto adapter to be used by eventdev library, a
> new field is added in asymmetric crypto session for now and for symmetric
> case, current implementation of using userdata is used. Symmetric cases
> cannot be fixed now, as it will be ABI breakage which will be resolved in DPDK
> 22.11.
>
> Signed-off-by: Volodymyr Fialko <vfialko at marvell.com>
> Signed-off-by: Akhil Goyal <gakhil at marvell.com>
> Acked-by: Fan Zhang <roy.fan.zhang at intel.com>
> ---
> lib/cryptodev/cryptodev_pmd.c | 16 +++++++++++++
> lib/cryptodev/cryptodev_pmd.h | 36 ++++++++++++++++++++++++++++
> lib/cryptodev/rte_cryptodev.c | 44
> +++++++++++++++++++++++++++++++++++
> lib/cryptodev/rte_cryptodev.h | 22 ++++++++++++++++++
> lib/cryptodev/version.map | 4 ++++
> 5 files changed, 122 insertions(+)
>
[snip]
> diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
> index 3500a2d470..5ebc423afa 100644
> --- a/lib/cryptodev/rte_cryptodev.c
> +++ b/lib/cryptodev/rte_cryptodev.c
> @@ -2051,6 +2051,9 @@ rte_cryptodev_asym_session_free(uint8_t dev_id,
> void *sess)
>
> dev->dev_ops->asym_session_clear(dev, sess);
>
> + if (((struct rte_cryptodev_asym_session *)sess)->event_mdata !=
> NULL)
> + rte_free(((struct rte_cryptodev_asym_session *)sess)-
> >event_mdata);
> +
[Anoob] rte_free would do a NULL check. So the other NULL check may not be required.
More information about the dev
mailing list