Acked-by: Abhinandan Gujjar <abhinandan.guj...@intel.com>
> -----Original Message-----
> From: Volodymyr Fialko <vfia...@marvell.com>
> Sent: Friday, March 25, 2022 4:46 PM
> To: dev@dpdk.org; Gujjar, Abhinandan S <abhinandan.guj...@intel.com>; Akhil
> Goyal <gak...@marvell.com>
> Cc: jer...@marvell.com; Volodymyr Fialko <vfia...@marvell.com>; Anoob
> Joseph <ano...@marvell.com>
> Subject: [PATCH 1/2] security: introduce per session event metadata
>
> Implement API to set/get event data per security session.
>
> Signed-off-by: Volodymyr Fialko <vfia...@marvell.com>
> Acked-by: Akhil Goyal <gak...@marvell.com>
> Acked-by: Anoob Joseph <ano...@marvell.com>
> ---
> .../prog_guide/event_crypto_adapter.rst | 4 +-
> lib/security/rte_security.h | 43 +++++++++++++++++++
> 2 files changed, 45 insertions(+), 2 deletions(-)
>
> diff --git a/doc/guides/prog_guide/event_crypto_adapter.rst
> b/doc/guides/prog_guide/event_crypto_adapter.rst
> index 4fb5c688e0..227b36b4b7 100644
> --- a/doc/guides/prog_guide/event_crypto_adapter.rst
> +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> @@ -246,9 +246,9 @@ by ``rte_cryptodev_sym_session_get_user_data()`` API.
> The RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA capability
> indicates whether HW or SW supports this feature.
>
> -For security session, ``rte_security_session_set_private_data()`` API
> +For security session, ``rte_security_session_set_event_mdata()`` API
> will be used to set request/response data. The same data will be obtained -by
> ``rte_security_session_get_private_data()`` API.
> +by ``rte_security_session_get_event_mdata()`` API.
>
> For session-less it is mandatory to place the request/response data with the
> ``rte_crypto_op``.
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h index
> b080d10c2c..29ec514504 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -526,6 +526,8 @@ struct rte_security_session {
> /**< Private session material */
> uint64_t opaque_data;
> /**< Opaque user defined data */
> + void *event_mdata;
> + /**< Event request/response information */
> };
>
> /**
> @@ -729,6 +731,47 @@ set_sec_session_private_data(struct
> rte_security_session *sess,
> sess->sess_private_data = private_data; }
>
> +/**
> + * Get event meta data attached to a security session.
> + *
> + * @param sess Session pointer allocated by
> + * *rte_security_session_create*.
> + *
> + * @return
> + * - On success return pointer to the event crypto meta data which is set
> + * using *rte_security_session_set_event_mdata*
> + * - On failure returns NULL.
> + */
> +__rte_experimental
> +static inline void *
> +rte_security_session_get_event_mdata(const struct rte_security_session
> +*sess) {
> + return sess->event_mdata;
> +}
> +
> +/**
> + * Attach event crypto meta data to a security session.
> + *
> + * Application can allocate memory for *rte_event_crypto_metadata* and
> +set the
> + * reference pointer using this API which the PMD can retrieve using
> + * *rte_security_session_get_event_mdata*
> + *
> + * The API should be used only in case session is used for event crypto
> + * adapter.
> + *
> + * @param sess Session pointer allocated by
> + * *rte_security_session_create*.
> + * @param ev_mdata Pointer to the event crypto meta data
> + * (aka *union rte_event_crypto_metadata*)
> + */
> +__rte_experimental
> +static inline void
> +rte_security_session_set_event_mdata(struct rte_security_session *sess,
> + void *ev_mdata)
> +{
> + sess->event_mdata = ev_mdata;
> +}
> +
> /**
> * Attach a session to a crypto operation.
> * This API is needed only in case of
> RTE_SECURITY_SESS_CRYPTO_PROTO_OFFLOAD
> --
> 2.25.1