DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Gujjar, Abhinandan S" <abhinandan.gujjar@intel.com>
To: Akhil Goyal <gakhil@marvell.com>,
	Volodymyr Fialko <vfialko@marvell.com>,
	 "dev@dpdk.org" <dev@dpdk.org>,
	"Jayatheerthan, Jay" <jay.jayatheerthan@intel.com>,
	"Vangati, Narender" <narender.vangati@intel.com>
Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	Anoob Joseph <anoobj@marvell.com>
Subject: RE: [PATCH 1/2] security: introduce per session event metadata
Date: Mon, 4 Apr 2022 10:42:37 +0000	[thread overview]
Message-ID: <PH0PR11MB48247DBE5F69F2B1AA22C66AE8E59@PH0PR11MB4824.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CO6PR18MB4484A7EE0B49008E78819887D8E59@CO6PR18MB4484.namprd18.prod.outlook.com>

+ @Jayatheerthan, Jay & @Vangati, Narender

> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Monday, April 4, 2022 3:19 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; Volodymyr Fialko
> <vfialko@marvell.com>; dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>
> Subject: RE: [PATCH 1/2] security: introduce per session event metadata
> 
> Hi Abhinandan,
> > ----------------------------------------------------------------------
> > Acked-by: Abhinandan Gujjar <Abhinandan.gujjar@intel.com>
> >
> This change would be an ABI breakage. So to avoid that, we are planning to
> Propose a better solution compared to this patch.
> We plan to add a new cryptodev op to set the event metadata. A single API
> which can be used in all cases - sym/asym/security sessions.
> 
> As currently in case of sym crypto, userdata is being used for storing the event
> Metadata and it is then dereferenced in the PMD which is wrong.
> User data is meant only for user to use and PMD should not dereference it.
> 
> Hence a new cryptodev op can be used to set session event metadata explicitly
> if event mode is enabled.
> 
> I will be sending the proposal soon. Would need your help in testing the Intel
> usecases.
> 
> Regards,
> Akhil
> > > -----Original Message-----
> > > From: Volodymyr Fialko <vfialko@marvell.com>
> > > Sent: Friday, March 25, 2022 4:46 PM
> > > To: dev@dpdk.org; Gujjar, Abhinandan S
> > > <abhinandan.gujjar@intel.com>;
> > Akhil
> > > Goyal <gakhil@marvell.com>
> > > Cc: jerinj@marvell.com; Volodymyr Fialko <vfialko@marvell.com>;
> > > Anoob Joseph <anoobj@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 <vfialko@marvell.com>
> > > Acked-by: Akhil Goyal <gakhil@marvell.com>
> > > Acked-by: Anoob Joseph <anoobj@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


  reply	other threads:[~2022-04-04 10:42 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 11:16 [PATCH 0/2] Session crypto event metadata api Volodymyr Fialko
2022-03-25 11:16 ` [PATCH 1/2] security: introduce per session event metadata Volodymyr Fialko
2022-04-04  8:38   ` Gujjar, Abhinandan S
2022-04-04  9:48     ` Akhil Goyal
2022-04-04 10:42       ` Gujjar, Abhinandan S [this message]
2022-04-13  7:13         ` Akhil Goyal
2022-04-18 19:36           ` Akhil Goyal
2022-03-25 11:16 ` [PATCH 2/2] crypto/cnxk: support for security session enqueue Volodymyr Fialko
2022-04-18 19:33 ` [PATCH v2 0/7] Add new cryptodev op for event metadata Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 1/7] cryptodev: add APIs to get/set " Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 2/7] crypto/cnxk: add event metadata set operation Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 3/7] crypto/octeontx: use new API for event metadata Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 4/7] test/event: use new API to set event crypto metadata Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 5/7] eventdev: use new API to get " Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 6/7] test/event: add asymmetric cases for crypto adapter Akhil Goyal
2022-04-18 19:33   ` [PATCH v2 7/7] test-eventdev: support asym ops " Akhil Goyal
2022-04-21 14:37   ` [PATCH v3 0/7] Add new cryptodev op for event metadata Akhil Goyal
2022-04-21 14:37     ` [PATCH v3 1/7] cryptodev: add APIs to get/set " Akhil Goyal
2022-04-27 15:38       ` Zhang, Roy Fan
2022-04-28 14:42       ` Gujjar, Abhinandan S
2022-04-29 12:16         ` Akhil Goyal
2022-05-01 12:24           ` Gujjar, Abhinandan S
2022-05-01 18:37             ` Akhil Goyal
2022-04-21 14:37     ` [PATCH v3 2/7] crypto/cnxk: add event metadata set operation Akhil Goyal
2022-04-27 15:38       ` Zhang, Roy Fan
2022-05-01 13:17       ` Gujjar, Abhinandan S
2022-05-01 18:29         ` Akhil Goyal
2022-04-21 14:37     ` [PATCH v3 3/7] crypto/octeontx: use new API for event metadata Akhil Goyal
2022-04-27 15:38       ` Zhang, Roy Fan
2022-05-01 13:18       ` Gujjar, Abhinandan S
2022-04-21 14:37     ` [PATCH v3 4/7] test/event: use new API to set event crypto metadata Akhil Goyal
2022-04-27 15:39       ` Zhang, Roy Fan
2022-04-28 14:47       ` Gujjar, Abhinandan S
2022-04-21 14:37     ` [PATCH v3 5/7] eventdev: use new API to get " Akhil Goyal
2022-04-27 15:39       ` Zhang, Roy Fan
2022-04-28 15:08       ` Gujjar, Abhinandan S
2022-04-21 14:37     ` [PATCH v3 6/7] test/event: add asymmetric cases for crypto adapter Akhil Goyal
2022-04-27 15:39       ` Zhang, Roy Fan
2022-04-28 15:14       ` Gujjar, Abhinandan S
2022-04-29 12:23         ` Akhil Goyal
2022-05-01 12:45           ` Gujjar, Abhinandan S
2022-05-01 18:36             ` Akhil Goyal
2022-04-21 14:37     ` [PATCH v3 7/7] test-eventdev: support asym ops " Akhil Goyal
2022-04-27 15:40       ` Zhang, Roy Fan
2022-05-01 13:00       ` Gujjar, Abhinandan S
2022-04-27 15:37     ` [PATCH v3 0/7] Add new cryptodev op for event metadata Zhang, Roy Fan
2022-04-28 14:24     ` Gujjar, Abhinandan S
2022-05-01 19:24     ` [PATCH v4 " Akhil Goyal
2022-05-01 19:24       ` [PATCH v4 1/7] cryptodev: add APIs to get/set " Akhil Goyal
2022-05-02  9:01         ` Anoob Joseph
2022-05-02 11:06         ` Gujjar, Abhinandan S
2022-05-01 19:24       ` [PATCH v4 2/7] crypto/cnxk: add event metadata set operation Akhil Goyal
2022-05-02 11:07         ` Gujjar, Abhinandan S
2022-05-01 19:24       ` [PATCH v4 3/7] crypto/octeontx: use new API for event metadata Akhil Goyal
2022-05-01 19:24       ` [PATCH v4 4/7] test/event: use new API to set event crypto metadata Akhil Goyal
2022-05-01 19:24       ` [PATCH v4 5/7] eventdev: use new API to get " Akhil Goyal
2022-05-01 19:24       ` [PATCH v4 6/7] test/event: add asymmetric cases for crypto adapter Akhil Goyal
2022-05-02 11:08         ` Gujjar, Abhinandan S
2022-05-01 19:24       ` [PATCH v4 7/7] test-eventdev: support asym ops " Akhil Goyal
2022-05-02 11:08       ` [PATCH v4 0/7] Add new cryptodev op for event metadata Gujjar, Abhinandan S
2022-05-12 12:45       ` [PATCH v5 " Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 1/7] cryptodev: add APIs to get/set " Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 2/7] crypto/cnxk: add event metadata set operation Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 3/7] crypto/octeontx: use new API for event metadata Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 4/7] test/event: use new API to set event crypto metadata Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 5/7] eventdev: use new API to get " Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 6/7] test/event: add asymmetric cases for crypto adapter Akhil Goyal
2022-05-12 12:45         ` [PATCH v5 7/7] test-eventdev: support asym ops " Akhil Goyal
2022-05-16 18:30         ` [PATCH v5 0/7] Add new cryptodev op for event metadata 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=PH0PR11MB48247DBE5F69F2B1AA22C66AE8E59@PH0PR11MB4824.namprd11.prod.outlook.com \
    --to=abhinandan.gujjar@intel.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=jay.jayatheerthan@intel.com \
    --cc=jerinj@marvell.com \
    --cc=narender.vangati@intel.com \
    --cc=vfialko@marvell.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).