[1/3] eventdev: introduce event cryptodev vector type

Message ID 20220804095907.97895-2-vfialko@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series Vector support for event crypto adapter |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing warning apply patch failure

Commit Message

Volodymyr Fialko Aug. 4, 2022, 9:59 a.m. UTC
  Introduce ability to aggregate crypto operations processed by event
crypto adapter into single event containing rte_event_vector whose event
type is RTE_EVENT_TYPE_CRYPTODEV_VECTOR.

Application should set RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
rte_event_crypto_adapter_queue_conf::flag and provide vector configuration
with respect of rte_event_crypto_adapter_vector_limits, which could be
obtained by calling rte_event_crypto_adapter_vector_limits_get, to enable
vectorization.

The event crypto adapter would be responsible for vectorizing the crypto
operations based on provided response information in
rte_event_crypto_metadata::response_info.

Updated drivers and tests accordingly to new API.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
 app/test-eventdev/test_perf_common.c          |  10 +-
 app/test/test_event_crypto_adapter.c          |  12 ++-
 .../prog_guide/event_crypto_adapter.rst       |  23 +++-
 drivers/event/cnxk/cn10k_eventdev.c           |   4 +-
 drivers/event/cnxk/cn9k_eventdev.c            |   5 +-
 drivers/event/dpaa/dpaa_eventdev.c            |   9 +-
 drivers/event/dpaa2/dpaa2_eventdev.c          |   9 +-
 drivers/event/octeontx/ssovf_evdev.c          |   4 +-
 lib/eventdev/eventdev_pmd.h                   |  35 +++++-
 lib/eventdev/eventdev_trace.h                 |   6 +-
 lib/eventdev/rte_event_crypto_adapter.c       |  90 ++++++++++++++--
 lib/eventdev/rte_event_crypto_adapter.h       | 101 +++++++++++++++++-
 lib/eventdev/rte_event_eth_rx_adapter.h       |   3 +-
 lib/eventdev/rte_eventdev.h                   |   8 ++
 14 files changed, 276 insertions(+), 43 deletions(-)
  

Comments

Akhil Goyal Sept. 21, 2022, 6:32 p.m. UTC | #1
Hi Abhinandan/Hemant,

Can you review this patchset?
The library changes need to merged in RC1.
If no comments, this will be merged in couple of days. It has been over 6 weeks for this patch.

Regards,
Akhil
> Subject: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> 
> Introduce ability to aggregate crypto operations processed by event
> crypto adapter into single event containing rte_event_vector whose event
> type is RTE_EVENT_TYPE_CRYPTODEV_VECTOR.
> 
> Application should set RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> rte_event_crypto_adapter_queue_conf::flag and provide vector configuration
> with respect of rte_event_crypto_adapter_vector_limits, which could be
> obtained by calling rte_event_crypto_adapter_vector_limits_get, to enable
> vectorization.
> 
> The event crypto adapter would be responsible for vectorizing the crypto
> operations based on provided response information in
> rte_event_crypto_metadata::response_info.
> 
> Updated drivers and tests accordingly to new API.
> 
> Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
  
Gujjar, Abhinandan S Sept. 22, 2022, 4:53 a.m. UTC | #2
Hi Akhil,

I have started reviewing it.
You can expect some feedback in the weekend.

Regards
Abhinandan

> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Thursday, September 22, 2022 12:02 AM
> To: Volodymyr Fialko <vfialko@marvell.com>; dev@dpdk.org; Jerin Jacob
> Kollanukkaran <jerinj@marvell.com>; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>
> Cc: Anoob Joseph <anoobj@marvell.com>; Volodymyr Fialko
> <vfialko@marvell.com>
> Subject: RE: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> 
> Hi Abhinandan/Hemant,
> 
> Can you review this patchset?
> The library changes need to merged in RC1.
> If no comments, this will be merged in couple of days. It has been over 6 weeks
> for this patch.
> 
> Regards,
> Akhil
> > Subject: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> >
> > Introduce ability to aggregate crypto operations processed by event
> > crypto adapter into single event containing rte_event_vector whose
> > event type is RTE_EVENT_TYPE_CRYPTODEV_VECTOR.
> >
> > Application should set RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> > rte_event_crypto_adapter_queue_conf::flag and provide vector
> > configuration with respect of rte_event_crypto_adapter_vector_limits,
> > which could be obtained by calling
> > rte_event_crypto_adapter_vector_limits_get, to enable vectorization.
> >
> > The event crypto adapter would be responsible for vectorizing the
> > crypto operations based on provided response information in
> > rte_event_crypto_metadata::response_info.
> >
> > Updated drivers and tests accordingly to new API.
> >
> > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
  
Gujjar, Abhinandan S Sept. 24, 2022, 8:43 a.m. UTC | #3
> -----Original Message-----
> From: Volodymyr Fialko <vfialko@marvell.com>
> Sent: Thursday, August 4, 2022 3:29 PM
> To: dev@dpdk.org; Jerin Jacob <jerinj@marvell.com>; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; Pavan Nikhilesh
> <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>
> Cc: gakhil@marvell.com; anoobj@marvell.com; Volodymyr Fialko
> <vfialko@marvell.com>
> Subject: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> 
> Introduce ability to aggregate crypto operations processed by event crypto
> adapter into single event containing rte_event_vector whose event type is
> RTE_EVENT_TYPE_CRYPTODEV_VECTOR.
> 
> Application should set RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> rte_event_crypto_adapter_queue_conf::flag and provide vector configuration
> with respect of rte_event_crypto_adapter_vector_limits, which could be
> obtained by calling rte_event_crypto_adapter_vector_limits_get, to enable
> vectorization.
> 
> The event crypto adapter would be responsible for vectorizing the crypto
> operations based on provided response information in
> rte_event_crypto_metadata::response_info.
> 
> Updated drivers and tests accordingly to new API.
> 
> Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> ---
>  app/test-eventdev/test_perf_common.c          |  10 +-
>  app/test/test_event_crypto_adapter.c          |  12 ++-
>  .../prog_guide/event_crypto_adapter.rst       |  23 +++-
>  drivers/event/cnxk/cn10k_eventdev.c           |   4 +-
>  drivers/event/cnxk/cn9k_eventdev.c            |   5 +-
>  drivers/event/dpaa/dpaa_eventdev.c            |   9 +-
>  drivers/event/dpaa2/dpaa2_eventdev.c          |   9 +-
>  drivers/event/octeontx/ssovf_evdev.c          |   4 +-
>  lib/eventdev/eventdev_pmd.h                   |  35 +++++-
>  lib/eventdev/eventdev_trace.h                 |   6 +-
>  lib/eventdev/rte_event_crypto_adapter.c       |  90 ++++++++++++++--
>  lib/eventdev/rte_event_crypto_adapter.h       | 101 +++++++++++++++++-
>  lib/eventdev/rte_event_eth_rx_adapter.h       |   3 +-
>  lib/eventdev/rte_eventdev.h                   |   8 ++
>  14 files changed, 276 insertions(+), 43 deletions(-)
> 

I don't see dataplane implementation of vectorization in the crypto adapter!
Is it missed out in the patch?
comments inline.

> diff --git a/app/test-eventdev/test_perf_common.c b/app/test-
> eventdev/test_perf_common.c
> index 81420be73a..c770bc93f6 100644
> --- a/app/test-eventdev/test_perf_common.c
> +++ b/app/test-eventdev/test_perf_common.c
> @@ -837,14 +837,14 @@ perf_event_crypto_adapter_setup(struct test_perf
> *t, struct prod_data *p)
>  	}
> 
>  	if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> -		struct rte_event response_info;
> +		struct rte_event_crypto_adapter_queue_conf conf;
> 
> -		response_info.event = 0;
> -		response_info.sched_type = RTE_SCHED_TYPE_ATOMIC;
> -		response_info.queue_id = p->queue_id;
> +		memset(&conf, 0, sizeof(conf));
> +		conf.ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
> +		conf.ev.queue_id = p->queue_id;
>  		ret = rte_event_crypto_adapter_queue_pair_add(
>  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
> -			&response_info);
> +			&conf);
>  	} else {
>  		ret = rte_event_crypto_adapter_queue_pair_add(
>  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
> NULL); diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 2ecc7e2cea..bb617c1042 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -1175,6 +1175,10 @@ test_crypto_adapter_create(void)  static int
>  test_crypto_adapter_qp_add_del(void)
>  {
> +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> +		.ev = response_info,
> +	};
> +
>  	uint32_t cap;
>  	int ret;
> 
> @@ -1183,7 +1187,7 @@ test_crypto_adapter_qp_add_del(void)
> 
>  	if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
>  		ret =
> rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> &response_info);
> +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> &queue_conf);
>  	} else
>  		ret =
> rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
>  					TEST_CDEV_ID, TEST_CDEV_QP_ID,
> NULL); @@ -1206,6 +1210,10 @@ configure_event_crypto_adapter(enum
> rte_event_crypto_adapter_mode mode)
>  		.new_event_threshold = 1200,
>  	};
> 
> +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> +		.ev = response_info,
> +	};
> +
>  	uint32_t cap;
>  	int ret;
> 
> @@ -1238,7 +1246,7 @@ configure_event_crypto_adapter(enum
> rte_event_crypto_adapter_mode mode)
> 
>  	if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
>  		ret =
> rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> &response_info);
> +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> &queue_conf);
>  	} else
>  		ret =
> rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
>  				TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL); diff
> --git a/doc/guides/prog_guide/event_crypto_adapter.rst
> b/doc/guides/prog_guide/event_crypto_adapter.rst
> index 4fb5c688e0..554df7e358 100644
> --- a/doc/guides/prog_guide/event_crypto_adapter.rst
> +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> @@ -201,10 +201,10 @@ capability, event information must be passed to the
> add API.
> 
>          ret = rte_event_crypto_adapter_caps_get(id, evdev, &cap);
>          if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> -                struct rte_event event;
> +                struct rte_event_crypto_adapter_queue_conf conf;
> 
> -                // Fill in event information & pass it to add API
> -                rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id,
> &event);
> +                // Fill in conf.event information & pass it to add API
> +                rte_event_crypto_adapter_queue_pair_add(id, cdev_id,
> + qp_id, &conf);
>          } else
>                  rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id,
> NULL);
> 
> @@ -291,6 +291,23 @@ the ``rte_crypto_op``.
>                  rte_memcpy(op + len, &m_data, sizeof(m_data));
>          }
> 
> +Enable event vectorization
> +~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +The event crypto adapter can aggregate outcoming crypto operations
> +based on provided response information of
> +``rte_event_crypto_metadata::response_info``
> +and generate a ``rte_event`` containing ``rte_event_vector`` whose
> +event type is ``RTE_EVENT_TYPE_CRYPTODEV_VECTOR``.
> +To enable vectorization application should set
> +RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> +``rte_event_crypto_adapter_queue_conf::flag`` and provide vector
> +configuration(size, mempool, etc.) with respect of
> +``rte_event_crypto_adapter_vector_limits``, which could be obtained by
> +calling ``rte_event_crypto_adapter_vector_limits_get()``.
> +
> +The RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR capability indicates
> +whether PMD supports this feature.
> +
>  Start the adapter instance
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> diff --git a/drivers/event/cnxk/cn10k_eventdev.c
> b/drivers/event/cnxk/cn10k_eventdev.c
> index 5a0cab40a9..e74ec57382 100644
> --- a/drivers/event/cnxk/cn10k_eventdev.c
> +++ b/drivers/event/cnxk/cn10k_eventdev.c
> @@ -889,11 +889,11 @@ static int
>  cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
>  			    const struct rte_cryptodev *cdev,
>  			    int32_t queue_pair_id,
> -			    const struct rte_event *event)
> +			    const struct rte_event_crypto_adapter_queue_conf
> *conf)
>  {
>  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> 
> -	RTE_SET_USED(event);
> +	RTE_SET_USED(conf);
> 
>  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k");
>  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k"); diff --
> git a/drivers/event/cnxk/cn9k_eventdev.c
> b/drivers/event/cnxk/cn9k_eventdev.c
> index 2e27030049..45ed547cb0 100644
> --- a/drivers/event/cnxk/cn9k_eventdev.c
> +++ b/drivers/event/cnxk/cn9k_eventdev.c
> @@ -1120,11 +1120,12 @@ cn9k_crypto_adapter_caps_get(const struct
> rte_eventdev *event_dev,  static int  cn9k_crypto_adapter_qp_add(const struct
> rte_eventdev *event_dev,
>  			   const struct rte_cryptodev *cdev,
> -			   int32_t queue_pair_id, const struct rte_event *event)
> +			   int32_t queue_pair_id,
> +			   const struct rte_event_crypto_adapter_queue_conf
> *conf)
>  {
>  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> 
> -	RTE_SET_USED(event);
> +	RTE_SET_USED(conf);
> 
>  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k");
>  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k"); diff --git
> a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
> index ff6cc0be18..2b9ecd9fbf 100644
> --- a/drivers/event/dpaa/dpaa_eventdev.c
> +++ b/drivers/event/dpaa/dpaa_eventdev.c
> @@ -26,6 +26,7 @@
>  #include <rte_eventdev.h>
>  #include <eventdev_pmd_vdev.h>
>  #include <rte_ethdev.h>
> +#include <rte_event_crypto_adapter.h>
>  #include <rte_event_eth_rx_adapter.h>
>  #include <rte_event_eth_tx_adapter.h>
>  #include <cryptodev_pmd.h>
> @@ -775,10 +776,10 @@ static int
>  dpaa_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
>  		const struct rte_cryptodev *cryptodev,
>  		int32_t rx_queue_id,
> -		const struct rte_event *ev)
> +		const struct rte_event_crypto_adapter_queue_conf *conf)
>  {
>  	struct dpaa_eventdev *priv = dev->data->dev_private;
> -	uint8_t ev_qid = ev->queue_id;
> +	uint8_t ev_qid = conf->ev.queue_id;
>  	u16 ch_id = priv->evq_info[ev_qid].ch_id;
>  	int ret;
> 
> @@ -786,10 +787,10 @@ dpaa_eventdev_crypto_queue_add(const struct
> rte_eventdev *dev,
> 
>  	if (rx_queue_id == -1)
>  		return dpaa_eventdev_crypto_queue_add_all(dev,
> -				cryptodev, ev);
> +				cryptodev, &conf->ev);
> 
>  	ret = dpaa_sec_eventq_attach(cryptodev, rx_queue_id,
> -			ch_id, ev);
> +			ch_id, &conf->ev);
>  	if (ret) {
>  		DPAA_EVENTDEV_ERR(
>  			"dpaa_sec_eventq_attach failed: ret: %d\n", ret); diff -
> -git a/drivers/event/dpaa2/dpaa2_eventdev.c
> b/drivers/event/dpaa2/dpaa2_eventdev.c
> index ffc7b8b073..0137736794 100644
> --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> @@ -26,6 +26,7 @@
>  #include <rte_bus_vdev.h>
>  #include <ethdev_driver.h>
>  #include <cryptodev_pmd.h>
> +#include <rte_event_crypto_adapter.h>
>  #include <rte_event_eth_rx_adapter.h>
>  #include <rte_event_eth_tx_adapter.h>
> 
> @@ -865,10 +866,10 @@ static int
>  dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
>  		const struct rte_cryptodev *cryptodev,
>  		int32_t rx_queue_id,
> -		const struct rte_event *ev)
> +		const struct rte_event_crypto_adapter_queue_conf *conf)
>  {
>  	struct dpaa2_eventdev *priv = dev->data->dev_private;
> -	uint8_t ev_qid = ev->queue_id;
> +	uint8_t ev_qid = conf->ev.queue_id;
>  	struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon;
>  	int ret;
> 
> @@ -876,10 +877,10 @@ dpaa2_eventdev_crypto_queue_add(const struct
> rte_eventdev *dev,
> 
>  	if (rx_queue_id == -1)
>  		return dpaa2_eventdev_crypto_queue_add_all(dev,
> -				cryptodev, ev);
> +				cryptodev, &conf->ev);
> 
>  	ret = dpaa2_sec_eventq_attach(cryptodev, rx_queue_id,
> -				      dpcon, ev);
> +				      dpcon, &conf->ev);
>  	if (ret) {
>  		DPAA2_EVENTDEV_ERR(
>  			"dpaa2_sec_eventq_attach failed: ret: %d\n", ret); diff
> --git a/drivers/event/octeontx/ssovf_evdev.c
> b/drivers/event/octeontx/ssovf_evdev.c
> index 9e14e35d10..17acd8ef64 100644
> --- a/drivers/event/octeontx/ssovf_evdev.c
> +++ b/drivers/event/octeontx/ssovf_evdev.c
> @@ -745,12 +745,12 @@ static int
>  ssovf_crypto_adapter_qp_add(const struct rte_eventdev *dev,
>  			    const struct rte_cryptodev *cdev,
>  			    int32_t queue_pair_id,
> -			    const struct rte_event *event)
> +			    const struct rte_event_crypto_adapter_queue_conf
> *conf)
>  {
>  	struct cpt_instance *qp;
>  	uint8_t qp_id;
> 
> -	RTE_SET_USED(event);
> +	RTE_SET_USED(conf);
> 
>  	if (queue_pair_id == -1) {
>  		for (qp_id = 0; qp_id < cdev->data->nb_queue_pairs; qp_id++) {
> diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
> index 69402668d8..bcfc9cbcb2 100644
> --- a/lib/eventdev/eventdev_pmd.h
> +++ b/lib/eventdev/eventdev_pmd.h
> @@ -907,6 +907,7 @@ rte_event_pmd_selftest_seqn(struct rte_mbuf *mbuf)
> }
> 
>  struct rte_cryptodev;
> +struct rte_event_crypto_adapter_queue_conf;
> 
>  /**
>   * This API may change without prior notice @@ -961,11 +962,11 @@ typedef
> int (*eventdev_crypto_adapter_caps_get_t)
>   *   - <0: Error code returned by the driver function.
>   *
>   */
> -typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
> -			(const struct rte_eventdev *dev,
> -			 const struct rte_cryptodev *cdev,
> -			 int32_t queue_pair_id,
> -			 const struct rte_event *event);
> +typedef int (*eventdev_crypto_adapter_queue_pair_add_t)(
> +		const struct rte_eventdev *dev,
> +		const struct rte_cryptodev *cdev,
> +		int32_t queue_pair_id,
> +		const struct rte_event_crypto_adapter_queue_conf
> *queue_conf);
> 
> 
>  /**
> @@ -1074,6 +1075,27 @@ typedef int
> (*eventdev_crypto_adapter_stats_reset)
>  			(const struct rte_eventdev *dev,
>  			 const struct rte_cryptodev *cdev);
> 
> +struct rte_event_crypto_adapter_vector_limits;
> +/**
> + * Get event vector limits for a given event, crypto device pair.
> + *
> + * @param dev
> + *   Event device pointer
> + *
> + * @param cdev
> + *   Crypto device pointer
> + *
> + * @param[out] limits
> + *   Pointer to the limits structure to be filled.
> + *
> + * @return
> + *   - 0: Success.
> + *   - <0: Error code returned by the driver function.
> + */
> +typedef int (*eventdev_crypto_adapter_vector_limits_get_t)(
> +	const struct rte_eventdev *dev, const struct rte_cryptodev *cdev,
> +	struct rte_event_crypto_adapter_vector_limits *limits);
> +
>  /**
>   * Retrieve the event device's eth Tx adapter capabilities.
>   *
> @@ -1339,6 +1361,9 @@ struct eventdev_ops {
>  	/**< Get crypto stats */
>  	eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
>  	/**< Reset crypto stats */
> +	eventdev_crypto_adapter_vector_limits_get_t
> +		crypto_adapter_vector_limits_get;
> +	/**< Get event vector limits for the crypto adapter */
> 
>  	eventdev_eth_rx_adapter_q_stats_get
> eth_rx_adapter_queue_stats_get;
>  	/**< Get ethernet Rx queue stats */
> diff --git a/lib/eventdev/eventdev_trace.h b/lib/eventdev/eventdev_trace.h
> index 5ec43d80ee..d48cd58850 100644
> --- a/lib/eventdev/eventdev_trace.h
> +++ b/lib/eventdev/eventdev_trace.h
> @@ -18,6 +18,7 @@ extern "C" {
>  #include <rte_trace_point.h>
> 
>  #include "rte_eventdev.h"
> +#include "rte_event_crypto_adapter.h"
>  #include "rte_event_eth_rx_adapter.h"
>  #include "rte_event_timer_adapter.h"
> 
> @@ -271,11 +272,12 @@ RTE_TRACE_POINT(
>  RTE_TRACE_POINT(
>  	rte_eventdev_trace_crypto_adapter_queue_pair_add,
>  	RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t cdev_id,
> -		const void *event, int32_t queue_pair_id),
> +		int32_t queue_pair_id,
> +		const struct rte_event_crypto_adapter_queue_conf *conf),
>  	rte_trace_point_emit_u8(adptr_id);
>  	rte_trace_point_emit_u8(cdev_id);
>  	rte_trace_point_emit_i32(queue_pair_id);
> -	rte_trace_point_emit_ptr(event);
> +	rte_trace_point_emit_ptr(conf);
>  )
> 
>  RTE_TRACE_POINT(
> diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> b/lib/eventdev/rte_event_crypto_adapter.c
> index 7c695176f4..73a4f231e2 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -921,11 +921,12 @@ int
>  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
>  			uint8_t cdev_id,
>  			int32_t queue_pair_id,
> -			const struct rte_event *event)
> +			const struct rte_event_crypto_adapter_queue_conf
> *conf)
>  {
> +	struct rte_event_crypto_adapter_vector_limits limits;
>  	struct event_crypto_adapter *adapter;
> -	struct rte_eventdev *dev;
>  	struct crypto_device_info *dev_info;
> +	struct rte_eventdev *dev;
>  	uint32_t cap;
>  	int ret;
> 
> @@ -951,11 +952,47 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t
> id,
>  	}
> 
>  	if ((cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) &&
> -	    (event == NULL)) {
> +	    (conf == NULL)) {
>  		RTE_EDEV_LOG_ERR("Conf value can not be NULL for
> dev_id=%u",
>  				  cdev_id);
>  		return -EINVAL;
>  	}
Newline?

> +	if ((conf != NULL) &&
Checking conf twice?
> +	    (conf->flags & RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR)) {
Else condition if the flags is not set?
> +		if ((cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR) == 0) {
> +			RTE_EDEV_LOG_ERR("Event vectorization is not
> supported,"
> +					 "dev %" PRIu8 " cdev %" PRIu8, id,
> +					 cdev_id);
> +			return -ENOTSUP;
> +		}
> +
> +		ret = rte_event_crypto_adapter_vector_limits_get(
> +			adapter->eventdev_id, cdev_id, &limits);
> +		if (ret < 0) {
> +			RTE_EDEV_LOG_ERR("Failed to get event device vector
> "
> +					 "limits, dev %" PRIu8 " cdev %" PRIu8,
> +					 id, cdev_id);
> +			return -EINVAL;
> +		}
New line? Please check other cases.

> +		if (conf->vector_sz < limits.min_sz ||
> +		    conf->vector_sz > limits.max_sz ||
> +		    conf->vector_timeout_ns < limits.min_timeout_ns ||
> +		    conf->vector_timeout_ns > limits.max_timeout_ns ||
> +		    conf->vector_mp == NULL) {
> +			RTE_EDEV_LOG_ERR("Invalid event vector
> configuration,"
> +					 " dev %" PRIu8 " cdev %" PRIu8,
> +					 id, cdev_id);
> +			return -EINVAL;
> +		}
> +		if (conf->vector_mp->elt_size <
> +		    (sizeof(struct rte_event_vector) +
> +		     (sizeof(uintptr_t) * conf->vector_sz))) {
> +			RTE_EDEV_LOG_ERR("Invalid event vector
> configuration,"
> +					 " dev %" PRIu8 " cdev %" PRIu8,
> +					 id, cdev_id);
> +			return -EINVAL;
> +		}
> +	}
> 
>  	dev_info = &adapter->cdevs[cdev_id];
> 
> @@ -990,7 +1027,7 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t
> id,
>  		ret = (*dev->dev_ops->crypto_adapter_queue_pair_add)(dev,
>  				dev_info->dev,
>  				queue_pair_id,
> -				event);
> +				conf);
>  		if (ret)
>  			return ret;
> 
> @@ -1030,8 +1067,8 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t
> id,
>  		rte_service_component_runstate_set(adapter->service_id, 1);
>  	}
> 
> -	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
> event,
> -		queue_pair_id);
> +	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
> +		queue_pair_id, conf);
>  	return 0;
>  }
> 
> @@ -1290,3 +1327,44 @@ rte_event_crypto_adapter_event_port_get(uint8_t
> id, uint8_t *event_port_id)
> 
>  	return 0;
>  }
> +
> +int
> +rte_event_crypto_adapter_vector_limits_get(
> +	uint8_t dev_id, uint16_t cdev_id,
> +	struct rte_event_crypto_adapter_vector_limits *limits) {
> +	struct rte_cryptodev *cdev;
> +	struct rte_eventdev *dev;
> +	uint32_t cap;
> +	int ret;
> +
> +	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> +
> +	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
> +		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
> +		return -EINVAL;
> +	}
> +
> +	if (limits == NULL)
> +		return -EINVAL;
Add appropriate error message like above?
> +
> +	dev = &rte_eventdevs[dev_id];
> +	cdev = rte_cryptodev_pmd_get_dev(cdev_id);
> +
> +	ret = rte_event_crypto_adapter_caps_get(dev_id, cdev_id, &cap);
> +	if (ret) {
> +		RTE_EDEV_LOG_ERR("Failed to get adapter caps edev %" PRIu8
> +				 "cdev %" PRIu16, dev_id, cdev_id);
> +		return ret;
> +	}
> +
> +	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR))
> +		return -ENOTSUP;
Same here.
> +
> +	RTE_FUNC_PTR_OR_ERR_RET(
> +		*dev->dev_ops->crypto_adapter_vector_limits_get,
> +		-ENOTSUP);
> +
> +	return dev->dev_ops->crypto_adapter_vector_limits_get(
> +		dev, cdev, limits);
> +}
> diff --git a/lib/eventdev/rte_event_crypto_adapter.h
> b/lib/eventdev/rte_event_crypto_adapter.h
> index d90a19e72c..7dd6171b9b 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.h
> +++ b/lib/eventdev/rte_event_crypto_adapter.h
> @@ -253,6 +253,78 @@ struct rte_event_crypto_adapter_conf {
>  	 */
>  };
> 
> +#define RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR	0x1
> +/**< This flag indicates that crypto operations processed on the crypto
> + * adapter need to be vectorized
> + * @see rte_event_crypto_adapter_queue_conf::flags
> + */
> +
> +/**
> + * Adapter queue configuration structure  */ struct
> +rte_event_crypto_adapter_queue_conf {
> +	uint32_t flags;
> +	/**< Flags for handling crypto operations
> +	 * @see RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
> +	 */
> +	struct rte_event ev;
> +	/**< If HW supports cryptodev queue pair to event queue binding,
> +	 * application is expected to fill in event information.
> +	 * @see
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> +	 */
> +	uint16_t vector_sz;
> +	/**< Indicates the maximum number for crypto operations to combine
> and
> +	 * form a vector.
> +	 * @see rte_event_crypto_adapter_vector_limits::min_sz
> +	 * @see rte_event_crypto_adapter_vector_limits::max_sz
> +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> set in
> +	 * @see rte_event_crypto_adapter_queue_conf::rx_queue_flags
rx_queue_flags??
> +	 */
> +	uint64_t vector_timeout_ns;
> +	/**<
> +	 * Indicates the maximum number of nanoseconds to wait for
> aggregating
> +	 * crypto operations. Should be within vectorization limits of the
> +	 * adapter
> +	 * @see rte_event_crypto_adapter_vector_limits::min_timeout_ns
> +	 * @see rte_event_crypto_adapter_vector_limits::max_timeout_ns
> +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> set in
> +	 * @see rte_event_crypto_adapter_queue_conf::flags
> +	 */
> +	struct rte_mempool *vector_mp;
> +	/**< Indicates the mempool that should be used for allocating
> +	 * rte_event_vector container.
> +	 * Should be created by using `rte_event_vector_pool_create`.
> +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> set in
> +	 * @see rte_event_crypto_adapter_queue_conf::flags.
> +	 */
> +};
> +
> +/**
> + * A structure used to retrieve event crypto adapter vector limits.
> + */
> +struct rte_event_crypto_adapter_vector_limits {
> +	uint16_t min_sz;
> +	/**< Minimum vector limit configurable.
> +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> +	 */
> +	uint16_t max_sz;
> +	/**< Maximum vector limit configurable.
> +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> +	 */
> +	uint8_t log2_sz;
> +	/**< True if the size configured should be in log2.
> +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> +	 */
> +	uint64_t min_timeout_ns;
> +	/**< Minimum vector timeout configurable.
> +	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> +	 */
> +	uint64_t max_timeout_ns;
> +	/**< Maximum vector timeout configurable.
> +	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> +	 */
> +};
> +
>  /**
>   * Function type used for adapter configuration callback. The callback is
>   * used to fill in members of the struct rte_event_crypto_adapter_conf, this
> @@ -392,10 +464,9 @@ rte_event_crypto_adapter_free(uint8_t id);
>   *  Cryptodev queue pair identifier. If queue_pair_id is set -1,
>   *  adapter adds all the pre configured queue pairs to the instance.
>   *
> - * @param event
> - *  if HW supports cryptodev queue pair to event queue binding, application is
> - *  expected to fill in event information, else it will be NULL.
> - *  @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> + * @param conf
> + *  Additional configuration structure of type
> + *  *rte_event_crypto_adapter_queue_conf*
>   *
>   * @return
>   *  - 0: Success, queue pair added correctly.
> @@ -405,7 +476,7 @@ int
>  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
>  			uint8_t cdev_id,
>  			int32_t queue_pair_id,
> -			const struct rte_event *event);
> +			const struct rte_event_crypto_adapter_queue_conf
> *conf);
> 
>  /**
>   * Delete a queue pair from an event crypto adapter.
> @@ -523,6 +594,26 @@ rte_event_crypto_adapter_service_id_get(uint8_t id,
> uint32_t *service_id);  int  rte_event_crypto_adapter_event_port_get(uint8_t
> id, uint8_t *event_port_id);
> 
> +/**
> + * Retrieve vector limits for a given event dev and crypto dev pair.
> + * @see rte_event_crypto_adapter_vector_limits
> + *
> + * @param dev_id
> + *  Event device identifier.
> + * @param cdev_id
> + *  Crypto device identifier.
> + * @param [out] limits
> + *  A pointer to rte_event_crypto_adapter_vector_limits structure that
> +has to
> + * be filled.
Space missing before "be filled"
> + *
> + * @return
> + *  - 0: Success.
> + *  - <0: Error code on failure.
> + */
> +int rte_event_crypto_adapter_vector_limits_get(
> +	uint8_t dev_id, uint16_t cdev_id,
> +	struct rte_event_crypto_adapter_vector_limits *limits);
> +
>  /**
>   * Enqueue a burst of crypto operations as event objects supplied in
> *rte_event*
>   * structure on an event crypto adapter designated by its event *dev_id*
> through diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h
> b/lib/eventdev/rte_event_eth_rx_adapter.h
> index 3608a7b2cf..c8f2936866 100644
> --- a/lib/eventdev/rte_event_eth_rx_adapter.h
> +++ b/lib/eventdev/rte_event_eth_rx_adapter.h
> @@ -457,7 +457,8 @@ int rte_event_eth_rx_adapter_free(uint8_t id);
>   * @see RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ
>   *
>   * @param conf
> - *  Additional configuration structure of type
> *rte_event_eth_rx_adapter_conf*
> + *  Additional configuration structure of type
> + *  *rte_event_eth_rx_adapter_queue_conf*
These changes are not relevant. Please consider sending separate patch.

>   *
>   * @return
>   *  - 0: Success, Receive queue added correctly.
> diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index
> 6a6f6ea4c1..1a737bf851 100644
> --- a/lib/eventdev/rte_eventdev.h
> +++ b/lib/eventdev/rte_eventdev.h
> @@ -1203,6 +1203,9 @@ struct rte_event_vector {
>  #define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR                                   \
>  	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER)
> /**< The event vector generated from eth Rx adapter. */
> +#define RTE_EVENT_TYPE_CRYPTODEV_VECTOR                                        \
> +	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV) /**< The
> event
> +vector generated from cryptodev adapter. */
> 
>  #define RTE_EVENT_TYPE_MAX              0x10
>  /**< Maximum number of event types */
> @@ -1420,6 +1423,11 @@ rte_event_timer_adapter_caps_get(uint8_t dev_id,
> uint32_t *caps);
>   * the private data information along with the crypto session.
>   */
> 
> +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR   0x10
> +/**< Flag indicates HW is capable of aggregating processed
> + * crypto operations into rte_event_vector.
> + */
> +
>  /**
>   * Retrieve the event device's crypto adapter capabilities for the
>   * specified cryptodev device
> --
> 2.25.1
  
Volodymyr Fialko Sept. 26, 2022, 11:02 a.m. UTC | #4
> -----Original Message-----
> From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> Sent: Saturday, September 24, 2022 10:44 AM
> To: Volodymyr Fialko <vfialko@marvell.com>; dev@dpdk.org; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>; Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Shijith Thotton
> <sthotton@marvell.com>; Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay <jay.jayatheerthan@intel.com>
> Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph <anoobj@marvell.com>
> Subject: [EXT] RE: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> 
> External Email
> 
> ----------------------------------------------------------------------
> 
> 
> > -----Original Message-----
> > From: Volodymyr Fialko <vfialko@marvell.com>
> > Sent: Thursday, August 4, 2022 3:29 PM
> > To: dev@dpdk.org; Jerin Jacob <jerinj@marvell.com>; Gujjar, Abhinandan
> > S <abhinandan.gujjar@intel.com>; Pavan Nikhilesh
> > <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> > Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> > <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > <jay.jayatheerthan@intel.com>
> > Cc: gakhil@marvell.com; anoobj@marvell.com; Volodymyr Fialko
> > <vfialko@marvell.com>
> > Subject: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> >
> > Introduce ability to aggregate crypto operations processed by event
> > crypto adapter into single event containing rte_event_vector whose
> > event type is RTE_EVENT_TYPE_CRYPTODEV_VECTOR.
> >
> > Application should set RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> > rte_event_crypto_adapter_queue_conf::flag and provide vector
> > configuration with respect of rte_event_crypto_adapter_vector_limits,
> > which could be obtained by calling
> > rte_event_crypto_adapter_vector_limits_get, to enable vectorization.
> >
> > The event crypto adapter would be responsible for vectorizing the
> > crypto operations based on provided response information in
> > rte_event_crypto_metadata::response_info.
> >
> > Updated drivers and tests accordingly to new API.
> >
> > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> > ---
> >  app/test-eventdev/test_perf_common.c          |  10 +-
> >  app/test/test_event_crypto_adapter.c          |  12 ++-
> >  .../prog_guide/event_crypto_adapter.rst       |  23 +++-
> >  drivers/event/cnxk/cn10k_eventdev.c           |   4 +-
> >  drivers/event/cnxk/cn9k_eventdev.c            |   5 +-
> >  drivers/event/dpaa/dpaa_eventdev.c            |   9 +-
> >  drivers/event/dpaa2/dpaa2_eventdev.c          |   9 +-
> >  drivers/event/octeontx/ssovf_evdev.c          |   4 +-
> >  lib/eventdev/eventdev_pmd.h                   |  35 +++++-
> >  lib/eventdev/eventdev_trace.h                 |   6 +-
> >  lib/eventdev/rte_event_crypto_adapter.c       |  90 ++++++++++++++--
> >  lib/eventdev/rte_event_crypto_adapter.h       | 101 +++++++++++++++++-
> >  lib/eventdev/rte_event_eth_rx_adapter.h       |   3 +-
> >  lib/eventdev/rte_eventdev.h                   |   8 ++
> >  14 files changed, 276 insertions(+), 43 deletions(-)
> >
> 
> I don't see dataplane implementation of vectorization in the crypto adapter!
> Is it missed out in the patch?
> comments inline.
> 
Right now we are targeting crypto_cn10k PMD and ipsec-secgw event mode to support vectorization.

> > diff --git a/app/test-eventdev/test_perf_common.c b/app/test-
> > eventdev/test_perf_common.c index 81420be73a..c770bc93f6 100644
> > --- a/app/test-eventdev/test_perf_common.c
> > +++ b/app/test-eventdev/test_perf_common.c
> > @@ -837,14 +837,14 @@ perf_event_crypto_adapter_setup(struct test_perf
> > *t, struct prod_data *p)
> >  	}
> >
> >  	if (cap &
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > -		struct rte_event response_info;
> > +		struct rte_event_crypto_adapter_queue_conf conf;
> >
> > -		response_info.event = 0;
> > -		response_info.sched_type = RTE_SCHED_TYPE_ATOMIC;
> > -		response_info.queue_id = p->queue_id;
> > +		memset(&conf, 0, sizeof(conf));
> > +		conf.ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
> > +		conf.ev.queue_id = p->queue_id;
> >  		ret = rte_event_crypto_adapter_queue_pair_add(
> >  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
> > -			&response_info);
> > +			&conf);
> >  	} else {
> >  		ret = rte_event_crypto_adapter_queue_pair_add(
> >  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id, NULL); diff
> > --git a/app/test/test_event_crypto_adapter.c
> > b/app/test/test_event_crypto_adapter.c
> > index 2ecc7e2cea..bb617c1042 100644
> > --- a/app/test/test_event_crypto_adapter.c
> > +++ b/app/test/test_event_crypto_adapter.c
> > @@ -1175,6 +1175,10 @@ test_crypto_adapter_create(void)  static int
> >  test_crypto_adapter_qp_add_del(void)
> >  {
> > +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> > +		.ev = response_info,
> > +	};
> > +
> >  	uint32_t cap;
> >  	int ret;
> >
> > @@ -1183,7 +1187,7 @@ test_crypto_adapter_qp_add_del(void)
> >
> >  	if (cap &
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> >  		ret =
> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > &response_info);
> > +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > &queue_conf);
> >  	} else
> >  		ret =
> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> >  					TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > NULL); @@ -1206,6 +1210,10 @@ configure_event_crypto_adapter(enum
> > rte_event_crypto_adapter_mode mode)
> >  		.new_event_threshold = 1200,
> >  	};
> >
> > +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> > +		.ev = response_info,
> > +	};
> > +
> >  	uint32_t cap;
> >  	int ret;
> >
> > @@ -1238,7 +1246,7 @@ configure_event_crypto_adapter(enum
> > rte_event_crypto_adapter_mode mode)
> >
> >  	if (cap &
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> >  		ret =
> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > &response_info);
> > +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > &queue_conf);
> >  	} else
> >  		ret =
> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> >  				TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL); diff --git
> > a/doc/guides/prog_guide/event_crypto_adapter.rst
> > b/doc/guides/prog_guide/event_crypto_adapter.rst
> > index 4fb5c688e0..554df7e358 100644
> > --- a/doc/guides/prog_guide/event_crypto_adapter.rst
> > +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> > @@ -201,10 +201,10 @@ capability, event information must be passed to
> > the add API.
> >
> >          ret = rte_event_crypto_adapter_caps_get(id, evdev, &cap);
> >          if (cap &
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > -                struct rte_event event;
> > +                struct rte_event_crypto_adapter_queue_conf conf;
> >
> > -                // Fill in event information & pass it to add API
> > -                rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id,
> > &event);
> > +                // Fill in conf.event information & pass it to add API
> > +                rte_event_crypto_adapter_queue_pair_add(id, cdev_id,
> > + qp_id, &conf);
> >          } else
> >                  rte_event_crypto_adapter_queue_pair_add(id, cdev_id,
> > qp_id, NULL);
> >
> > @@ -291,6 +291,23 @@ the ``rte_crypto_op``.
> >                  rte_memcpy(op + len, &m_data, sizeof(m_data));
> >          }
> >
> > +Enable event vectorization
> > +~~~~~~~~~~~~~~~~~~~~~~~~~~
> > +
> > +The event crypto adapter can aggregate outcoming crypto operations
> > +based on provided response information of
> > +``rte_event_crypto_metadata::response_info``
> > +and generate a ``rte_event`` containing ``rte_event_vector`` whose
> > +event type is ``RTE_EVENT_TYPE_CRYPTODEV_VECTOR``.
> > +To enable vectorization application should set
> > +RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> > +``rte_event_crypto_adapter_queue_conf::flag`` and provide vector
> > +configuration(size, mempool, etc.) with respect of
> > +``rte_event_crypto_adapter_vector_limits``, which could be obtained
> > +by calling ``rte_event_crypto_adapter_vector_limits_get()``.
> > +
> > +The RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR capability indicates
> > +whether PMD supports this feature.
> > +
> >  Start the adapter instance
> >  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > diff --git a/drivers/event/cnxk/cn10k_eventdev.c
> > b/drivers/event/cnxk/cn10k_eventdev.c
> > index 5a0cab40a9..e74ec57382 100644
> > --- a/drivers/event/cnxk/cn10k_eventdev.c
> > +++ b/drivers/event/cnxk/cn10k_eventdev.c
> > @@ -889,11 +889,11 @@ static int
> >  cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
> >  			    const struct rte_cryptodev *cdev,
> >  			    int32_t queue_pair_id,
> > -			    const struct rte_event *event)
> > +			    const struct rte_event_crypto_adapter_queue_conf
> > *conf)
> >  {
> >  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> >
> > -	RTE_SET_USED(event);
> > +	RTE_SET_USED(conf);
> >
> >  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k");
> >  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k"); diff -- git
> > a/drivers/event/cnxk/cn9k_eventdev.c
> > b/drivers/event/cnxk/cn9k_eventdev.c
> > index 2e27030049..45ed547cb0 100644
> > --- a/drivers/event/cnxk/cn9k_eventdev.c
> > +++ b/drivers/event/cnxk/cn9k_eventdev.c
> > @@ -1120,11 +1120,12 @@ cn9k_crypto_adapter_caps_get(const struct
> > rte_eventdev *event_dev,  static int  cn9k_crypto_adapter_qp_add(const
> > struct rte_eventdev *event_dev,
> >  			   const struct rte_cryptodev *cdev,
> > -			   int32_t queue_pair_id, const struct rte_event *event)
> > +			   int32_t queue_pair_id,
> > +			   const struct rte_event_crypto_adapter_queue_conf
> > *conf)
> >  {
> >  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> >
> > -	RTE_SET_USED(event);
> > +	RTE_SET_USED(conf);
> >
> >  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k");
> >  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k"); diff --git
> > a/drivers/event/dpaa/dpaa_eventdev.c
> > b/drivers/event/dpaa/dpaa_eventdev.c
> > index ff6cc0be18..2b9ecd9fbf 100644
> > --- a/drivers/event/dpaa/dpaa_eventdev.c
> > +++ b/drivers/event/dpaa/dpaa_eventdev.c
> > @@ -26,6 +26,7 @@
> >  #include <rte_eventdev.h>
> >  #include <eventdev_pmd_vdev.h>
> >  #include <rte_ethdev.h>
> > +#include <rte_event_crypto_adapter.h>
> >  #include <rte_event_eth_rx_adapter.h>  #include
> > <rte_event_eth_tx_adapter.h>  #include <cryptodev_pmd.h> @@ -775,10
> > +776,10 @@ static int  dpaa_eventdev_crypto_queue_add(const struct
> > rte_eventdev *dev,
> >  		const struct rte_cryptodev *cryptodev,
> >  		int32_t rx_queue_id,
> > -		const struct rte_event *ev)
> > +		const struct rte_event_crypto_adapter_queue_conf *conf)
> >  {
> >  	struct dpaa_eventdev *priv = dev->data->dev_private;
> > -	uint8_t ev_qid = ev->queue_id;
> > +	uint8_t ev_qid = conf->ev.queue_id;
> >  	u16 ch_id = priv->evq_info[ev_qid].ch_id;
> >  	int ret;
> >
> > @@ -786,10 +787,10 @@ dpaa_eventdev_crypto_queue_add(const struct
> > rte_eventdev *dev,
> >
> >  	if (rx_queue_id == -1)
> >  		return dpaa_eventdev_crypto_queue_add_all(dev,
> > -				cryptodev, ev);
> > +				cryptodev, &conf->ev);
> >
> >  	ret = dpaa_sec_eventq_attach(cryptodev, rx_queue_id,
> > -			ch_id, ev);
> > +			ch_id, &conf->ev);
> >  	if (ret) {
> >  		DPAA_EVENTDEV_ERR(
> >  			"dpaa_sec_eventq_attach failed: ret: %d\n", ret); diff - -git
> > a/drivers/event/dpaa2/dpaa2_eventdev.c
> > b/drivers/event/dpaa2/dpaa2_eventdev.c
> > index ffc7b8b073..0137736794 100644
> > --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> > +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> > @@ -26,6 +26,7 @@
> >  #include <rte_bus_vdev.h>
> >  #include <ethdev_driver.h>
> >  #include <cryptodev_pmd.h>
> > +#include <rte_event_crypto_adapter.h>
> >  #include <rte_event_eth_rx_adapter.h>  #include
> > <rte_event_eth_tx_adapter.h>
> >
> > @@ -865,10 +866,10 @@ static int
> >  dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
> >  		const struct rte_cryptodev *cryptodev,
> >  		int32_t rx_queue_id,
> > -		const struct rte_event *ev)
> > +		const struct rte_event_crypto_adapter_queue_conf *conf)
> >  {
> >  	struct dpaa2_eventdev *priv = dev->data->dev_private;
> > -	uint8_t ev_qid = ev->queue_id;
> > +	uint8_t ev_qid = conf->ev.queue_id;
> >  	struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon;
> >  	int ret;
> >
> > @@ -876,10 +877,10 @@ dpaa2_eventdev_crypto_queue_add(const struct
> > rte_eventdev *dev,
> >
> >  	if (rx_queue_id == -1)
> >  		return dpaa2_eventdev_crypto_queue_add_all(dev,
> > -				cryptodev, ev);
> > +				cryptodev, &conf->ev);
> >
> >  	ret = dpaa2_sec_eventq_attach(cryptodev, rx_queue_id,
> > -				      dpcon, ev);
> > +				      dpcon, &conf->ev);
> >  	if (ret) {
> >  		DPAA2_EVENTDEV_ERR(
> >  			"dpaa2_sec_eventq_attach failed: ret: %d\n", ret); diff --git
> > a/drivers/event/octeontx/ssovf_evdev.c
> > b/drivers/event/octeontx/ssovf_evdev.c
> > index 9e14e35d10..17acd8ef64 100644
> > --- a/drivers/event/octeontx/ssovf_evdev.c
> > +++ b/drivers/event/octeontx/ssovf_evdev.c
> > @@ -745,12 +745,12 @@ static int
> >  ssovf_crypto_adapter_qp_add(const struct rte_eventdev *dev,
> >  			    const struct rte_cryptodev *cdev,
> >  			    int32_t queue_pair_id,
> > -			    const struct rte_event *event)
> > +			    const struct rte_event_crypto_adapter_queue_conf
> > *conf)
> >  {
> >  	struct cpt_instance *qp;
> >  	uint8_t qp_id;
> >
> > -	RTE_SET_USED(event);
> > +	RTE_SET_USED(conf);
> >
> >  	if (queue_pair_id == -1) {
> >  		for (qp_id = 0; qp_id < cdev->data->nb_queue_pairs; qp_id++) { diff
> > --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
> > index 69402668d8..bcfc9cbcb2 100644
> > --- a/lib/eventdev/eventdev_pmd.h
> > +++ b/lib/eventdev/eventdev_pmd.h
> > @@ -907,6 +907,7 @@ rte_event_pmd_selftest_seqn(struct rte_mbuf *mbuf)
> > }
> >
> >  struct rte_cryptodev;
> > +struct rte_event_crypto_adapter_queue_conf;
> >
> >  /**
> >   * This API may change without prior notice @@ -961,11 +962,11 @@
> > typedef int (*eventdev_crypto_adapter_caps_get_t)
> >   *   - <0: Error code returned by the driver function.
> >   *
> >   */
> > -typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
> > -			(const struct rte_eventdev *dev,
> > -			 const struct rte_cryptodev *cdev,
> > -			 int32_t queue_pair_id,
> > -			 const struct rte_event *event);
> > +typedef int (*eventdev_crypto_adapter_queue_pair_add_t)(
> > +		const struct rte_eventdev *dev,
> > +		const struct rte_cryptodev *cdev,
> > +		int32_t queue_pair_id,
> > +		const struct rte_event_crypto_adapter_queue_conf
> > *queue_conf);
> >
> >
> >  /**
> > @@ -1074,6 +1075,27 @@ typedef int
> > (*eventdev_crypto_adapter_stats_reset)
> >  			(const struct rte_eventdev *dev,
> >  			 const struct rte_cryptodev *cdev);
> >
> > +struct rte_event_crypto_adapter_vector_limits;
> > +/**
> > + * Get event vector limits for a given event, crypto device pair.
> > + *
> > + * @param dev
> > + *   Event device pointer
> > + *
> > + * @param cdev
> > + *   Crypto device pointer
> > + *
> > + * @param[out] limits
> > + *   Pointer to the limits structure to be filled.
> > + *
> > + * @return
> > + *   - 0: Success.
> > + *   - <0: Error code returned by the driver function.
> > + */
> > +typedef int (*eventdev_crypto_adapter_vector_limits_get_t)(
> > +	const struct rte_eventdev *dev, const struct rte_cryptodev *cdev,
> > +	struct rte_event_crypto_adapter_vector_limits *limits);
> > +
> >  /**
> >   * Retrieve the event device's eth Tx adapter capabilities.
> >   *
> > @@ -1339,6 +1361,9 @@ struct eventdev_ops {
> >  	/**< Get crypto stats */
> >  	eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
> >  	/**< Reset crypto stats */
> > +	eventdev_crypto_adapter_vector_limits_get_t
> > +		crypto_adapter_vector_limits_get;
> > +	/**< Get event vector limits for the crypto adapter */
> >
> >  	eventdev_eth_rx_adapter_q_stats_get
> > eth_rx_adapter_queue_stats_get;
> >  	/**< Get ethernet Rx queue stats */
> > diff --git a/lib/eventdev/eventdev_trace.h
> > b/lib/eventdev/eventdev_trace.h index 5ec43d80ee..d48cd58850 100644
> > --- a/lib/eventdev/eventdev_trace.h
> > +++ b/lib/eventdev/eventdev_trace.h
> > @@ -18,6 +18,7 @@ extern "C" {
> >  #include <rte_trace_point.h>
> >
> >  #include "rte_eventdev.h"
> > +#include "rte_event_crypto_adapter.h"
> >  #include "rte_event_eth_rx_adapter.h"
> >  #include "rte_event_timer_adapter.h"
> >
> > @@ -271,11 +272,12 @@ RTE_TRACE_POINT(  RTE_TRACE_POINT(
> >  	rte_eventdev_trace_crypto_adapter_queue_pair_add,
> >  	RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t cdev_id,
> > -		const void *event, int32_t queue_pair_id),
> > +		int32_t queue_pair_id,
> > +		const struct rte_event_crypto_adapter_queue_conf *conf),
> >  	rte_trace_point_emit_u8(adptr_id);
> >  	rte_trace_point_emit_u8(cdev_id);
> >  	rte_trace_point_emit_i32(queue_pair_id);
> > -	rte_trace_point_emit_ptr(event);
> > +	rte_trace_point_emit_ptr(conf);
> >  )
> >
> >  RTE_TRACE_POINT(
> > diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> > b/lib/eventdev/rte_event_crypto_adapter.c
> > index 7c695176f4..73a4f231e2 100644
> > --- a/lib/eventdev/rte_event_crypto_adapter.c
> > +++ b/lib/eventdev/rte_event_crypto_adapter.c
> > @@ -921,11 +921,12 @@ int
> >  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
> >  			uint8_t cdev_id,
> >  			int32_t queue_pair_id,
> > -			const struct rte_event *event)
> > +			const struct rte_event_crypto_adapter_queue_conf
> > *conf)
> >  {
> > +	struct rte_event_crypto_adapter_vector_limits limits;
> >  	struct event_crypto_adapter *adapter;
> > -	struct rte_eventdev *dev;
> >  	struct crypto_device_info *dev_info;
> > +	struct rte_eventdev *dev;
> >  	uint32_t cap;
> >  	int ret;
> >
> > @@ -951,11 +952,47 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t
> > id,
> >  	}
> >
> >  	if ((cap &
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) &&
> > -	    (event == NULL)) {
> > +	    (conf == NULL)) {
> >  		RTE_EDEV_LOG_ERR("Conf value can not be NULL for dev_id=%u",
> >  				  cdev_id);
> >  		return -EINVAL;
> >  	}
> Newline?
> 
Ack

> > +	if ((conf != NULL) &&
> Checking conf twice?
Will rewrite as if conf == NULL/else, to avoid double checking.

> > +	    (conf->flags & RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR)) {
> Else condition if the flags is not set?
There's no additional handing for case when flag is no set.

> > +		if ((cap &
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR) == 0) {
> > +			RTE_EDEV_LOG_ERR("Event vectorization is not
> > supported,"
> > +					 "dev %" PRIu8 " cdev %" PRIu8, id,
> > +					 cdev_id);
> > +			return -ENOTSUP;
> > +		}
> > +
> > +		ret = rte_event_crypto_adapter_vector_limits_get(
> > +			adapter->eventdev_id, cdev_id, &limits);
> > +		if (ret < 0) {
> > +			RTE_EDEV_LOG_ERR("Failed to get event device vector
> > "
> > +					 "limits, dev %" PRIu8 " cdev %" PRIu8,
> > +					 id, cdev_id);
> > +			return -EINVAL;
> > +		}
> New line? Please check other cases.
> 
Ack

> > +		if (conf->vector_sz < limits.min_sz ||
> > +		    conf->vector_sz > limits.max_sz ||
> > +		    conf->vector_timeout_ns < limits.min_timeout_ns ||
> > +		    conf->vector_timeout_ns > limits.max_timeout_ns ||
> > +		    conf->vector_mp == NULL) {
> > +			RTE_EDEV_LOG_ERR("Invalid event vector
> > configuration,"
> > +					 " dev %" PRIu8 " cdev %" PRIu8,
> > +					 id, cdev_id);
> > +			return -EINVAL;
> > +		}
> > +		if (conf->vector_mp->elt_size <
> > +		    (sizeof(struct rte_event_vector) +
> > +		     (sizeof(uintptr_t) * conf->vector_sz))) {
> > +			RTE_EDEV_LOG_ERR("Invalid event vector
> > configuration,"
> > +					 " dev %" PRIu8 " cdev %" PRIu8,
> > +					 id, cdev_id);
> > +			return -EINVAL;
> > +		}
> > +	}
> >
> >  	dev_info = &adapter->cdevs[cdev_id];
> >
> > @@ -990,7 +1027,7 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t
> > id,
> >  		ret = (*dev->dev_ops->crypto_adapter_queue_pair_add)(dev,
> >  				dev_info->dev,
> >  				queue_pair_id,
> > -				event);
> > +				conf);
> >  		if (ret)
> >  			return ret;
> >
> > @@ -1030,8 +1067,8 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t
> > id,
> >  		rte_service_component_runstate_set(adapter->service_id, 1);
> >  	}
> >
> > -	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
> > event,
> > -		queue_pair_id);
> > +	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
> > +		queue_pair_id, conf);
> >  	return 0;
> >  }
> >
> > @@ -1290,3 +1327,44 @@ rte_event_crypto_adapter_event_port_get(uint8_t
> > id, uint8_t *event_port_id)
> >
> >  	return 0;
> >  }
> > +
> > +int
> > +rte_event_crypto_adapter_vector_limits_get(
> > +	uint8_t dev_id, uint16_t cdev_id,
> > +	struct rte_event_crypto_adapter_vector_limits *limits) {
> > +	struct rte_cryptodev *cdev;
> > +	struct rte_eventdev *dev;
> > +	uint32_t cap;
> > +	int ret;
> > +
> > +	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> > +
> > +	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
> > +		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (limits == NULL)
> > +		return -EINVAL;
> Add appropriate error message like above?
Ack, will add.

> > +
> > +	dev = &rte_eventdevs[dev_id];
> > +	cdev = rte_cryptodev_pmd_get_dev(cdev_id);
> > +
> > +	ret = rte_event_crypto_adapter_caps_get(dev_id, cdev_id, &cap);
> > +	if (ret) {
> > +		RTE_EDEV_LOG_ERR("Failed to get adapter caps edev %" PRIu8
> > +				 "cdev %" PRIu16, dev_id, cdev_id);
> > +		return ret;
> > +	}
> > +
> > +	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR))
> > +		return -ENOTSUP;
> Same here.
Ack, will add.

> > +
> > +	RTE_FUNC_PTR_OR_ERR_RET(
> > +		*dev->dev_ops->crypto_adapter_vector_limits_get,
> > +		-ENOTSUP);
> > +
> > +	return dev->dev_ops->crypto_adapter_vector_limits_get(
> > +		dev, cdev, limits);
> > +}
> > diff --git a/lib/eventdev/rte_event_crypto_adapter.h
> > b/lib/eventdev/rte_event_crypto_adapter.h
> > index d90a19e72c..7dd6171b9b 100644
> > --- a/lib/eventdev/rte_event_crypto_adapter.h
> > +++ b/lib/eventdev/rte_event_crypto_adapter.h
> > @@ -253,6 +253,78 @@ struct rte_event_crypto_adapter_conf {
> >  	 */
> >  };
> >
> > +#define RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR	0x1
> > +/**< This flag indicates that crypto operations processed on the
> > +crypto
> > + * adapter need to be vectorized
> > + * @see rte_event_crypto_adapter_queue_conf::flags
> > + */
> > +
> > +/**
> > + * Adapter queue configuration structure  */ struct
> > +rte_event_crypto_adapter_queue_conf {
> > +	uint32_t flags;
> > +	/**< Flags for handling crypto operations
> > +	 * @see RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
> > +	 */
> > +	struct rte_event ev;
> > +	/**< If HW supports cryptodev queue pair to event queue binding,
> > +	 * application is expected to fill in event information.
> > +	 * @see
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> > +	 */
> > +	uint16_t vector_sz;
> > +	/**< Indicates the maximum number for crypto operations to combine
> > and
> > +	 * form a vector.
> > +	 * @see rte_event_crypto_adapter_vector_limits::min_sz
> > +	 * @see rte_event_crypto_adapter_vector_limits::max_sz
> > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> > set in
> > +	 * @see rte_event_crypto_adapter_queue_conf::rx_queue_flags
> rx_queue_flags??
Typo, should be conf::flags.

> > +	 */
> > +	uint64_t vector_timeout_ns;
> > +	/**<
> > +	 * Indicates the maximum number of nanoseconds to wait for
> > aggregating
> > +	 * crypto operations. Should be within vectorization limits of the
> > +	 * adapter
> > +	 * @see rte_event_crypto_adapter_vector_limits::min_timeout_ns
> > +	 * @see rte_event_crypto_adapter_vector_limits::max_timeout_ns
> > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> > set in
> > +	 * @see rte_event_crypto_adapter_queue_conf::flags
> > +	 */
> > +	struct rte_mempool *vector_mp;
> > +	/**< Indicates the mempool that should be used for allocating
> > +	 * rte_event_vector container.
> > +	 * Should be created by using `rte_event_vector_pool_create`.
> > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> > set in
> > +	 * @see rte_event_crypto_adapter_queue_conf::flags.
> > +	 */
> > +};
> > +
> > +/**
> > + * A structure used to retrieve event crypto adapter vector limits.
> > + */
> > +struct rte_event_crypto_adapter_vector_limits {
> > +	uint16_t min_sz;
> > +	/**< Minimum vector limit configurable.
> > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > +	 */
> > +	uint16_t max_sz;
> > +	/**< Maximum vector limit configurable.
> > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > +	 */
> > +	uint8_t log2_sz;
> > +	/**< True if the size configured should be in log2.
> > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > +	 */
> > +	uint64_t min_timeout_ns;
> > +	/**< Minimum vector timeout configurable.
> > +	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> > +	 */
> > +	uint64_t max_timeout_ns;
> > +	/**< Maximum vector timeout configurable.
> > +	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> > +	 */
> > +};
> > +
> >  /**
> >   * Function type used for adapter configuration callback. The callback is
> >   * used to fill in members of the struct
> > rte_event_crypto_adapter_conf, this @@ -392,10 +464,9 @@
> rte_event_crypto_adapter_free(uint8_t id);
> >   *  Cryptodev queue pair identifier. If queue_pair_id is set -1,
> >   *  adapter adds all the pre configured queue pairs to the instance.
> >   *
> > - * @param event
> > - *  if HW supports cryptodev queue pair to event queue binding,
> > application is
> > - *  expected to fill in event information, else it will be NULL.
> > - *  @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> > + * @param conf
> > + *  Additional configuration structure of type
> > + *  *rte_event_crypto_adapter_queue_conf*
> >   *
> >   * @return
> >   *  - 0: Success, queue pair added correctly.
> > @@ -405,7 +476,7 @@ int
> >  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
> >  			uint8_t cdev_id,
> >  			int32_t queue_pair_id,
> > -			const struct rte_event *event);
> > +			const struct rte_event_crypto_adapter_queue_conf
> > *conf);
> >
> >  /**
> >   * Delete a queue pair from an event crypto adapter.
> > @@ -523,6 +594,26 @@ rte_event_crypto_adapter_service_id_get(uint8_t
> > id, uint32_t *service_id);  int
> > rte_event_crypto_adapter_event_port_get(uint8_t
> > id, uint8_t *event_port_id);
> >
> > +/**
> > + * Retrieve vector limits for a given event dev and crypto dev pair.
> > + * @see rte_event_crypto_adapter_vector_limits
> > + *
> > + * @param dev_id
> > + *  Event device identifier.
> > + * @param cdev_id
> > + *  Crypto device identifier.
> > + * @param [out] limits
> > + *  A pointer to rte_event_crypto_adapter_vector_limits structure
> > +that has to
> > + * be filled.
> Space missing before "be filled"
Ack

> > + *
> > + * @return
> > + *  - 0: Success.
> > + *  - <0: Error code on failure.
> > + */
> > +int rte_event_crypto_adapter_vector_limits_get(
> > +	uint8_t dev_id, uint16_t cdev_id,
> > +	struct rte_event_crypto_adapter_vector_limits *limits);
> > +
> >  /**
> >   * Enqueue a burst of crypto operations as event objects supplied in
> > *rte_event*
> >   * structure on an event crypto adapter designated by its event
> > *dev_id* through diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h
> > b/lib/eventdev/rte_event_eth_rx_adapter.h
> > index 3608a7b2cf..c8f2936866 100644
> > --- a/lib/eventdev/rte_event_eth_rx_adapter.h
> > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h
> > @@ -457,7 +457,8 @@ int rte_event_eth_rx_adapter_free(uint8_t id);
> >   * @see RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ
> >   *
> >   * @param conf
> > - *  Additional configuration structure of type
> > *rte_event_eth_rx_adapter_conf*
> > + *  Additional configuration structure of type
> > + *  *rte_event_eth_rx_adapter_queue_conf*
> These changes are not relevant. Please consider sending separate patch.
> 
Ack, Will send this change as a separate patch.

> >   *
> >   * @return
> >   *  - 0: Success, Receive queue added correctly.
> > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
> > index
> > 6a6f6ea4c1..1a737bf851 100644
> > --- a/lib/eventdev/rte_eventdev.h
> > +++ b/lib/eventdev/rte_eventdev.h
> > @@ -1203,6 +1203,9 @@ struct rte_event_vector {
> >  #define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR                                   \
> >  	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER) /**< The
> > event vector generated from eth Rx adapter. */
> > +#define RTE_EVENT_TYPE_CRYPTODEV_VECTOR                                        \
> > +	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV) /**< The
> > event
> > +vector generated from cryptodev adapter. */
> >
> >  #define RTE_EVENT_TYPE_MAX              0x10
> >  /**< Maximum number of event types */ @@ -1420,6 +1423,11 @@
> > rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps);
> >   * the private data information along with the crypto session.
> >   */
> >
> > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR   0x10
> > +/**< Flag indicates HW is capable of aggregating processed
> > + * crypto operations into rte_event_vector.
> > + */
> > +
> >  /**
> >   * Retrieve the event device's crypto adapter capabilities for the
> >   * specified cryptodev device
> > --
> > 2.25.1
  
Gujjar, Abhinandan S Sept. 27, 2022, 9:05 a.m. UTC | #5
> -----Original Message-----
> From: Volodymyr Fialko <vfialko@marvell.com>
> Sent: Monday, September 26, 2022 4:32 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org; Jerin
> Jacob Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>
> Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph <anoobj@marvell.com>
> Subject: RE: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> 
> 
> 
> > -----Original Message-----
> > From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> > Sent: Saturday, September 24, 2022 10:44 AM
> > To: Volodymyr Fialko <vfialko@marvell.com>; dev@dpdk.org; Jerin Jacob
> > Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh Bhagavatula
> > <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> > Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> > <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > <jay.jayatheerthan@intel.com>
> > Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph
> > <anoobj@marvell.com>
> > Subject: [EXT] RE: [PATCH 1/3] eventdev: introduce event cryptodev
> > vector type
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> >
> >
> > > -----Original Message-----
> > > From: Volodymyr Fialko <vfialko@marvell.com>
> > > Sent: Thursday, August 4, 2022 3:29 PM
> > > To: dev@dpdk.org; Jerin Jacob <jerinj@marvell.com>; Gujjar,
> > > Abhinandan S <abhinandan.gujjar@intel.com>; Pavan Nikhilesh
> > > <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> > > Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> > > <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > > <jay.jayatheerthan@intel.com>
> > > Cc: gakhil@marvell.com; anoobj@marvell.com; Volodymyr Fialko
> > > <vfialko@marvell.com>
> > > Subject: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> > >
> > > Introduce ability to aggregate crypto operations processed by event
> > > crypto adapter into single event containing rte_event_vector whose
> > > event type is RTE_EVENT_TYPE_CRYPTODEV_VECTOR.
> > >
> > > Application should set RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> > > rte_event_crypto_adapter_queue_conf::flag and provide vector
> > > configuration with respect of
> > > rte_event_crypto_adapter_vector_limits,
> > > which could be obtained by calling
> > > rte_event_crypto_adapter_vector_limits_get, to enable vectorization.
> > >
> > > The event crypto adapter would be responsible for vectorizing the
> > > crypto operations based on provided response information in
> > > rte_event_crypto_metadata::response_info.
> > >
> > > Updated drivers and tests accordingly to new API.
> > >
> > > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> > > ---
> > >  app/test-eventdev/test_perf_common.c          |  10 +-
> > >  app/test/test_event_crypto_adapter.c          |  12 ++-
> > >  .../prog_guide/event_crypto_adapter.rst       |  23 +++-
> > >  drivers/event/cnxk/cn10k_eventdev.c           |   4 +-
> > >  drivers/event/cnxk/cn9k_eventdev.c            |   5 +-
> > >  drivers/event/dpaa/dpaa_eventdev.c            |   9 +-
> > >  drivers/event/dpaa2/dpaa2_eventdev.c          |   9 +-
> > >  drivers/event/octeontx/ssovf_evdev.c          |   4 +-
> > >  lib/eventdev/eventdev_pmd.h                   |  35 +++++-
> > >  lib/eventdev/eventdev_trace.h                 |   6 +-
> > >  lib/eventdev/rte_event_crypto_adapter.c       |  90 ++++++++++++++--
> > >  lib/eventdev/rte_event_crypto_adapter.h       | 101 +++++++++++++++++-
> > >  lib/eventdev/rte_event_eth_rx_adapter.h       |   3 +-
> > >  lib/eventdev/rte_eventdev.h                   |   8 ++
> > >  14 files changed, 276 insertions(+), 43 deletions(-)
> > >
> >
> > I don't see dataplane implementation of vectorization in the crypto adapter!
> > Is it missed out in the patch?
> > comments inline.
> >
> Right now we are targeting crypto_cn10k PMD and ipsec-secgw event mode to
> support vectorization.
Is there a way to test this? When can be dataplane changes expected?

> 
> > > diff --git a/app/test-eventdev/test_perf_common.c b/app/test-
> > > eventdev/test_perf_common.c index 81420be73a..c770bc93f6 100644
> > > --- a/app/test-eventdev/test_perf_common.c
> > > +++ b/app/test-eventdev/test_perf_common.c
> > > @@ -837,14 +837,14 @@ perf_event_crypto_adapter_setup(struct
> > > test_perf *t, struct prod_data *p)
> > >  	}
> > >
> > >  	if (cap &
> > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > -		struct rte_event response_info;
> > > +		struct rte_event_crypto_adapter_queue_conf conf;
> > >
> > > -		response_info.event = 0;
> > > -		response_info.sched_type = RTE_SCHED_TYPE_ATOMIC;
> > > -		response_info.queue_id = p->queue_id;
> > > +		memset(&conf, 0, sizeof(conf));
> > > +		conf.ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
> > > +		conf.ev.queue_id = p->queue_id;
> > >  		ret = rte_event_crypto_adapter_queue_pair_add(
> > >  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
> > > -			&response_info);
> > > +			&conf);
> > >  	} else {
> > >  		ret = rte_event_crypto_adapter_queue_pair_add(
> > >  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
> NULL); diff
> > > --git a/app/test/test_event_crypto_adapter.c
> > > b/app/test/test_event_crypto_adapter.c
> > > index 2ecc7e2cea..bb617c1042 100644
> > > --- a/app/test/test_event_crypto_adapter.c
> > > +++ b/app/test/test_event_crypto_adapter.c
> > > @@ -1175,6 +1175,10 @@ test_crypto_adapter_create(void)  static int
> > >  test_crypto_adapter_qp_add_del(void)
> > >  {
> > > +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> > > +		.ev = response_info,
> > > +	};
> > > +
> > >  	uint32_t cap;
> > >  	int ret;
> > >
> > > @@ -1183,7 +1187,7 @@ test_crypto_adapter_qp_add_del(void)
> > >
> > >  	if (cap &
> > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > >  		ret =
> > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > &response_info);
> > > +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > &queue_conf);
> > >  	} else
> > >  		ret =
> > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > >  					TEST_CDEV_ID, TEST_CDEV_QP_ID,
> NULL); @@ -1206,6 +1210,10 @@
> > > configure_event_crypto_adapter(enum
> > > rte_event_crypto_adapter_mode mode)
> > >  		.new_event_threshold = 1200,
> > >  	};
> > >
> > > +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> > > +		.ev = response_info,
> > > +	};
> > > +
> > >  	uint32_t cap;
> > >  	int ret;
> > >
> > > @@ -1238,7 +1246,7 @@ configure_event_crypto_adapter(enum
> > > rte_event_crypto_adapter_mode mode)
> > >
> > >  	if (cap &
> > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > >  		ret =
> > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > &response_info);
> > > +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > &queue_conf);
> > >  	} else
> > >  		ret =
> > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > >  				TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL); diff
> --git
> > > a/doc/guides/prog_guide/event_crypto_adapter.rst
> > > b/doc/guides/prog_guide/event_crypto_adapter.rst
> > > index 4fb5c688e0..554df7e358 100644
> > > --- a/doc/guides/prog_guide/event_crypto_adapter.rst
> > > +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> > > @@ -201,10 +201,10 @@ capability, event information must be passed
> > > to the add API.
> > >
> > >          ret = rte_event_crypto_adapter_caps_get(id, evdev, &cap);
> > >          if (cap &
> > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > -                struct rte_event event;
> > > +                struct rte_event_crypto_adapter_queue_conf conf;
> > >
> > > -                // Fill in event information & pass it to add API
> > > -                rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id,
> > > &event);
> > > +                // Fill in conf.event information & pass it to add API
> > > +                rte_event_crypto_adapter_queue_pair_add(id,
> > > + cdev_id, qp_id, &conf);
> > >          } else
> > >                  rte_event_crypto_adapter_queue_pair_add(id,
> > > cdev_id, qp_id, NULL);
> > >
> > > @@ -291,6 +291,23 @@ the ``rte_crypto_op``.
> > >                  rte_memcpy(op + len, &m_data, sizeof(m_data));
> > >          }
> > >
> > > +Enable event vectorization
> > > +~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > +
> > > +The event crypto adapter can aggregate outcoming crypto operations
> > > +based on provided response information of
> > > +``rte_event_crypto_metadata::response_info``
> > > +and generate a ``rte_event`` containing ``rte_event_vector`` whose
> > > +event type is ``RTE_EVENT_TYPE_CRYPTODEV_VECTOR``.
> > > +To enable vectorization application should set
> > > +RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> > > +``rte_event_crypto_adapter_queue_conf::flag`` and provide vector
> > > +configuration(size, mempool, etc.) with respect of
> > > +``rte_event_crypto_adapter_vector_limits``, which could be obtained
> > > +by calling ``rte_event_crypto_adapter_vector_limits_get()``.
> > > +
> > > +The RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR capability
> indicates
> > > +whether PMD supports this feature.
> > > +
> > >  Start the adapter instance
> > >  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> > > diff --git a/drivers/event/cnxk/cn10k_eventdev.c
> > > b/drivers/event/cnxk/cn10k_eventdev.c
> > > index 5a0cab40a9..e74ec57382 100644
> > > --- a/drivers/event/cnxk/cn10k_eventdev.c
> > > +++ b/drivers/event/cnxk/cn10k_eventdev.c
> > > @@ -889,11 +889,11 @@ static int
> > >  cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
> > >  			    const struct rte_cryptodev *cdev,
> > >  			    int32_t queue_pair_id,
> > > -			    const struct rte_event *event)
> > > +			    const struct rte_event_crypto_adapter_queue_conf
> > > *conf)
> > >  {
> > >  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> > >
> > > -	RTE_SET_USED(event);
> > > +	RTE_SET_USED(conf);
> > >
> > >  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k");
> > >  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k"); diff --
> > > git a/drivers/event/cnxk/cn9k_eventdev.c
> > > b/drivers/event/cnxk/cn9k_eventdev.c
> > > index 2e27030049..45ed547cb0 100644
> > > --- a/drivers/event/cnxk/cn9k_eventdev.c
> > > +++ b/drivers/event/cnxk/cn9k_eventdev.c
> > > @@ -1120,11 +1120,12 @@ cn9k_crypto_adapter_caps_get(const struct
> > > rte_eventdev *event_dev,  static int
> > > cn9k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
> > >  			   const struct rte_cryptodev *cdev,
> > > -			   int32_t queue_pair_id, const struct rte_event *event)
> > > +			   int32_t queue_pair_id,
> > > +			   const struct rte_event_crypto_adapter_queue_conf
> > > *conf)
> > >  {
> > >  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> > >
> > > -	RTE_SET_USED(event);
> > > +	RTE_SET_USED(conf);
> > >
> > >  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k");
> > >  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k"); diff --git
> > > a/drivers/event/dpaa/dpaa_eventdev.c
> > > b/drivers/event/dpaa/dpaa_eventdev.c
> > > index ff6cc0be18..2b9ecd9fbf 100644
> > > --- a/drivers/event/dpaa/dpaa_eventdev.c
> > > +++ b/drivers/event/dpaa/dpaa_eventdev.c
> > > @@ -26,6 +26,7 @@
> > >  #include <rte_eventdev.h>
> > >  #include <eventdev_pmd_vdev.h>
> > >  #include <rte_ethdev.h>
> > > +#include <rte_event_crypto_adapter.h>
> > >  #include <rte_event_eth_rx_adapter.h>  #include
> > > <rte_event_eth_tx_adapter.h>  #include <cryptodev_pmd.h> @@ -775,10
> > > +776,10 @@ static int  dpaa_eventdev_crypto_queue_add(const struct
> > > rte_eventdev *dev,
> > >  		const struct rte_cryptodev *cryptodev,
> > >  		int32_t rx_queue_id,
> > > -		const struct rte_event *ev)
> > > +		const struct rte_event_crypto_adapter_queue_conf *conf)
> > >  {
> > >  	struct dpaa_eventdev *priv = dev->data->dev_private;
> > > -	uint8_t ev_qid = ev->queue_id;
> > > +	uint8_t ev_qid = conf->ev.queue_id;
> > >  	u16 ch_id = priv->evq_info[ev_qid].ch_id;
> > >  	int ret;
> > >
> > > @@ -786,10 +787,10 @@ dpaa_eventdev_crypto_queue_add(const struct
> > > rte_eventdev *dev,
> > >
> > >  	if (rx_queue_id == -1)
> > >  		return dpaa_eventdev_crypto_queue_add_all(dev,
> > > -				cryptodev, ev);
> > > +				cryptodev, &conf->ev);
> > >
> > >  	ret = dpaa_sec_eventq_attach(cryptodev, rx_queue_id,
> > > -			ch_id, ev);
> > > +			ch_id, &conf->ev);
> > >  	if (ret) {
> > >  		DPAA_EVENTDEV_ERR(
> > >  			"dpaa_sec_eventq_attach failed: ret: %d\n", ret); diff -
> -git
> > > a/drivers/event/dpaa2/dpaa2_eventdev.c
> > > b/drivers/event/dpaa2/dpaa2_eventdev.c
> > > index ffc7b8b073..0137736794 100644
> > > --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> > > +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> > > @@ -26,6 +26,7 @@
> > >  #include <rte_bus_vdev.h>
> > >  #include <ethdev_driver.h>
> > >  #include <cryptodev_pmd.h>
> > > +#include <rte_event_crypto_adapter.h>
> > >  #include <rte_event_eth_rx_adapter.h>  #include
> > > <rte_event_eth_tx_adapter.h>
> > >
> > > @@ -865,10 +866,10 @@ static int
> > >  dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
> > >  		const struct rte_cryptodev *cryptodev,
> > >  		int32_t rx_queue_id,
> > > -		const struct rte_event *ev)
> > > +		const struct rte_event_crypto_adapter_queue_conf *conf)
> > >  {
> > >  	struct dpaa2_eventdev *priv = dev->data->dev_private;
> > > -	uint8_t ev_qid = ev->queue_id;
> > > +	uint8_t ev_qid = conf->ev.queue_id;
> > >  	struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon;
> > >  	int ret;
> > >
> > > @@ -876,10 +877,10 @@ dpaa2_eventdev_crypto_queue_add(const struct
> > > rte_eventdev *dev,
> > >
> > >  	if (rx_queue_id == -1)
> > >  		return dpaa2_eventdev_crypto_queue_add_all(dev,
> > > -				cryptodev, ev);
> > > +				cryptodev, &conf->ev);
> > >
> > >  	ret = dpaa2_sec_eventq_attach(cryptodev, rx_queue_id,
> > > -				      dpcon, ev);
> > > +				      dpcon, &conf->ev);
> > >  	if (ret) {
> > >  		DPAA2_EVENTDEV_ERR(
> > >  			"dpaa2_sec_eventq_attach failed: ret: %d\n", ret); diff
> --git
> > > a/drivers/event/octeontx/ssovf_evdev.c
> > > b/drivers/event/octeontx/ssovf_evdev.c
> > > index 9e14e35d10..17acd8ef64 100644
> > > --- a/drivers/event/octeontx/ssovf_evdev.c
> > > +++ b/drivers/event/octeontx/ssovf_evdev.c
> > > @@ -745,12 +745,12 @@ static int
> > >  ssovf_crypto_adapter_qp_add(const struct rte_eventdev *dev,
> > >  			    const struct rte_cryptodev *cdev,
> > >  			    int32_t queue_pair_id,
> > > -			    const struct rte_event *event)
> > > +			    const struct rte_event_crypto_adapter_queue_conf
> > > *conf)
> > >  {
> > >  	struct cpt_instance *qp;
> > >  	uint8_t qp_id;
> > >
> > > -	RTE_SET_USED(event);
> > > +	RTE_SET_USED(conf);
> > >
> > >  	if (queue_pair_id == -1) {
> > >  		for (qp_id = 0; qp_id < cdev->data->nb_queue_pairs; qp_id++) {
> > > diff --git a/lib/eventdev/eventdev_pmd.h
> > > b/lib/eventdev/eventdev_pmd.h index 69402668d8..bcfc9cbcb2 100644
> > > --- a/lib/eventdev/eventdev_pmd.h
> > > +++ b/lib/eventdev/eventdev_pmd.h
> > > @@ -907,6 +907,7 @@ rte_event_pmd_selftest_seqn(struct rte_mbuf
> > > *mbuf) }
> > >
> > >  struct rte_cryptodev;
> > > +struct rte_event_crypto_adapter_queue_conf;
> > >
> > >  /**
> > >   * This API may change without prior notice @@ -961,11 +962,11 @@
> > > typedef int (*eventdev_crypto_adapter_caps_get_t)
> > >   *   - <0: Error code returned by the driver function.
> > >   *
> > >   */
> > > -typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
> > > -			(const struct rte_eventdev *dev,
> > > -			 const struct rte_cryptodev *cdev,
> > > -			 int32_t queue_pair_id,
> > > -			 const struct rte_event *event);
> > > +typedef int (*eventdev_crypto_adapter_queue_pair_add_t)(
> > > +		const struct rte_eventdev *dev,
> > > +		const struct rte_cryptodev *cdev,
> > > +		int32_t queue_pair_id,
> > > +		const struct rte_event_crypto_adapter_queue_conf
> > > *queue_conf);
> > >
> > >
> > >  /**
> > > @@ -1074,6 +1075,27 @@ typedef int
> > > (*eventdev_crypto_adapter_stats_reset)
> > >  			(const struct rte_eventdev *dev,
> > >  			 const struct rte_cryptodev *cdev);
> > >
> > > +struct rte_event_crypto_adapter_vector_limits;
> > > +/**
> > > + * Get event vector limits for a given event, crypto device pair.
> > > + *
> > > + * @param dev
> > > + *   Event device pointer
> > > + *
> > > + * @param cdev
> > > + *   Crypto device pointer
> > > + *
> > > + * @param[out] limits
> > > + *   Pointer to the limits structure to be filled.
> > > + *
> > > + * @return
> > > + *   - 0: Success.
> > > + *   - <0: Error code returned by the driver function.
> > > + */
> > > +typedef int (*eventdev_crypto_adapter_vector_limits_get_t)(
> > > +	const struct rte_eventdev *dev, const struct rte_cryptodev *cdev,
> > > +	struct rte_event_crypto_adapter_vector_limits *limits);
> > > +
> > >  /**
> > >   * Retrieve the event device's eth Tx adapter capabilities.
> > >   *
> > > @@ -1339,6 +1361,9 @@ struct eventdev_ops {
> > >  	/**< Get crypto stats */
> > >  	eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
> > >  	/**< Reset crypto stats */
> > > +	eventdev_crypto_adapter_vector_limits_get_t
> > > +		crypto_adapter_vector_limits_get;
> > > +	/**< Get event vector limits for the crypto adapter */
> > >
> > >  	eventdev_eth_rx_adapter_q_stats_get
> > > eth_rx_adapter_queue_stats_get;
> > >  	/**< Get ethernet Rx queue stats */ diff --git
> > > a/lib/eventdev/eventdev_trace.h b/lib/eventdev/eventdev_trace.h
> > > index 5ec43d80ee..d48cd58850 100644
> > > --- a/lib/eventdev/eventdev_trace.h
> > > +++ b/lib/eventdev/eventdev_trace.h
> > > @@ -18,6 +18,7 @@ extern "C" {
> > >  #include <rte_trace_point.h>
> > >
> > >  #include "rte_eventdev.h"
> > > +#include "rte_event_crypto_adapter.h"
> > >  #include "rte_event_eth_rx_adapter.h"
> > >  #include "rte_event_timer_adapter.h"
> > >
> > > @@ -271,11 +272,12 @@ RTE_TRACE_POINT(  RTE_TRACE_POINT(
> > >  	rte_eventdev_trace_crypto_adapter_queue_pair_add,
> > >  	RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t cdev_id,
> > > -		const void *event, int32_t queue_pair_id),
> > > +		int32_t queue_pair_id,
> > > +		const struct rte_event_crypto_adapter_queue_conf *conf),
> > >  	rte_trace_point_emit_u8(adptr_id);
> > >  	rte_trace_point_emit_u8(cdev_id);
> > >  	rte_trace_point_emit_i32(queue_pair_id);
> > > -	rte_trace_point_emit_ptr(event);
> > > +	rte_trace_point_emit_ptr(conf);
> > >  )
> > >
> > >  RTE_TRACE_POINT(
> > > diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> > > b/lib/eventdev/rte_event_crypto_adapter.c
> > > index 7c695176f4..73a4f231e2 100644
> > > --- a/lib/eventdev/rte_event_crypto_adapter.c
> > > +++ b/lib/eventdev/rte_event_crypto_adapter.c
> > > @@ -921,11 +921,12 @@ int
> > >  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
> > >  			uint8_t cdev_id,
> > >  			int32_t queue_pair_id,
> > > -			const struct rte_event *event)
> > > +			const struct rte_event_crypto_adapter_queue_conf
> > > *conf)
> > >  {
> > > +	struct rte_event_crypto_adapter_vector_limits limits;
> > >  	struct event_crypto_adapter *adapter;
> > > -	struct rte_eventdev *dev;
> > >  	struct crypto_device_info *dev_info;
> > > +	struct rte_eventdev *dev;
> > >  	uint32_t cap;
> > >  	int ret;
> > >
> > > @@ -951,11 +952,47 @@
> > > rte_event_crypto_adapter_queue_pair_add(uint8_t
> > > id,
> > >  	}
> > >
> > >  	if ((cap &
> > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) &&
> > > -	    (event == NULL)) {
> > > +	    (conf == NULL)) {
> > >  		RTE_EDEV_LOG_ERR("Conf value can not be NULL for
> dev_id=%u",
> > >  				  cdev_id);
> > >  		return -EINVAL;
> > >  	}
> > Newline?
> >
> Ack
> 
> > > +	if ((conf != NULL) &&
> > Checking conf twice?
> Will rewrite as if conf == NULL/else, to avoid double checking.
> 
> > > +	    (conf->flags & RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR)) {
> > Else condition if the flags is not set?
> There's no additional handing for case when flag is no set.
> 
> > > +		if ((cap &
> > > RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR) == 0) {
> > > +			RTE_EDEV_LOG_ERR("Event vectorization is not
> > > supported,"
> > > +					 "dev %" PRIu8 " cdev %" PRIu8, id,
> > > +					 cdev_id);
> > > +			return -ENOTSUP;
> > > +		}
> > > +
> > > +		ret = rte_event_crypto_adapter_vector_limits_get(
> > > +			adapter->eventdev_id, cdev_id, &limits);
> > > +		if (ret < 0) {
> > > +			RTE_EDEV_LOG_ERR("Failed to get event device vector
> > > "
> > > +					 "limits, dev %" PRIu8 " cdev %" PRIu8,
> > > +					 id, cdev_id);
> > > +			return -EINVAL;
> > > +		}
> > New line? Please check other cases.
> >
> Ack
> 
> > > +		if (conf->vector_sz < limits.min_sz ||
> > > +		    conf->vector_sz > limits.max_sz ||
> > > +		    conf->vector_timeout_ns < limits.min_timeout_ns ||
> > > +		    conf->vector_timeout_ns > limits.max_timeout_ns ||
> > > +		    conf->vector_mp == NULL) {
> > > +			RTE_EDEV_LOG_ERR("Invalid event vector
> > > configuration,"
> > > +					 " dev %" PRIu8 " cdev %" PRIu8,
> > > +					 id, cdev_id);
> > > +			return -EINVAL;
> > > +		}
> > > +		if (conf->vector_mp->elt_size <
> > > +		    (sizeof(struct rte_event_vector) +
> > > +		     (sizeof(uintptr_t) * conf->vector_sz))) {
> > > +			RTE_EDEV_LOG_ERR("Invalid event vector
> > > configuration,"
> > > +					 " dev %" PRIu8 " cdev %" PRIu8,
> > > +					 id, cdev_id);
> > > +			return -EINVAL;
> > > +		}
> > > +	}
> > >
> > >  	dev_info = &adapter->cdevs[cdev_id];
> > >
> > > @@ -990,7 +1027,7 @@
> rte_event_crypto_adapter_queue_pair_add(uint8_t
> > > id,
> > >  		ret = (*dev->dev_ops->crypto_adapter_queue_pair_add)(dev,
> > >  				dev_info->dev,
> > >  				queue_pair_id,
> > > -				event);
> > > +				conf);
> > >  		if (ret)
> > >  			return ret;
> > >
> > > @@ -1030,8 +1067,8 @@
> > > rte_event_crypto_adapter_queue_pair_add(uint8_t
> > > id,
> > >  		rte_service_component_runstate_set(adapter->service_id, 1);
> > >  	}
> > >
> > > -	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
> > > event,
> > > -		queue_pair_id);
> > > +	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
> > > +		queue_pair_id, conf);
> > >  	return 0;
> > >  }
> > >
> > > @@ -1290,3 +1327,44 @@
> > > rte_event_crypto_adapter_event_port_get(uint8_t
> > > id, uint8_t *event_port_id)
> > >
> > >  	return 0;
> > >  }
> > > +
> > > +int
> > > +rte_event_crypto_adapter_vector_limits_get(
> > > +	uint8_t dev_id, uint16_t cdev_id,
> > > +	struct rte_event_crypto_adapter_vector_limits *limits) {
> > > +	struct rte_cryptodev *cdev;
> > > +	struct rte_eventdev *dev;
> > > +	uint32_t cap;
> > > +	int ret;
> > > +
> > > +	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> > > +
> > > +	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
> > > +		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
> > > +		return -EINVAL;
> > > +	}
> > > +
> > > +	if (limits == NULL)
> > > +		return -EINVAL;
> > Add appropriate error message like above?
> Ack, will add.
> 
> > > +
> > > +	dev = &rte_eventdevs[dev_id];
> > > +	cdev = rte_cryptodev_pmd_get_dev(cdev_id);
> > > +
> > > +	ret = rte_event_crypto_adapter_caps_get(dev_id, cdev_id, &cap);
> > > +	if (ret) {
> > > +		RTE_EDEV_LOG_ERR("Failed to get adapter caps edev %" PRIu8
> > > +				 "cdev %" PRIu16, dev_id, cdev_id);
> > > +		return ret;
> > > +	}
> > > +
> > > +	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR))
> > > +		return -ENOTSUP;
> > Same here.
> Ack, will add.
> 
> > > +
> > > +	RTE_FUNC_PTR_OR_ERR_RET(
> > > +		*dev->dev_ops->crypto_adapter_vector_limits_get,
> > > +		-ENOTSUP);
> > > +
> > > +	return dev->dev_ops->crypto_adapter_vector_limits_get(
> > > +		dev, cdev, limits);
> > > +}
> > > diff --git a/lib/eventdev/rte_event_crypto_adapter.h
> > > b/lib/eventdev/rte_event_crypto_adapter.h
> > > index d90a19e72c..7dd6171b9b 100644
> > > --- a/lib/eventdev/rte_event_crypto_adapter.h
> > > +++ b/lib/eventdev/rte_event_crypto_adapter.h
> > > @@ -253,6 +253,78 @@ struct rte_event_crypto_adapter_conf {
> > >  	 */
> > >  };
> > >
> > > +#define RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR	0x1
> > > +/**< This flag indicates that crypto operations processed on the
> > > +crypto
> > > + * adapter need to be vectorized
> > > + * @see rte_event_crypto_adapter_queue_conf::flags
> > > + */
> > > +
> > > +/**
> > > + * Adapter queue configuration structure  */ struct
> > > +rte_event_crypto_adapter_queue_conf {
> > > +	uint32_t flags;
> > > +	/**< Flags for handling crypto operations
> > > +	 * @see RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
> > > +	 */
> > > +	struct rte_event ev;
> > > +	/**< If HW supports cryptodev queue pair to event queue binding,
> > > +	 * application is expected to fill in event information.
> > > +	 * @see
> > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> > > +	 */
> > > +	uint16_t vector_sz;
> > > +	/**< Indicates the maximum number for crypto operations to combine
> > > and
> > > +	 * form a vector.
> > > +	 * @see rte_event_crypto_adapter_vector_limits::min_sz
> > > +	 * @see rte_event_crypto_adapter_vector_limits::max_sz
> > > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> > > set in
> > > +	 * @see rte_event_crypto_adapter_queue_conf::rx_queue_flags
> > rx_queue_flags??
> Typo, should be conf::flags.
> 
> > > +	 */
> > > +	uint64_t vector_timeout_ns;
> > > +	/**<
> > > +	 * Indicates the maximum number of nanoseconds to wait for
> > > aggregating
> > > +	 * crypto operations. Should be within vectorization limits of the
> > > +	 * adapter
> > > +	 * @see rte_event_crypto_adapter_vector_limits::min_timeout_ns
> > > +	 * @see rte_event_crypto_adapter_vector_limits::max_timeout_ns
> > > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> > > set in
> > > +	 * @see rte_event_crypto_adapter_queue_conf::flags
> > > +	 */
> > > +	struct rte_mempool *vector_mp;
> > > +	/**< Indicates the mempool that should be used for allocating
> > > +	 * rte_event_vector container.
> > > +	 * Should be created by using `rte_event_vector_pool_create`.
> > > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> > > set in
> > > +	 * @see rte_event_crypto_adapter_queue_conf::flags.
> > > +	 */
> > > +};
> > > +
> > > +/**
> > > + * A structure used to retrieve event crypto adapter vector limits.
> > > + */
> > > +struct rte_event_crypto_adapter_vector_limits {
> > > +	uint16_t min_sz;
> > > +	/**< Minimum vector limit configurable.
> > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > > +	 */
> > > +	uint16_t max_sz;
> > > +	/**< Maximum vector limit configurable.
> > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > > +	 */
> > > +	uint8_t log2_sz;
> > > +	/**< True if the size configured should be in log2.
> > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > > +	 */
> > > +	uint64_t min_timeout_ns;
> > > +	/**< Minimum vector timeout configurable.
> > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> > > +	 */
> > > +	uint64_t max_timeout_ns;
> > > +	/**< Maximum vector timeout configurable.
> > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> > > +	 */
> > > +};
> > > +
> > >  /**
> > >   * Function type used for adapter configuration callback. The callback is
> > >   * used to fill in members of the struct
> > > rte_event_crypto_adapter_conf, this @@ -392,10 +464,9 @@
> > rte_event_crypto_adapter_free(uint8_t id);
> > >   *  Cryptodev queue pair identifier. If queue_pair_id is set -1,
> > >   *  adapter adds all the pre configured queue pairs to the instance.
> > >   *
> > > - * @param event
> > > - *  if HW supports cryptodev queue pair to event queue binding,
> > > application is
> > > - *  expected to fill in event information, else it will be NULL.
> > > - *  @see
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> > > + * @param conf
> > > + *  Additional configuration structure of type
> > > + *  *rte_event_crypto_adapter_queue_conf*
> > >   *
> > >   * @return
> > >   *  - 0: Success, queue pair added correctly.
> > > @@ -405,7 +476,7 @@ int
> > >  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
> > >  			uint8_t cdev_id,
> > >  			int32_t queue_pair_id,
> > > -			const struct rte_event *event);
> > > +			const struct rte_event_crypto_adapter_queue_conf
> > > *conf);
> > >
> > >  /**
> > >   * Delete a queue pair from an event crypto adapter.
> > > @@ -523,6 +594,26 @@ rte_event_crypto_adapter_service_id_get(uint8_t
> > > id, uint32_t *service_id);  int
> > > rte_event_crypto_adapter_event_port_get(uint8_t
> > > id, uint8_t *event_port_id);
> > >
> > > +/**
> > > + * Retrieve vector limits for a given event dev and crypto dev pair.
> > > + * @see rte_event_crypto_adapter_vector_limits
> > > + *
> > > + * @param dev_id
> > > + *  Event device identifier.
> > > + * @param cdev_id
> > > + *  Crypto device identifier.
> > > + * @param [out] limits
> > > + *  A pointer to rte_event_crypto_adapter_vector_limits structure
> > > +that has to
> > > + * be filled.
> > Space missing before "be filled"
> Ack
> 
> > > + *
> > > + * @return
> > > + *  - 0: Success.
> > > + *  - <0: Error code on failure.
> > > + */
> > > +int rte_event_crypto_adapter_vector_limits_get(
> > > +	uint8_t dev_id, uint16_t cdev_id,
> > > +	struct rte_event_crypto_adapter_vector_limits *limits);
> > > +
> > >  /**
> > >   * Enqueue a burst of crypto operations as event objects supplied
> > > in
> > > *rte_event*
> > >   * structure on an event crypto adapter designated by its event
> > > *dev_id* through diff --git
> > > a/lib/eventdev/rte_event_eth_rx_adapter.h
> > > b/lib/eventdev/rte_event_eth_rx_adapter.h
> > > index 3608a7b2cf..c8f2936866 100644
> > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h
> > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h
> > > @@ -457,7 +457,8 @@ int rte_event_eth_rx_adapter_free(uint8_t id);
> > >   * @see RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ
> > >   *
> > >   * @param conf
> > > - *  Additional configuration structure of type
> > > *rte_event_eth_rx_adapter_conf*
> > > + *  Additional configuration structure of type
> > > + *  *rte_event_eth_rx_adapter_queue_conf*
> > These changes are not relevant. Please consider sending separate patch.
> >
> Ack, Will send this change as a separate patch.
> 
> > >   *
> > >   * @return
> > >   *  - 0: Success, Receive queue added correctly.
> > > diff --git a/lib/eventdev/rte_eventdev.h
> > > b/lib/eventdev/rte_eventdev.h index
> > > 6a6f6ea4c1..1a737bf851 100644
> > > --- a/lib/eventdev/rte_eventdev.h
> > > +++ b/lib/eventdev/rte_eventdev.h
> > > @@ -1203,6 +1203,9 @@ struct rte_event_vector {
> > >  #define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR
> \
> > >  	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER)
> /**< The
> > > event vector generated from eth Rx adapter. */
> > > +#define RTE_EVENT_TYPE_CRYPTODEV_VECTOR                                        \
> > > +	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV) /**< The
> > > event
> > > +vector generated from cryptodev adapter. */
> > >
> > >  #define RTE_EVENT_TYPE_MAX              0x10
> > >  /**< Maximum number of event types */ @@ -1420,6 +1423,11 @@
> > > rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps);
> > >   * the private data information along with the crypto session.
> > >   */
> > >
> > > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR   0x10
> > > +/**< Flag indicates HW is capable of aggregating processed
> > > + * crypto operations into rte_event_vector.
> > > + */
> > > +
> > >  /**
> > >   * Retrieve the event device's crypto adapter capabilities for the
> > >   * specified cryptodev device
> > > --
> > > 2.25.1
  
Volodymyr Fialko Sept. 27, 2022, 9:24 a.m. UTC | #6
> -----Original Message-----
> From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> Sent: Tuesday, September 27, 2022 11:05 AM
> To: Volodymyr Fialko <vfialko@marvell.com>; dev@dpdk.org; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>; Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Shijith Thotton
> <sthotton@marvell.com>; Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay <jay.jayatheerthan@intel.com>
> Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph <anoobj@marvell.com>
> Subject: [EXT] RE: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> 
> External Email
> 
> ----------------------------------------------------------------------
> 
> 
> > -----Original Message-----
> > From: Volodymyr Fialko <vfialko@marvell.com>
> > Sent: Monday, September 26, 2022 4:32 PM
> > To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org;
> > Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh
> > Bhagavatula <pbhagavatula@marvell.com>; Shijith Thotton
> > <sthotton@marvell.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> > Sachin Saxena <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > <jay.jayatheerthan@intel.com>
> > Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph
> > <anoobj@marvell.com>
> > Subject: RE: [PATCH 1/3] eventdev: introduce event cryptodev vector
> > type
> >
> >
> >
> > > -----Original Message-----
> > > From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> > > Sent: Saturday, September 24, 2022 10:44 AM
> > > To: Volodymyr Fialko <vfialko@marvell.com>; dev@dpdk.org; Jerin
> > > Jacob Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh
> > > Bhagavatula <pbhagavatula@marvell.com>; Shijith Thotton
> > > <sthotton@marvell.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> > > Sachin Saxena <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > > <jay.jayatheerthan@intel.com>
> > > Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph
> > > <anoobj@marvell.com>
> > > Subject: [EXT] RE: [PATCH 1/3] eventdev: introduce event cryptodev
> > > vector type
> > >
> > > External Email
> > >
> > > --------------------------------------------------------------------
> > > --
> > >
> > >
> > > > -----Original Message-----
> > > > From: Volodymyr Fialko <vfialko@marvell.com>
> > > > Sent: Thursday, August 4, 2022 3:29 PM
> > > > To: dev@dpdk.org; Jerin Jacob <jerinj@marvell.com>; Gujjar,
> > > > Abhinandan S <abhinandan.gujjar@intel.com>; Pavan Nikhilesh
> > > > <pbhagavatula@marvell.com>; Shijith Thotton
> > > > <sthotton@marvell.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> > > > Sachin Saxena <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > > > <jay.jayatheerthan@intel.com>
> > > > Cc: gakhil@marvell.com; anoobj@marvell.com; Volodymyr Fialko
> > > > <vfialko@marvell.com>
> > > > Subject: [PATCH 1/3] eventdev: introduce event cryptodev vector
> > > > type
> > > >
> > > > Introduce ability to aggregate crypto operations processed by
> > > > event crypto adapter into single event containing rte_event_vector
> > > > whose event type is RTE_EVENT_TYPE_CRYPTODEV_VECTOR.
> > > >
> > > > Application should set RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> > > > rte_event_crypto_adapter_queue_conf::flag and provide vector
> > > > configuration with respect of
> > > > rte_event_crypto_adapter_vector_limits,
> > > > which could be obtained by calling
> > > > rte_event_crypto_adapter_vector_limits_get, to enable vectorization.
> > > >
> > > > The event crypto adapter would be responsible for vectorizing the
> > > > crypto operations based on provided response information in
> > > > rte_event_crypto_metadata::response_info.
> > > >
> > > > Updated drivers and tests accordingly to new API.
> > > >
> > > > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> > > > ---
> > > >  app/test-eventdev/test_perf_common.c          |  10 +-
> > > >  app/test/test_event_crypto_adapter.c          |  12 ++-
> > > >  .../prog_guide/event_crypto_adapter.rst       |  23 +++-
> > > >  drivers/event/cnxk/cn10k_eventdev.c           |   4 +-
> > > >  drivers/event/cnxk/cn9k_eventdev.c            |   5 +-
> > > >  drivers/event/dpaa/dpaa_eventdev.c            |   9 +-
> > > >  drivers/event/dpaa2/dpaa2_eventdev.c          |   9 +-
> > > >  drivers/event/octeontx/ssovf_evdev.c          |   4 +-
> > > >  lib/eventdev/eventdev_pmd.h                   |  35 +++++-
> > > >  lib/eventdev/eventdev_trace.h                 |   6 +-
> > > >  lib/eventdev/rte_event_crypto_adapter.c       |  90 ++++++++++++++--
> > > >  lib/eventdev/rte_event_crypto_adapter.h       | 101 +++++++++++++++++-
> > > >  lib/eventdev/rte_event_eth_rx_adapter.h       |   3 +-
> > > >  lib/eventdev/rte_eventdev.h                   |   8 ++
> > > >  14 files changed, 276 insertions(+), 43 deletions(-)
> > > >
> > >
> > > I don't see dataplane implementation of vectorization in the crypto adapter!
> > > Is it missed out in the patch?
> > > comments inline.
> > >
> > Right now we are targeting crypto_cn10k PMD and ipsec-secgw event mode
> > to support vectorization.
> Is there a way to test this? When can be dataplane changes expected?
> 
If the spec looks okay, support in s/w crypto adapter and other h/w PMDs can be added by respective maintainers. Currently, we are adding library change, support for one PMD and an application to test the feature. Feature is exposed with capability flag to not break existing functionality.

> >
> > > > diff --git a/app/test-eventdev/test_perf_common.c b/app/test-
> > > > eventdev/test_perf_common.c index 81420be73a..c770bc93f6 100644
> > > > --- a/app/test-eventdev/test_perf_common.c
> > > > +++ b/app/test-eventdev/test_perf_common.c
> > > > @@ -837,14 +837,14 @@ perf_event_crypto_adapter_setup(struct
> > > > test_perf *t, struct prod_data *p)
> > > >  	}
> > > >
> > > >  	if (cap &
> > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > > -		struct rte_event response_info;
> > > > +		struct rte_event_crypto_adapter_queue_conf conf;
> > > >
> > > > -		response_info.event = 0;
> > > > -		response_info.sched_type = RTE_SCHED_TYPE_ATOMIC;
> > > > -		response_info.queue_id = p->queue_id;
> > > > +		memset(&conf, 0, sizeof(conf));
> > > > +		conf.ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
> > > > +		conf.ev.queue_id = p->queue_id;
> > > >  		ret = rte_event_crypto_adapter_queue_pair_add(
> > > >  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
> > > > -			&response_info);
> > > > +			&conf);
> > > >  	} else {
> > > >  		ret = rte_event_crypto_adapter_queue_pair_add(
> > > >  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
> > NULL); diff
> > > > --git a/app/test/test_event_crypto_adapter.c
> > > > b/app/test/test_event_crypto_adapter.c
> > > > index 2ecc7e2cea..bb617c1042 100644
> > > > --- a/app/test/test_event_crypto_adapter.c
> > > > +++ b/app/test/test_event_crypto_adapter.c
> > > > @@ -1175,6 +1175,10 @@ test_crypto_adapter_create(void)  static
> > > > int
> > > >  test_crypto_adapter_qp_add_del(void)
> > > >  {
> > > > +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> > > > +		.ev = response_info,
> > > > +	};
> > > > +
> > > >  	uint32_t cap;
> > > >  	int ret;
> > > >
> > > > @@ -1183,7 +1187,7 @@ test_crypto_adapter_qp_add_del(void)
> > > >
> > > >  	if (cap &
> > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > >  		ret =
> > > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > > -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > > &response_info);
> > > > +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > > &queue_conf);
> > > >  	} else
> > > >  		ret =
> > > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > >  					TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > NULL); @@ -1206,6 +1210,10 @@
> > > > configure_event_crypto_adapter(enum
> > > > rte_event_crypto_adapter_mode mode)
> > > >  		.new_event_threshold = 1200,
> > > >  	};
> > > >
> > > > +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> > > > +		.ev = response_info,
> > > > +	};
> > > > +
> > > >  	uint32_t cap;
> > > >  	int ret;
> > > >
> > > > @@ -1238,7 +1246,7 @@ configure_event_crypto_adapter(enum
> > > > rte_event_crypto_adapter_mode mode)
> > > >
> > > >  	if (cap &
> > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > >  		ret =
> > > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > > -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > > &response_info);
> > > > +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > > &queue_conf);
> > > >  	} else
> > > >  		ret =
> > > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > >  				TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL); diff
> > --git
> > > > a/doc/guides/prog_guide/event_crypto_adapter.rst
> > > > b/doc/guides/prog_guide/event_crypto_adapter.rst
> > > > index 4fb5c688e0..554df7e358 100644
> > > > --- a/doc/guides/prog_guide/event_crypto_adapter.rst
> > > > +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> > > > @@ -201,10 +201,10 @@ capability, event information must be passed
> > > > to the add API.
> > > >
> > > >          ret = rte_event_crypto_adapter_caps_get(id, evdev, &cap);
> > > >          if (cap &
> > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > > -                struct rte_event event;
> > > > +                struct rte_event_crypto_adapter_queue_conf conf;
> > > >
> > > > -                // Fill in event information & pass it to add API
> > > > -                rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id,
> > > > &event);
> > > > +                // Fill in conf.event information & pass it to add API
> > > > +                rte_event_crypto_adapter_queue_pair_add(id,
> > > > + cdev_id, qp_id, &conf);
> > > >          } else
> > > >                  rte_event_crypto_adapter_queue_pair_add(id,
> > > > cdev_id, qp_id, NULL);
> > > >
> > > > @@ -291,6 +291,23 @@ the ``rte_crypto_op``.
> > > >                  rte_memcpy(op + len, &m_data, sizeof(m_data));
> > > >          }
> > > >
> > > > +Enable event vectorization
> > > > +~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > +
> > > > +The event crypto adapter can aggregate outcoming crypto
> > > > +operations based on provided response information of
> > > > +``rte_event_crypto_metadata::response_info``
> > > > +and generate a ``rte_event`` containing ``rte_event_vector``
> > > > +whose event type is ``RTE_EVENT_TYPE_CRYPTODEV_VECTOR``.
> > > > +To enable vectorization application should set
> > > > +RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> > > > +``rte_event_crypto_adapter_queue_conf::flag`` and provide vector
> > > > +configuration(size, mempool, etc.) with respect of
> > > > +``rte_event_crypto_adapter_vector_limits``, which could be
> > > > +obtained by calling ``rte_event_crypto_adapter_vector_limits_get()``.
> > > > +
> > > > +The RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR capability
> > indicates
> > > > +whether PMD supports this feature.
> > > > +
> > > >  Start the adapter instance
> > > >  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > >
> > > > diff --git a/drivers/event/cnxk/cn10k_eventdev.c
> > > > b/drivers/event/cnxk/cn10k_eventdev.c
> > > > index 5a0cab40a9..e74ec57382 100644
> > > > --- a/drivers/event/cnxk/cn10k_eventdev.c
> > > > +++ b/drivers/event/cnxk/cn10k_eventdev.c
> > > > @@ -889,11 +889,11 @@ static int
> > > >  cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
> > > >  			    const struct rte_cryptodev *cdev,
> > > >  			    int32_t queue_pair_id,
> > > > -			    const struct rte_event *event)
> > > > +			    const struct rte_event_crypto_adapter_queue_conf
> > > > *conf)
> > > >  {
> > > >  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> > > >
> > > > -	RTE_SET_USED(event);
> > > > +	RTE_SET_USED(conf);
> > > >
> > > >  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k");
> > > >  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k"); diff --
> > > > git a/drivers/event/cnxk/cn9k_eventdev.c
> > > > b/drivers/event/cnxk/cn9k_eventdev.c
> > > > index 2e27030049..45ed547cb0 100644
> > > > --- a/drivers/event/cnxk/cn9k_eventdev.c
> > > > +++ b/drivers/event/cnxk/cn9k_eventdev.c
> > > > @@ -1120,11 +1120,12 @@ cn9k_crypto_adapter_caps_get(const struct
> > > > rte_eventdev *event_dev,  static int
> > > > cn9k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
> > > >  			   const struct rte_cryptodev *cdev,
> > > > -			   int32_t queue_pair_id, const struct rte_event *event)
> > > > +			   int32_t queue_pair_id,
> > > > +			   const struct rte_event_crypto_adapter_queue_conf
> > > > *conf)
> > > >  {
> > > >  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> > > >
> > > > -	RTE_SET_USED(event);
> > > > +	RTE_SET_USED(conf);
> > > >
> > > >  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k");
> > > >  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k"); diff
> > > > --git a/drivers/event/dpaa/dpaa_eventdev.c
> > > > b/drivers/event/dpaa/dpaa_eventdev.c
> > > > index ff6cc0be18..2b9ecd9fbf 100644
> > > > --- a/drivers/event/dpaa/dpaa_eventdev.c
> > > > +++ b/drivers/event/dpaa/dpaa_eventdev.c
> > > > @@ -26,6 +26,7 @@
> > > >  #include <rte_eventdev.h>
> > > >  #include <eventdev_pmd_vdev.h>
> > > >  #include <rte_ethdev.h>
> > > > +#include <rte_event_crypto_adapter.h>
> > > >  #include <rte_event_eth_rx_adapter.h>  #include
> > > > <rte_event_eth_tx_adapter.h>  #include <cryptodev_pmd.h> @@
> > > > -775,10
> > > > +776,10 @@ static int  dpaa_eventdev_crypto_queue_add(const struct
> > > > rte_eventdev *dev,
> > > >  		const struct rte_cryptodev *cryptodev,
> > > >  		int32_t rx_queue_id,
> > > > -		const struct rte_event *ev)
> > > > +		const struct rte_event_crypto_adapter_queue_conf *conf)
> > > >  {
> > > >  	struct dpaa_eventdev *priv = dev->data->dev_private;
> > > > -	uint8_t ev_qid = ev->queue_id;
> > > > +	uint8_t ev_qid = conf->ev.queue_id;
> > > >  	u16 ch_id = priv->evq_info[ev_qid].ch_id;
> > > >  	int ret;
> > > >
> > > > @@ -786,10 +787,10 @@ dpaa_eventdev_crypto_queue_add(const struct
> > > > rte_eventdev *dev,
> > > >
> > > >  	if (rx_queue_id == -1)
> > > >  		return dpaa_eventdev_crypto_queue_add_all(dev,
> > > > -				cryptodev, ev);
> > > > +				cryptodev, &conf->ev);
> > > >
> > > >  	ret = dpaa_sec_eventq_attach(cryptodev, rx_queue_id,
> > > > -			ch_id, ev);
> > > > +			ch_id, &conf->ev);
> > > >  	if (ret) {
> > > >  		DPAA_EVENTDEV_ERR(
> > > >  			"dpaa_sec_eventq_attach failed: ret: %d\n", ret); diff -
> > -git
> > > > a/drivers/event/dpaa2/dpaa2_eventdev.c
> > > > b/drivers/event/dpaa2/dpaa2_eventdev.c
> > > > index ffc7b8b073..0137736794 100644
> > > > --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> > > > +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> > > > @@ -26,6 +26,7 @@
> > > >  #include <rte_bus_vdev.h>
> > > >  #include <ethdev_driver.h>
> > > >  #include <cryptodev_pmd.h>
> > > > +#include <rte_event_crypto_adapter.h>
> > > >  #include <rte_event_eth_rx_adapter.h>  #include
> > > > <rte_event_eth_tx_adapter.h>
> > > >
> > > > @@ -865,10 +866,10 @@ static int
> > > >  dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
> > > >  		const struct rte_cryptodev *cryptodev,
> > > >  		int32_t rx_queue_id,
> > > > -		const struct rte_event *ev)
> > > > +		const struct rte_event_crypto_adapter_queue_conf *conf)
> > > >  {
> > > >  	struct dpaa2_eventdev *priv = dev->data->dev_private;
> > > > -	uint8_t ev_qid = ev->queue_id;
> > > > +	uint8_t ev_qid = conf->ev.queue_id;
> > > >  	struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon;
> > > >  	int ret;
> > > >
> > > > @@ -876,10 +877,10 @@ dpaa2_eventdev_crypto_queue_add(const struct
> > > > rte_eventdev *dev,
> > > >
> > > >  	if (rx_queue_id == -1)
> > > >  		return dpaa2_eventdev_crypto_queue_add_all(dev,
> > > > -				cryptodev, ev);
> > > > +				cryptodev, &conf->ev);
> > > >
> > > >  	ret = dpaa2_sec_eventq_attach(cryptodev, rx_queue_id,
> > > > -				      dpcon, ev);
> > > > +				      dpcon, &conf->ev);
> > > >  	if (ret) {
> > > >  		DPAA2_EVENTDEV_ERR(
> > > >  			"dpaa2_sec_eventq_attach failed: ret: %d\n", ret); diff
> > --git
> > > > a/drivers/event/octeontx/ssovf_evdev.c
> > > > b/drivers/event/octeontx/ssovf_evdev.c
> > > > index 9e14e35d10..17acd8ef64 100644
> > > > --- a/drivers/event/octeontx/ssovf_evdev.c
> > > > +++ b/drivers/event/octeontx/ssovf_evdev.c
> > > > @@ -745,12 +745,12 @@ static int
> > > >  ssovf_crypto_adapter_qp_add(const struct rte_eventdev *dev,
> > > >  			    const struct rte_cryptodev *cdev,
> > > >  			    int32_t queue_pair_id,
> > > > -			    const struct rte_event *event)
> > > > +			    const struct rte_event_crypto_adapter_queue_conf
> > > > *conf)
> > > >  {
> > > >  	struct cpt_instance *qp;
> > > >  	uint8_t qp_id;
> > > >
> > > > -	RTE_SET_USED(event);
> > > > +	RTE_SET_USED(conf);
> > > >
> > > >  	if (queue_pair_id == -1) {
> > > >  		for (qp_id = 0; qp_id < cdev->data->nb_queue_pairs; qp_id++) {
> > > > diff --git a/lib/eventdev/eventdev_pmd.h
> > > > b/lib/eventdev/eventdev_pmd.h index 69402668d8..bcfc9cbcb2 100644
> > > > --- a/lib/eventdev/eventdev_pmd.h
> > > > +++ b/lib/eventdev/eventdev_pmd.h
> > > > @@ -907,6 +907,7 @@ rte_event_pmd_selftest_seqn(struct rte_mbuf
> > > > *mbuf) }
> > > >
> > > >  struct rte_cryptodev;
> > > > +struct rte_event_crypto_adapter_queue_conf;
> > > >
> > > >  /**
> > > >   * This API may change without prior notice @@ -961,11 +962,11 @@
> > > > typedef int (*eventdev_crypto_adapter_caps_get_t)
> > > >   *   - <0: Error code returned by the driver function.
> > > >   *
> > > >   */
> > > > -typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
> > > > -			(const struct rte_eventdev *dev,
> > > > -			 const struct rte_cryptodev *cdev,
> > > > -			 int32_t queue_pair_id,
> > > > -			 const struct rte_event *event);
> > > > +typedef int (*eventdev_crypto_adapter_queue_pair_add_t)(
> > > > +		const struct rte_eventdev *dev,
> > > > +		const struct rte_cryptodev *cdev,
> > > > +		int32_t queue_pair_id,
> > > > +		const struct rte_event_crypto_adapter_queue_conf
> > > > *queue_conf);
> > > >
> > > >
> > > >  /**
> > > > @@ -1074,6 +1075,27 @@ typedef int
> > > > (*eventdev_crypto_adapter_stats_reset)
> > > >  			(const struct rte_eventdev *dev,
> > > >  			 const struct rte_cryptodev *cdev);
> > > >
> > > > +struct rte_event_crypto_adapter_vector_limits;
> > > > +/**
> > > > + * Get event vector limits for a given event, crypto device pair.
> > > > + *
> > > > + * @param dev
> > > > + *   Event device pointer
> > > > + *
> > > > + * @param cdev
> > > > + *   Crypto device pointer
> > > > + *
> > > > + * @param[out] limits
> > > > + *   Pointer to the limits structure to be filled.
> > > > + *
> > > > + * @return
> > > > + *   - 0: Success.
> > > > + *   - <0: Error code returned by the driver function.
> > > > + */
> > > > +typedef int (*eventdev_crypto_adapter_vector_limits_get_t)(
> > > > +	const struct rte_eventdev *dev, const struct rte_cryptodev *cdev,
> > > > +	struct rte_event_crypto_adapter_vector_limits *limits);
> > > > +
> > > >  /**
> > > >   * Retrieve the event device's eth Tx adapter capabilities.
> > > >   *
> > > > @@ -1339,6 +1361,9 @@ struct eventdev_ops {
> > > >  	/**< Get crypto stats */
> > > >  	eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
> > > >  	/**< Reset crypto stats */
> > > > +	eventdev_crypto_adapter_vector_limits_get_t
> > > > +		crypto_adapter_vector_limits_get;
> > > > +	/**< Get event vector limits for the crypto adapter */
> > > >
> > > >  	eventdev_eth_rx_adapter_q_stats_get
> > > > eth_rx_adapter_queue_stats_get;
> > > >  	/**< Get ethernet Rx queue stats */ diff --git
> > > > a/lib/eventdev/eventdev_trace.h b/lib/eventdev/eventdev_trace.h
> > > > index 5ec43d80ee..d48cd58850 100644
> > > > --- a/lib/eventdev/eventdev_trace.h
> > > > +++ b/lib/eventdev/eventdev_trace.h
> > > > @@ -18,6 +18,7 @@ extern "C" {
> > > >  #include <rte_trace_point.h>
> > > >
> > > >  #include "rte_eventdev.h"
> > > > +#include "rte_event_crypto_adapter.h"
> > > >  #include "rte_event_eth_rx_adapter.h"
> > > >  #include "rte_event_timer_adapter.h"
> > > >
> > > > @@ -271,11 +272,12 @@ RTE_TRACE_POINT(  RTE_TRACE_POINT(
> > > >  	rte_eventdev_trace_crypto_adapter_queue_pair_add,
> > > >  	RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t cdev_id,
> > > > -		const void *event, int32_t queue_pair_id),
> > > > +		int32_t queue_pair_id,
> > > > +		const struct rte_event_crypto_adapter_queue_conf *conf),
> > > >  	rte_trace_point_emit_u8(adptr_id);
> > > >  	rte_trace_point_emit_u8(cdev_id);
> > > >  	rte_trace_point_emit_i32(queue_pair_id);
> > > > -	rte_trace_point_emit_ptr(event);
> > > > +	rte_trace_point_emit_ptr(conf);
> > > >  )
> > > >
> > > >  RTE_TRACE_POINT(
> > > > diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> > > > b/lib/eventdev/rte_event_crypto_adapter.c
> > > > index 7c695176f4..73a4f231e2 100644
> > > > --- a/lib/eventdev/rte_event_crypto_adapter.c
> > > > +++ b/lib/eventdev/rte_event_crypto_adapter.c
> > > > @@ -921,11 +921,12 @@ int
> > > >  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
> > > >  			uint8_t cdev_id,
> > > >  			int32_t queue_pair_id,
> > > > -			const struct rte_event *event)
> > > > +			const struct rte_event_crypto_adapter_queue_conf
> > > > *conf)
> > > >  {
> > > > +	struct rte_event_crypto_adapter_vector_limits limits;
> > > >  	struct event_crypto_adapter *adapter;
> > > > -	struct rte_eventdev *dev;
> > > >  	struct crypto_device_info *dev_info;
> > > > +	struct rte_eventdev *dev;
> > > >  	uint32_t cap;
> > > >  	int ret;
> > > >
> > > > @@ -951,11 +952,47 @@
> > > > rte_event_crypto_adapter_queue_pair_add(uint8_t
> > > > id,
> > > >  	}
> > > >
> > > >  	if ((cap &
> > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) &&
> > > > -	    (event == NULL)) {
> > > > +	    (conf == NULL)) {
> > > >  		RTE_EDEV_LOG_ERR("Conf value can not be NULL for
> > dev_id=%u",
> > > >  				  cdev_id);
> > > >  		return -EINVAL;
> > > >  	}
> > > Newline?
> > >
> > Ack
> >
> > > > +	if ((conf != NULL) &&
> > > Checking conf twice?
> > Will rewrite as if conf == NULL/else, to avoid double checking.
> >
> > > > +	    (conf->flags & RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR)) {
> > > Else condition if the flags is not set?
> > There's no additional handing for case when flag is no set.
> >
> > > > +		if ((cap &
> > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR) == 0) {
> > > > +			RTE_EDEV_LOG_ERR("Event vectorization is not
> > > > supported,"
> > > > +					 "dev %" PRIu8 " cdev %" PRIu8, id,
> > > > +					 cdev_id);
> > > > +			return -ENOTSUP;
> > > > +		}
> > > > +
> > > > +		ret = rte_event_crypto_adapter_vector_limits_get(
> > > > +			adapter->eventdev_id, cdev_id, &limits);
> > > > +		if (ret < 0) {
> > > > +			RTE_EDEV_LOG_ERR("Failed to get event device vector
> > > > "
> > > > +					 "limits, dev %" PRIu8 " cdev %" PRIu8,
> > > > +					 id, cdev_id);
> > > > +			return -EINVAL;
> > > > +		}
> > > New line? Please check other cases.
> > >
> > Ack
> >
> > > > +		if (conf->vector_sz < limits.min_sz ||
> > > > +		    conf->vector_sz > limits.max_sz ||
> > > > +		    conf->vector_timeout_ns < limits.min_timeout_ns ||
> > > > +		    conf->vector_timeout_ns > limits.max_timeout_ns ||
> > > > +		    conf->vector_mp == NULL) {
> > > > +			RTE_EDEV_LOG_ERR("Invalid event vector
> > > > configuration,"
> > > > +					 " dev %" PRIu8 " cdev %" PRIu8,
> > > > +					 id, cdev_id);
> > > > +			return -EINVAL;
> > > > +		}
> > > > +		if (conf->vector_mp->elt_size <
> > > > +		    (sizeof(struct rte_event_vector) +
> > > > +		     (sizeof(uintptr_t) * conf->vector_sz))) {
> > > > +			RTE_EDEV_LOG_ERR("Invalid event vector
> > > > configuration,"
> > > > +					 " dev %" PRIu8 " cdev %" PRIu8,
> > > > +					 id, cdev_id);
> > > > +			return -EINVAL;
> > > > +		}
> > > > +	}
> > > >
> > > >  	dev_info = &adapter->cdevs[cdev_id];
> > > >
> > > > @@ -990,7 +1027,7 @@
> > rte_event_crypto_adapter_queue_pair_add(uint8_t
> > > > id,
> > > >  		ret = (*dev->dev_ops->crypto_adapter_queue_pair_add)(dev,
> > > >  				dev_info->dev,
> > > >  				queue_pair_id,
> > > > -				event);
> > > > +				conf);
> > > >  		if (ret)
> > > >  			return ret;
> > > >
> > > > @@ -1030,8 +1067,8 @@
> > > > rte_event_crypto_adapter_queue_pair_add(uint8_t
> > > > id,
> > > >  		rte_service_component_runstate_set(adapter->service_id, 1);
> > > >  	}
> > > >
> > > > -	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
> > > > event,
> > > > -		queue_pair_id);
> > > > +	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
> > > > +		queue_pair_id, conf);
> > > >  	return 0;
> > > >  }
> > > >
> > > > @@ -1290,3 +1327,44 @@
> > > > rte_event_crypto_adapter_event_port_get(uint8_t
> > > > id, uint8_t *event_port_id)
> > > >
> > > >  	return 0;
> > > >  }
> > > > +
> > > > +int
> > > > +rte_event_crypto_adapter_vector_limits_get(
> > > > +	uint8_t dev_id, uint16_t cdev_id,
> > > > +	struct rte_event_crypto_adapter_vector_limits *limits) {
> > > > +	struct rte_cryptodev *cdev;
> > > > +	struct rte_eventdev *dev;
> > > > +	uint32_t cap;
> > > > +	int ret;
> > > > +
> > > > +	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> > > > +
> > > > +	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
> > > > +		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
> > > > +		return -EINVAL;
> > > > +	}
> > > > +
> > > > +	if (limits == NULL)
> > > > +		return -EINVAL;
> > > Add appropriate error message like above?
> > Ack, will add.
> >
> > > > +
> > > > +	dev = &rte_eventdevs[dev_id];
> > > > +	cdev = rte_cryptodev_pmd_get_dev(cdev_id);
> > > > +
> > > > +	ret = rte_event_crypto_adapter_caps_get(dev_id, cdev_id, &cap);
> > > > +	if (ret) {
> > > > +		RTE_EDEV_LOG_ERR("Failed to get adapter caps edev %" PRIu8
> > > > +				 "cdev %" PRIu16, dev_id, cdev_id);
> > > > +		return ret;
> > > > +	}
> > > > +
> > > > +	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR))
> > > > +		return -ENOTSUP;
> > > Same here.
> > Ack, will add.
> >
> > > > +
> > > > +	RTE_FUNC_PTR_OR_ERR_RET(
> > > > +		*dev->dev_ops->crypto_adapter_vector_limits_get,
> > > > +		-ENOTSUP);
> > > > +
> > > > +	return dev->dev_ops->crypto_adapter_vector_limits_get(
> > > > +		dev, cdev, limits);
> > > > +}
> > > > diff --git a/lib/eventdev/rte_event_crypto_adapter.h
> > > > b/lib/eventdev/rte_event_crypto_adapter.h
> > > > index d90a19e72c..7dd6171b9b 100644
> > > > --- a/lib/eventdev/rte_event_crypto_adapter.h
> > > > +++ b/lib/eventdev/rte_event_crypto_adapter.h
> > > > @@ -253,6 +253,78 @@ struct rte_event_crypto_adapter_conf {
> > > >  	 */
> > > >  };
> > > >
> > > > +#define RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR	0x1
> > > > +/**< This flag indicates that crypto operations processed on the
> > > > +crypto
> > > > + * adapter need to be vectorized
> > > > + * @see rte_event_crypto_adapter_queue_conf::flags
> > > > + */
> > > > +
> > > > +/**
> > > > + * Adapter queue configuration structure  */ struct
> > > > +rte_event_crypto_adapter_queue_conf {
> > > > +	uint32_t flags;
> > > > +	/**< Flags for handling crypto operations
> > > > +	 * @see RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
> > > > +	 */
> > > > +	struct rte_event ev;
> > > > +	/**< If HW supports cryptodev queue pair to event queue binding,
> > > > +	 * application is expected to fill in event information.
> > > > +	 * @see
> > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> > > > +	 */
> > > > +	uint16_t vector_sz;
> > > > +	/**< Indicates the maximum number for crypto operations to
> > > > +combine
> > > > and
> > > > +	 * form a vector.
> > > > +	 * @see rte_event_crypto_adapter_vector_limits::min_sz
> > > > +	 * @see rte_event_crypto_adapter_vector_limits::max_sz
> > > > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> > > > set in
> > > > +	 * @see rte_event_crypto_adapter_queue_conf::rx_queue_flags
> > > rx_queue_flags??
> > Typo, should be conf::flags.
> >
> > > > +	 */
> > > > +	uint64_t vector_timeout_ns;
> > > > +	/**<
> > > > +	 * Indicates the maximum number of nanoseconds to wait for
> > > > aggregating
> > > > +	 * crypto operations. Should be within vectorization limits of the
> > > > +	 * adapter
> > > > +	 * @see rte_event_crypto_adapter_vector_limits::min_timeout_ns
> > > > +	 * @see rte_event_crypto_adapter_vector_limits::max_timeout_ns
> > > > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> > > > set in
> > > > +	 * @see rte_event_crypto_adapter_queue_conf::flags
> > > > +	 */
> > > > +	struct rte_mempool *vector_mp;
> > > > +	/**< Indicates the mempool that should be used for allocating
> > > > +	 * rte_event_vector container.
> > > > +	 * Should be created by using `rte_event_vector_pool_create`.
> > > > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is
> > > > set in
> > > > +	 * @see rte_event_crypto_adapter_queue_conf::flags.
> > > > +	 */
> > > > +};
> > > > +
> > > > +/**
> > > > + * A structure used to retrieve event crypto adapter vector limits.
> > > > + */
> > > > +struct rte_event_crypto_adapter_vector_limits {
> > > > +	uint16_t min_sz;
> > > > +	/**< Minimum vector limit configurable.
> > > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > > > +	 */
> > > > +	uint16_t max_sz;
> > > > +	/**< Maximum vector limit configurable.
> > > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > > > +	 */
> > > > +	uint8_t log2_sz;
> > > > +	/**< True if the size configured should be in log2.
> > > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > > > +	 */
> > > > +	uint64_t min_timeout_ns;
> > > > +	/**< Minimum vector timeout configurable.
> > > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> > > > +	 */
> > > > +	uint64_t max_timeout_ns;
> > > > +	/**< Maximum vector timeout configurable.
> > > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> > > > +	 */
> > > > +};
> > > > +
> > > >  /**
> > > >   * Function type used for adapter configuration callback. The callback is
> > > >   * used to fill in members of the struct
> > > > rte_event_crypto_adapter_conf, this @@ -392,10 +464,9 @@
> > > rte_event_crypto_adapter_free(uint8_t id);
> > > >   *  Cryptodev queue pair identifier. If queue_pair_id is set -1,
> > > >   *  adapter adds all the pre configured queue pairs to the instance.
> > > >   *
> > > > - * @param event
> > > > - *  if HW supports cryptodev queue pair to event queue binding,
> > > > application is
> > > > - *  expected to fill in event information, else it will be NULL.
> > > > - *  @see
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> > > > + * @param conf
> > > > + *  Additional configuration structure of type
> > > > + *  *rte_event_crypto_adapter_queue_conf*
> > > >   *
> > > >   * @return
> > > >   *  - 0: Success, queue pair added correctly.
> > > > @@ -405,7 +476,7 @@ int
> > > >  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
> > > >  			uint8_t cdev_id,
> > > >  			int32_t queue_pair_id,
> > > > -			const struct rte_event *event);
> > > > +			const struct rte_event_crypto_adapter_queue_conf
> > > > *conf);
> > > >
> > > >  /**
> > > >   * Delete a queue pair from an event crypto adapter.
> > > > @@ -523,6 +594,26 @@
> > > > rte_event_crypto_adapter_service_id_get(uint8_t
> > > > id, uint32_t *service_id);  int
> > > > rte_event_crypto_adapter_event_port_get(uint8_t
> > > > id, uint8_t *event_port_id);
> > > >
> > > > +/**
> > > > + * Retrieve vector limits for a given event dev and crypto dev pair.
> > > > + * @see rte_event_crypto_adapter_vector_limits
> > > > + *
> > > > + * @param dev_id
> > > > + *  Event device identifier.
> > > > + * @param cdev_id
> > > > + *  Crypto device identifier.
> > > > + * @param [out] limits
> > > > + *  A pointer to rte_event_crypto_adapter_vector_limits structure
> > > > +that has to
> > > > + * be filled.
> > > Space missing before "be filled"
> > Ack
> >
> > > > + *
> > > > + * @return
> > > > + *  - 0: Success.
> > > > + *  - <0: Error code on failure.
> > > > + */
> > > > +int rte_event_crypto_adapter_vector_limits_get(
> > > > +	uint8_t dev_id, uint16_t cdev_id,
> > > > +	struct rte_event_crypto_adapter_vector_limits *limits);
> > > > +
> > > >  /**
> > > >   * Enqueue a burst of crypto operations as event objects supplied
> > > > in
> > > > *rte_event*
> > > >   * structure on an event crypto adapter designated by its event
> > > > *dev_id* through diff --git
> > > > a/lib/eventdev/rte_event_eth_rx_adapter.h
> > > > b/lib/eventdev/rte_event_eth_rx_adapter.h
> > > > index 3608a7b2cf..c8f2936866 100644
> > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h
> > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h
> > > > @@ -457,7 +457,8 @@ int rte_event_eth_rx_adapter_free(uint8_t id);
> > > >   * @see RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ
> > > >   *
> > > >   * @param conf
> > > > - *  Additional configuration structure of type
> > > > *rte_event_eth_rx_adapter_conf*
> > > > + *  Additional configuration structure of type
> > > > + *  *rte_event_eth_rx_adapter_queue_conf*
> > > These changes are not relevant. Please consider sending separate patch.
> > >
> > Ack, Will send this change as a separate patch.
> >
> > > >   *
> > > >   * @return
> > > >   *  - 0: Success, Receive queue added correctly.
> > > > diff --git a/lib/eventdev/rte_eventdev.h
> > > > b/lib/eventdev/rte_eventdev.h index
> > > > 6a6f6ea4c1..1a737bf851 100644
> > > > --- a/lib/eventdev/rte_eventdev.h
> > > > +++ b/lib/eventdev/rte_eventdev.h
> > > > @@ -1203,6 +1203,9 @@ struct rte_event_vector {  #define
> > > > RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR
> > \
> > > >  	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER)
> > /**< The
> > > > event vector generated from eth Rx adapter. */
> > > > +#define RTE_EVENT_TYPE_CRYPTODEV_VECTOR                                        \
> > > > +	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV) /**< The
> > > > event
> > > > +vector generated from cryptodev adapter. */
> > > >
> > > >  #define RTE_EVENT_TYPE_MAX              0x10
> > > >  /**< Maximum number of event types */ @@ -1420,6 +1423,11 @@
> > > > rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps);
> > > >   * the private data information along with the crypto session.
> > > >   */
> > > >
> > > > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR   0x10
> > > > +/**< Flag indicates HW is capable of aggregating processed
> > > > + * crypto operations into rte_event_vector.
> > > > + */
> > > > +
> > > >  /**
> > > >   * Retrieve the event device's crypto adapter capabilities for the
> > > >   * specified cryptodev device
> > > > --
> > > > 2.25.1
  
Gujjar, Abhinandan S Sept. 27, 2022, 9:38 a.m. UTC | #7
> -----Original Message-----
> From: Volodymyr Fialko <vfialko@marvell.com>
> Sent: Tuesday, September 27, 2022 2:55 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org; Jerin
> Jacob Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>
> Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph <anoobj@marvell.com>
> Subject: RE: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> 
> 
> 
> > -----Original Message-----
> > From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> > Sent: Tuesday, September 27, 2022 11:05 AM
> > To: Volodymyr Fialko <vfialko@marvell.com>; dev@dpdk.org; Jerin Jacob
> > Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh Bhagavatula
> > <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> > Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> > <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > <jay.jayatheerthan@intel.com>
> > Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph
> > <anoobj@marvell.com>
> > Subject: [EXT] RE: [PATCH 1/3] eventdev: introduce event cryptodev
> > vector type
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> >
> >
> > > -----Original Message-----
> > > From: Volodymyr Fialko <vfialko@marvell.com>
> > > Sent: Monday, September 26, 2022 4:32 PM
> > > To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> > > dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Pavan
> > > Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Shijith Thotton
> > > <sthotton@marvell.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> > > Sachin Saxena <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > > <jay.jayatheerthan@intel.com>
> > > Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph
> > > <anoobj@marvell.com>
> > > Subject: RE: [PATCH 1/3] eventdev: introduce event cryptodev vector
> > > type
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> > > > Sent: Saturday, September 24, 2022 10:44 AM
> > > > To: Volodymyr Fialko <vfialko@marvell.com>; dev@dpdk.org; Jerin
> > > > Jacob Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh
> > > > Bhagavatula <pbhagavatula@marvell.com>; Shijith Thotton
> > > > <sthotton@marvell.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> > > > Sachin Saxena <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > > > <jay.jayatheerthan@intel.com>
> > > > Cc: Akhil Goyal <gakhil@marvell.com>; Anoob Joseph
> > > > <anoobj@marvell.com>
> > > > Subject: [EXT] RE: [PATCH 1/3] eventdev: introduce event cryptodev
> > > > vector type
> > > >
> > > > External Email
> > > >
> > > > ------------------------------------------------------------------
> > > > --
> > > > --
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Volodymyr Fialko <vfialko@marvell.com>
> > > > > Sent: Thursday, August 4, 2022 3:29 PM
> > > > > To: dev@dpdk.org; Jerin Jacob <jerinj@marvell.com>; Gujjar,
> > > > > Abhinandan S <abhinandan.gujjar@intel.com>; Pavan Nikhilesh
> > > > > <pbhagavatula@marvell.com>; Shijith Thotton
> > > > > <sthotton@marvell.com>; Hemant Agrawal
> <hemant.agrawal@nxp.com>;
> > > > > Sachin Saxena <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > > > > <jay.jayatheerthan@intel.com>
> > > > > Cc: gakhil@marvell.com; anoobj@marvell.com; Volodymyr Fialko
> > > > > <vfialko@marvell.com>
> > > > > Subject: [PATCH 1/3] eventdev: introduce event cryptodev vector
> > > > > type
> > > > >
> > > > > Introduce ability to aggregate crypto operations processed by
> > > > > event crypto adapter into single event containing
> > > > > rte_event_vector whose event type is
> RTE_EVENT_TYPE_CRYPTODEV_VECTOR.
> > > > >
> > > > > Application should set RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
> in
> > > > > rte_event_crypto_adapter_queue_conf::flag and provide vector
> > > > > configuration with respect of
> > > > > rte_event_crypto_adapter_vector_limits,
> > > > > which could be obtained by calling
> > > > > rte_event_crypto_adapter_vector_limits_get, to enable vectorization.
> > > > >
> > > > > The event crypto adapter would be responsible for vectorizing
> > > > > the crypto operations based on provided response information in
> > > > > rte_event_crypto_metadata::response_info.
> > > > >
> > > > > Updated drivers and tests accordingly to new API.
> > > > >
> > > > > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> > > > > ---
> > > > >  app/test-eventdev/test_perf_common.c          |  10 +-
> > > > >  app/test/test_event_crypto_adapter.c          |  12 ++-
> > > > >  .../prog_guide/event_crypto_adapter.rst       |  23 +++-
> > > > >  drivers/event/cnxk/cn10k_eventdev.c           |   4 +-
> > > > >  drivers/event/cnxk/cn9k_eventdev.c            |   5 +-
> > > > >  drivers/event/dpaa/dpaa_eventdev.c            |   9 +-
> > > > >  drivers/event/dpaa2/dpaa2_eventdev.c          |   9 +-
> > > > >  drivers/event/octeontx/ssovf_evdev.c          |   4 +-
> > > > >  lib/eventdev/eventdev_pmd.h                   |  35 +++++-
> > > > >  lib/eventdev/eventdev_trace.h                 |   6 +-
> > > > >  lib/eventdev/rte_event_crypto_adapter.c       |  90 ++++++++++++++--
> > > > >  lib/eventdev/rte_event_crypto_adapter.h       | 101
> +++++++++++++++++-
> > > > >  lib/eventdev/rte_event_eth_rx_adapter.h       |   3 +-
> > > > >  lib/eventdev/rte_eventdev.h                   |   8 ++
> > > > >  14 files changed, 276 insertions(+), 43 deletions(-)
> > > > >
> > > >
> > > > I don't see dataplane implementation of vectorization in the crypto
> adapter!
> > > > Is it missed out in the patch?
> > > > comments inline.
> > > >
> > > Right now we are targeting crypto_cn10k PMD and ipsec-secgw event
> > > mode to support vectorization.
> > Is there a way to test this? When can be dataplane changes expected?
> >
> If the spec looks okay, support in s/w crypto adapter and other h/w PMDs can
> be added by respective maintainers. Currently, we are adding library change,
> support for one PMD and an application to test the feature. Feature is exposed
> with capability flag to not break existing functionality.
Got it. How do I test this feature without data plane changes?
This design is right now tested for cn10k, I am not sure this works for sw adapter.
If there is a way to test this, please let me know.
I need to have perf data with and without vectorization support to approve.

> 
> > >
> > > > > diff --git a/app/test-eventdev/test_perf_common.c b/app/test-
> > > > > eventdev/test_perf_common.c index 81420be73a..c770bc93f6 100644
> > > > > --- a/app/test-eventdev/test_perf_common.c
> > > > > +++ b/app/test-eventdev/test_perf_common.c
> > > > > @@ -837,14 +837,14 @@ perf_event_crypto_adapter_setup(struct
> > > > > test_perf *t, struct prod_data *p)
> > > > >  	}
> > > > >
> > > > >  	if (cap &
> > > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > > > -		struct rte_event response_info;
> > > > > +		struct rte_event_crypto_adapter_queue_conf conf;
> > > > >
> > > > > -		response_info.event = 0;
> > > > > -		response_info.sched_type = RTE_SCHED_TYPE_ATOMIC;
> > > > > -		response_info.queue_id = p->queue_id;
> > > > > +		memset(&conf, 0, sizeof(conf));
> > > > > +		conf.ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
> > > > > +		conf.ev.queue_id = p->queue_id;
> > > > >  		ret = rte_event_crypto_adapter_queue_pair_add(
> > > > >  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
> > > > > -			&response_info);
> > > > > +			&conf);
> > > > >  	} else {
> > > > >  		ret = rte_event_crypto_adapter_queue_pair_add(
> > > > >  			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
> > > NULL); diff
> > > > > --git a/app/test/test_event_crypto_adapter.c
> > > > > b/app/test/test_event_crypto_adapter.c
> > > > > index 2ecc7e2cea..bb617c1042 100644
> > > > > --- a/app/test/test_event_crypto_adapter.c
> > > > > +++ b/app/test/test_event_crypto_adapter.c
> > > > > @@ -1175,6 +1175,10 @@ test_crypto_adapter_create(void)  static
> > > > > int
> > > > >  test_crypto_adapter_qp_add_del(void)
> > > > >  {
> > > > > +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> > > > > +		.ev = response_info,
> > > > > +	};
> > > > > +
> > > > >  	uint32_t cap;
> > > > >  	int ret;
> > > > >
> > > > > @@ -1183,7 +1187,7 @@ test_crypto_adapter_qp_add_del(void)
> > > > >
> > > > >  	if (cap &
> > > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > > >  		ret =
> > > > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > > > -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > > > &response_info);
> > > > > +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > > > &queue_conf);
> > > > >  	} else
> > > > >  		ret =
> > > > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > > >  					TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > NULL); @@ -1206,6 +1210,10 @@
> > > > > configure_event_crypto_adapter(enum
> > > > > rte_event_crypto_adapter_mode mode)
> > > > >  		.new_event_threshold = 1200,
> > > > >  	};
> > > > >
> > > > > +	struct rte_event_crypto_adapter_queue_conf queue_conf = {
> > > > > +		.ev = response_info,
> > > > > +	};
> > > > > +
> > > > >  	uint32_t cap;
> > > > >  	int ret;
> > > > >
> > > > > @@ -1238,7 +1246,7 @@ configure_event_crypto_adapter(enum
> > > > > rte_event_crypto_adapter_mode mode)
> > > > >
> > > > >  	if (cap &
> > > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > > >  		ret =
> > > > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > > > -				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > > > &response_info);
> > > > > +				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > > > > &queue_conf);
> > > > >  	} else
> > > > >  		ret =
> > > > > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> > > > >  				TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL); diff
> > > --git
> > > > > a/doc/guides/prog_guide/event_crypto_adapter.rst
> > > > > b/doc/guides/prog_guide/event_crypto_adapter.rst
> > > > > index 4fb5c688e0..554df7e358 100644
> > > > > --- a/doc/guides/prog_guide/event_crypto_adapter.rst
> > > > > +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> > > > > @@ -201,10 +201,10 @@ capability, event information must be
> > > > > passed to the add API.
> > > > >
> > > > >          ret = rte_event_crypto_adapter_caps_get(id, evdev, &cap);
> > > > >          if (cap &
> > > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> > > > > -                struct rte_event event;
> > > > > +                struct rte_event_crypto_adapter_queue_conf
> > > > > + conf;
> > > > >
> > > > > -                // Fill in event information & pass it to add API
> > > > > -                rte_event_crypto_adapter_queue_pair_add(id, cdev_id,
> qp_id,
> > > > > &event);
> > > > > +                // Fill in conf.event information & pass it to add API
> > > > > +                rte_event_crypto_adapter_queue_pair_add(id,
> > > > > + cdev_id, qp_id, &conf);
> > > > >          } else
> > > > >                  rte_event_crypto_adapter_queue_pair_add(id,
> > > > > cdev_id, qp_id, NULL);
> > > > >
> > > > > @@ -291,6 +291,23 @@ the ``rte_crypto_op``.
> > > > >                  rte_memcpy(op + len, &m_data, sizeof(m_data));
> > > > >          }
> > > > >
> > > > > +Enable event vectorization
> > > > > +~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > +
> > > > > +The event crypto adapter can aggregate outcoming crypto
> > > > > +operations based on provided response information of
> > > > > +``rte_event_crypto_metadata::response_info``
> > > > > +and generate a ``rte_event`` containing ``rte_event_vector``
> > > > > +whose event type is ``RTE_EVENT_TYPE_CRYPTODEV_VECTOR``.
> > > > > +To enable vectorization application should set
> > > > > +RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
> > > > > +``rte_event_crypto_adapter_queue_conf::flag`` and provide
> > > > > +vector configuration(size, mempool, etc.) with respect of
> > > > > +``rte_event_crypto_adapter_vector_limits``, which could be
> > > > > +obtained by calling ``rte_event_crypto_adapter_vector_limits_get()``.
> > > > > +
> > > > > +The RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR capability
> > > indicates
> > > > > +whether PMD supports this feature.
> > > > > +
> > > > >  Start the adapter instance
> > > > >  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > >
> > > > > diff --git a/drivers/event/cnxk/cn10k_eventdev.c
> > > > > b/drivers/event/cnxk/cn10k_eventdev.c
> > > > > index 5a0cab40a9..e74ec57382 100644
> > > > > --- a/drivers/event/cnxk/cn10k_eventdev.c
> > > > > +++ b/drivers/event/cnxk/cn10k_eventdev.c
> > > > > @@ -889,11 +889,11 @@ static int
> > > > > cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
> > > > >  			    const struct rte_cryptodev *cdev,
> > > > >  			    int32_t queue_pair_id,
> > > > > -			    const struct rte_event *event)
> > > > > +			    const struct
> rte_event_crypto_adapter_queue_conf
> > > > > *conf)
> > > > >  {
> > > > >  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> > > > >
> > > > > -	RTE_SET_USED(event);
> > > > > +	RTE_SET_USED(conf);
> > > > >
> > > > >  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k");
> > > > >  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k"); diff
> > > > > -- git a/drivers/event/cnxk/cn9k_eventdev.c
> > > > > b/drivers/event/cnxk/cn9k_eventdev.c
> > > > > index 2e27030049..45ed547cb0 100644
> > > > > --- a/drivers/event/cnxk/cn9k_eventdev.c
> > > > > +++ b/drivers/event/cnxk/cn9k_eventdev.c
> > > > > @@ -1120,11 +1120,12 @@ cn9k_crypto_adapter_caps_get(const
> > > > > struct rte_eventdev *event_dev,  static int
> > > > > cn9k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
> > > > >  			   const struct rte_cryptodev *cdev,
> > > > > -			   int32_t queue_pair_id, const struct rte_event *event)
> > > > > +			   int32_t queue_pair_id,
> > > > > +			   const struct
> rte_event_crypto_adapter_queue_conf
> > > > > *conf)
> > > > >  {
> > > > >  	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
> > > > >
> > > > > -	RTE_SET_USED(event);
> > > > > +	RTE_SET_USED(conf);
> > > > >
> > > > >  	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k");
> > > > >  	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k"); diff
> > > > > --git a/drivers/event/dpaa/dpaa_eventdev.c
> > > > > b/drivers/event/dpaa/dpaa_eventdev.c
> > > > > index ff6cc0be18..2b9ecd9fbf 100644
> > > > > --- a/drivers/event/dpaa/dpaa_eventdev.c
> > > > > +++ b/drivers/event/dpaa/dpaa_eventdev.c
> > > > > @@ -26,6 +26,7 @@
> > > > >  #include <rte_eventdev.h>
> > > > >  #include <eventdev_pmd_vdev.h>
> > > > >  #include <rte_ethdev.h>
> > > > > +#include <rte_event_crypto_adapter.h>
> > > > >  #include <rte_event_eth_rx_adapter.h>  #include
> > > > > <rte_event_eth_tx_adapter.h>  #include <cryptodev_pmd.h> @@
> > > > > -775,10
> > > > > +776,10 @@ static int  dpaa_eventdev_crypto_queue_add(const
> > > > > +struct
> > > > > rte_eventdev *dev,
> > > > >  		const struct rte_cryptodev *cryptodev,
> > > > >  		int32_t rx_queue_id,
> > > > > -		const struct rte_event *ev)
> > > > > +		const struct rte_event_crypto_adapter_queue_conf
> *conf)
> > > > >  {
> > > > >  	struct dpaa_eventdev *priv = dev->data->dev_private;
> > > > > -	uint8_t ev_qid = ev->queue_id;
> > > > > +	uint8_t ev_qid = conf->ev.queue_id;
> > > > >  	u16 ch_id = priv->evq_info[ev_qid].ch_id;
> > > > >  	int ret;
> > > > >
> > > > > @@ -786,10 +787,10 @@ dpaa_eventdev_crypto_queue_add(const
> > > > > struct rte_eventdev *dev,
> > > > >
> > > > >  	if (rx_queue_id == -1)
> > > > >  		return dpaa_eventdev_crypto_queue_add_all(dev,
> > > > > -				cryptodev, ev);
> > > > > +				cryptodev, &conf->ev);
> > > > >
> > > > >  	ret = dpaa_sec_eventq_attach(cryptodev, rx_queue_id,
> > > > > -			ch_id, ev);
> > > > > +			ch_id, &conf->ev);
> > > > >  	if (ret) {
> > > > >  		DPAA_EVENTDEV_ERR(
> > > > >  			"dpaa_sec_eventq_attach failed: ret: %d\n", ret); diff -
> > > -git
> > > > > a/drivers/event/dpaa2/dpaa2_eventdev.c
> > > > > b/drivers/event/dpaa2/dpaa2_eventdev.c
> > > > > index ffc7b8b073..0137736794 100644
> > > > > --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> > > > > +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> > > > > @@ -26,6 +26,7 @@
> > > > >  #include <rte_bus_vdev.h>
> > > > >  #include <ethdev_driver.h>
> > > > >  #include <cryptodev_pmd.h>
> > > > > +#include <rte_event_crypto_adapter.h>
> > > > >  #include <rte_event_eth_rx_adapter.h>  #include
> > > > > <rte_event_eth_tx_adapter.h>
> > > > >
> > > > > @@ -865,10 +866,10 @@ static int
> > > > > dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
> > > > >  		const struct rte_cryptodev *cryptodev,
> > > > >  		int32_t rx_queue_id,
> > > > > -		const struct rte_event *ev)
> > > > > +		const struct rte_event_crypto_adapter_queue_conf
> *conf)
> > > > >  {
> > > > >  	struct dpaa2_eventdev *priv = dev->data->dev_private;
> > > > > -	uint8_t ev_qid = ev->queue_id;
> > > > > +	uint8_t ev_qid = conf->ev.queue_id;
> > > > >  	struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon;
> > > > >  	int ret;
> > > > >
> > > > > @@ -876,10 +877,10 @@ dpaa2_eventdev_crypto_queue_add(const
> > > > > struct rte_eventdev *dev,
> > > > >
> > > > >  	if (rx_queue_id == -1)
> > > > >  		return dpaa2_eventdev_crypto_queue_add_all(dev,
> > > > > -				cryptodev, ev);
> > > > > +				cryptodev, &conf->ev);
> > > > >
> > > > >  	ret = dpaa2_sec_eventq_attach(cryptodev, rx_queue_id,
> > > > > -				      dpcon, ev);
> > > > > +				      dpcon, &conf->ev);
> > > > >  	if (ret) {
> > > > >  		DPAA2_EVENTDEV_ERR(
> > > > >  			"dpaa2_sec_eventq_attach failed: ret: %d\n", ret); diff
> > > --git
> > > > > a/drivers/event/octeontx/ssovf_evdev.c
> > > > > b/drivers/event/octeontx/ssovf_evdev.c
> > > > > index 9e14e35d10..17acd8ef64 100644
> > > > > --- a/drivers/event/octeontx/ssovf_evdev.c
> > > > > +++ b/drivers/event/octeontx/ssovf_evdev.c
> > > > > @@ -745,12 +745,12 @@ static int
> > > > > ssovf_crypto_adapter_qp_add(const struct rte_eventdev *dev,
> > > > >  			    const struct rte_cryptodev *cdev,
> > > > >  			    int32_t queue_pair_id,
> > > > > -			    const struct rte_event *event)
> > > > > +			    const struct
> rte_event_crypto_adapter_queue_conf
> > > > > *conf)
> > > > >  {
> > > > >  	struct cpt_instance *qp;
> > > > >  	uint8_t qp_id;
> > > > >
> > > > > -	RTE_SET_USED(event);
> > > > > +	RTE_SET_USED(conf);
> > > > >
> > > > >  	if (queue_pair_id == -1) {
> > > > >  		for (qp_id = 0; qp_id < cdev->data->nb_queue_pairs; qp_id++)
> > > > > { diff --git a/lib/eventdev/eventdev_pmd.h
> > > > > b/lib/eventdev/eventdev_pmd.h index 69402668d8..bcfc9cbcb2
> > > > > 100644
> > > > > --- a/lib/eventdev/eventdev_pmd.h
> > > > > +++ b/lib/eventdev/eventdev_pmd.h
> > > > > @@ -907,6 +907,7 @@ rte_event_pmd_selftest_seqn(struct rte_mbuf
> > > > > *mbuf) }
> > > > >
> > > > >  struct rte_cryptodev;
> > > > > +struct rte_event_crypto_adapter_queue_conf;
> > > > >
> > > > >  /**
> > > > >   * This API may change without prior notice @@ -961,11 +962,11
> > > > > @@ typedef int (*eventdev_crypto_adapter_caps_get_t)
> > > > >   *   - <0: Error code returned by the driver function.
> > > > >   *
> > > > >   */
> > > > > -typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
> > > > > -			(const struct rte_eventdev *dev,
> > > > > -			 const struct rte_cryptodev *cdev,
> > > > > -			 int32_t queue_pair_id,
> > > > > -			 const struct rte_event *event);
> > > > > +typedef int (*eventdev_crypto_adapter_queue_pair_add_t)(
> > > > > +		const struct rte_eventdev *dev,
> > > > > +		const struct rte_cryptodev *cdev,
> > > > > +		int32_t queue_pair_id,
> > > > > +		const struct rte_event_crypto_adapter_queue_conf
> > > > > *queue_conf);
> > > > >
> > > > >
> > > > >  /**
> > > > > @@ -1074,6 +1075,27 @@ typedef int
> > > > > (*eventdev_crypto_adapter_stats_reset)
> > > > >  			(const struct rte_eventdev *dev,
> > > > >  			 const struct rte_cryptodev *cdev);
> > > > >
> > > > > +struct rte_event_crypto_adapter_vector_limits;
> > > > > +/**
> > > > > + * Get event vector limits for a given event, crypto device pair.
> > > > > + *
> > > > > + * @param dev
> > > > > + *   Event device pointer
> > > > > + *
> > > > > + * @param cdev
> > > > > + *   Crypto device pointer
> > > > > + *
> > > > > + * @param[out] limits
> > > > > + *   Pointer to the limits structure to be filled.
> > > > > + *
> > > > > + * @return
> > > > > + *   - 0: Success.
> > > > > + *   - <0: Error code returned by the driver function.
> > > > > + */
> > > > > +typedef int (*eventdev_crypto_adapter_vector_limits_get_t)(
> > > > > +	const struct rte_eventdev *dev, const struct rte_cryptodev
> *cdev,
> > > > > +	struct rte_event_crypto_adapter_vector_limits *limits);
> > > > > +
> > > > >  /**
> > > > >   * Retrieve the event device's eth Tx adapter capabilities.
> > > > >   *
> > > > > @@ -1339,6 +1361,9 @@ struct eventdev_ops {
> > > > >  	/**< Get crypto stats */
> > > > >  	eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
> > > > >  	/**< Reset crypto stats */
> > > > > +	eventdev_crypto_adapter_vector_limits_get_t
> > > > > +		crypto_adapter_vector_limits_get;
> > > > > +	/**< Get event vector limits for the crypto adapter */
> > > > >
> > > > >  	eventdev_eth_rx_adapter_q_stats_get
> > > > > eth_rx_adapter_queue_stats_get;
> > > > >  	/**< Get ethernet Rx queue stats */ diff --git
> > > > > a/lib/eventdev/eventdev_trace.h b/lib/eventdev/eventdev_trace.h
> > > > > index 5ec43d80ee..d48cd58850 100644
> > > > > --- a/lib/eventdev/eventdev_trace.h
> > > > > +++ b/lib/eventdev/eventdev_trace.h
> > > > > @@ -18,6 +18,7 @@ extern "C" {
> > > > >  #include <rte_trace_point.h>
> > > > >
> > > > >  #include "rte_eventdev.h"
> > > > > +#include "rte_event_crypto_adapter.h"
> > > > >  #include "rte_event_eth_rx_adapter.h"
> > > > >  #include "rte_event_timer_adapter.h"
> > > > >
> > > > > @@ -271,11 +272,12 @@ RTE_TRACE_POINT(  RTE_TRACE_POINT(
> > > > >  	rte_eventdev_trace_crypto_adapter_queue_pair_add,
> > > > >  	RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t cdev_id,
> > > > > -		const void *event, int32_t queue_pair_id),
> > > > > +		int32_t queue_pair_id,
> > > > > +		const struct rte_event_crypto_adapter_queue_conf
> *conf),
> > > > >  	rte_trace_point_emit_u8(adptr_id);
> > > > >  	rte_trace_point_emit_u8(cdev_id);
> > > > >  	rte_trace_point_emit_i32(queue_pair_id);
> > > > > -	rte_trace_point_emit_ptr(event);
> > > > > +	rte_trace_point_emit_ptr(conf);
> > > > >  )
> > > > >
> > > > >  RTE_TRACE_POINT(
> > > > > diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> > > > > b/lib/eventdev/rte_event_crypto_adapter.c
> > > > > index 7c695176f4..73a4f231e2 100644
> > > > > --- a/lib/eventdev/rte_event_crypto_adapter.c
> > > > > +++ b/lib/eventdev/rte_event_crypto_adapter.c
> > > > > @@ -921,11 +921,12 @@ int
> > > > >  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
> > > > >  			uint8_t cdev_id,
> > > > >  			int32_t queue_pair_id,
> > > > > -			const struct rte_event *event)
> > > > > +			const struct
> rte_event_crypto_adapter_queue_conf
> > > > > *conf)
> > > > >  {
> > > > > +	struct rte_event_crypto_adapter_vector_limits limits;
> > > > >  	struct event_crypto_adapter *adapter;
> > > > > -	struct rte_eventdev *dev;
> > > > >  	struct crypto_device_info *dev_info;
> > > > > +	struct rte_eventdev *dev;
> > > > >  	uint32_t cap;
> > > > >  	int ret;
> > > > >
> > > > > @@ -951,11 +952,47 @@
> > > > > rte_event_crypto_adapter_queue_pair_add(uint8_t
> > > > > id,
> > > > >  	}
> > > > >
> > > > >  	if ((cap &
> > > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND)
> &&
> > > > > -	    (event == NULL)) {
> > > > > +	    (conf == NULL)) {
> > > > >  		RTE_EDEV_LOG_ERR("Conf value can not be NULL for
> > > dev_id=%u",
> > > > >  				  cdev_id);
> > > > >  		return -EINVAL;
> > > > >  	}
> > > > Newline?
> > > >
> > > Ack
> > >
> > > > > +	if ((conf != NULL) &&
> > > > Checking conf twice?
> > > Will rewrite as if conf == NULL/else, to avoid double checking.
> > >
> > > > > +	    (conf->flags &
> RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR)) {
> > > > Else condition if the flags is not set?
> > > There's no additional handing for case when flag is no set.
> > >
> > > > > +		if ((cap &
> > > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR) == 0) {
> > > > > +			RTE_EDEV_LOG_ERR("Event vectorization is
> not
> > > > > supported,"
> > > > > +					 "dev %" PRIu8 " cdev %"
> PRIu8, id,
> > > > > +					 cdev_id);
> > > > > +			return -ENOTSUP;
> > > > > +		}
> > > > > +
> > > > > +		ret = rte_event_crypto_adapter_vector_limits_get(
> > > > > +			adapter->eventdev_id, cdev_id, &limits);
> > > > > +		if (ret < 0) {
> > > > > +			RTE_EDEV_LOG_ERR("Failed to get event
> device vector
> > > > > "
> > > > > +					 "limits, dev %" PRIu8 " cdev
> %" PRIu8,
> > > > > +					 id, cdev_id);
> > > > > +			return -EINVAL;
> > > > > +		}
> > > > New line? Please check other cases.
> > > >
> > > Ack
> > >
> > > > > +		if (conf->vector_sz < limits.min_sz ||
> > > > > +		    conf->vector_sz > limits.max_sz ||
> > > > > +		    conf->vector_timeout_ns < limits.min_timeout_ns ||
> > > > > +		    conf->vector_timeout_ns > limits.max_timeout_ns
> ||
> > > > > +		    conf->vector_mp == NULL) {
> > > > > +			RTE_EDEV_LOG_ERR("Invalid event vector
> > > > > configuration,"
> > > > > +					 " dev %" PRIu8 " cdev %"
> PRIu8,
> > > > > +					 id, cdev_id);
> > > > > +			return -EINVAL;
> > > > > +		}
> > > > > +		if (conf->vector_mp->elt_size <
> > > > > +		    (sizeof(struct rte_event_vector) +
> > > > > +		     (sizeof(uintptr_t) * conf->vector_sz))) {
> > > > > +			RTE_EDEV_LOG_ERR("Invalid event vector
> > > > > configuration,"
> > > > > +					 " dev %" PRIu8 " cdev %"
> PRIu8,
> > > > > +					 id, cdev_id);
> > > > > +			return -EINVAL;
> > > > > +		}
> > > > > +	}
> > > > >
> > > > >  	dev_info = &adapter->cdevs[cdev_id];
> > > > >
> > > > > @@ -990,7 +1027,7 @@
> > > rte_event_crypto_adapter_queue_pair_add(uint8_t
> > > > > id,
> > > > >  		ret = (*dev->dev_ops->crypto_adapter_queue_pair_add)(dev,
> > > > >  				dev_info->dev,
> > > > >  				queue_pair_id,
> > > > > -				event);
> > > > > +				conf);
> > > > >  		if (ret)
> > > > >  			return ret;
> > > > >
> > > > > @@ -1030,8 +1067,8 @@
> > > > > rte_event_crypto_adapter_queue_pair_add(uint8_t
> > > > > id,
> > > > >  		rte_service_component_runstate_set(adapter->service_id, 1);
> > > > >  	}
> > > > >
> > > > > -	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
> > > > > event,
> > > > > -		queue_pair_id);
> > > > > +	rte_eventdev_trace_crypto_adapter_queue_pair_add(id,
> cdev_id,
> > > > > +		queue_pair_id, conf);
> > > > >  	return 0;
> > > > >  }
> > > > >
> > > > > @@ -1290,3 +1327,44 @@
> > > > > rte_event_crypto_adapter_event_port_get(uint8_t
> > > > > id, uint8_t *event_port_id)
> > > > >
> > > > >  	return 0;
> > > > >  }
> > > > > +
> > > > > +int
> > > > > +rte_event_crypto_adapter_vector_limits_get(
> > > > > +	uint8_t dev_id, uint16_t cdev_id,
> > > > > +	struct rte_event_crypto_adapter_vector_limits *limits) {
> > > > > +	struct rte_cryptodev *cdev;
> > > > > +	struct rte_eventdev *dev;
> > > > > +	uint32_t cap;
> > > > > +	int ret;
> > > > > +
> > > > > +	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> > > > > +
> > > > > +	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
> > > > > +		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8,
> cdev_id);
> > > > > +		return -EINVAL;
> > > > > +	}
> > > > > +
> > > > > +	if (limits == NULL)
> > > > > +		return -EINVAL;
> > > > Add appropriate error message like above?
> > > Ack, will add.
> > >
> > > > > +
> > > > > +	dev = &rte_eventdevs[dev_id];
> > > > > +	cdev = rte_cryptodev_pmd_get_dev(cdev_id);
> > > > > +
> > > > > +	ret = rte_event_crypto_adapter_caps_get(dev_id, cdev_id,
> &cap);
> > > > > +	if (ret) {
> > > > > +		RTE_EDEV_LOG_ERR("Failed to get adapter caps edev
> %" PRIu8
> > > > > +				 "cdev %" PRIu16, dev_id, cdev_id);
> > > > > +		return ret;
> > > > > +	}
> > > > > +
> > > > > +	if (!(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR))
> > > > > +		return -ENOTSUP;
> > > > Same here.
> > > Ack, will add.
> > >
> > > > > +
> > > > > +	RTE_FUNC_PTR_OR_ERR_RET(
> > > > > +		*dev->dev_ops->crypto_adapter_vector_limits_get,
> > > > > +		-ENOTSUP);
> > > > > +
> > > > > +	return dev->dev_ops->crypto_adapter_vector_limits_get(
> > > > > +		dev, cdev, limits);
> > > > > +}
> > > > > diff --git a/lib/eventdev/rte_event_crypto_adapter.h
> > > > > b/lib/eventdev/rte_event_crypto_adapter.h
> > > > > index d90a19e72c..7dd6171b9b 100644
> > > > > --- a/lib/eventdev/rte_event_crypto_adapter.h
> > > > > +++ b/lib/eventdev/rte_event_crypto_adapter.h
> > > > > @@ -253,6 +253,78 @@ struct rte_event_crypto_adapter_conf {
> > > > >  	 */
> > > > >  };
> > > > >
> > > > > +#define RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR	0x1
> > > > > +/**< This flag indicates that crypto operations processed on
> > > > > +the crypto
> > > > > + * adapter need to be vectorized
> > > > > + * @see rte_event_crypto_adapter_queue_conf::flags
> > > > > + */
> > > > > +
> > > > > +/**
> > > > > + * Adapter queue configuration structure  */ struct
> > > > > +rte_event_crypto_adapter_queue_conf {
> > > > > +	uint32_t flags;
> > > > > +	/**< Flags for handling crypto operations
> > > > > +	 * @see RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
> > > > > +	 */
> > > > > +	struct rte_event ev;
> > > > > +	/**< If HW supports cryptodev queue pair to event queue
> binding,
> > > > > +	 * application is expected to fill in event information.
> > > > > +	 * @see
> > > > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> > > > > +	 */
> > > > > +	uint16_t vector_sz;
> > > > > +	/**< Indicates the maximum number for crypto operations to
> > > > > +combine
> > > > > and
> > > > > +	 * form a vector.
> > > > > +	 * @see rte_event_crypto_adapter_vector_limits::min_sz
> > > > > +	 * @see rte_event_crypto_adapter_vector_limits::max_sz
> > > > > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
> flag is
> > > > > set in
> > > > > +	 * @see
> rte_event_crypto_adapter_queue_conf::rx_queue_flags
> > > > rx_queue_flags??
> > > Typo, should be conf::flags.
> > >
> > > > > +	 */
> > > > > +	uint64_t vector_timeout_ns;
> > > > > +	/**<
> > > > > +	 * Indicates the maximum number of nanoseconds to wait for
> > > > > aggregating
> > > > > +	 * crypto operations. Should be within vectorization limits of
> the
> > > > > +	 * adapter
> > > > > +	 * @see
> rte_event_crypto_adapter_vector_limits::min_timeout_ns
> > > > > +	 * @see
> rte_event_crypto_adapter_vector_limits::max_timeout_ns
> > > > > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
> flag is
> > > > > set in
> > > > > +	 * @see rte_event_crypto_adapter_queue_conf::flags
> > > > > +	 */
> > > > > +	struct rte_mempool *vector_mp;
> > > > > +	/**< Indicates the mempool that should be used for allocating
> > > > > +	 * rte_event_vector container.
> > > > > +	 * Should be created by using `rte_event_vector_pool_create`.
> > > > > +	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
> flag is
> > > > > set in
> > > > > +	 * @see rte_event_crypto_adapter_queue_conf::flags.
> > > > > +	 */
> > > > > +};
> > > > > +
> > > > > +/**
> > > > > + * A structure used to retrieve event crypto adapter vector limits.
> > > > > + */
> > > > > +struct rte_event_crypto_adapter_vector_limits {
> > > > > +	uint16_t min_sz;
> > > > > +	/**< Minimum vector limit configurable.
> > > > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > > > > +	 */
> > > > > +	uint16_t max_sz;
> > > > > +	/**< Maximum vector limit configurable.
> > > > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > > > > +	 */
> > > > > +	uint8_t log2_sz;
> > > > > +	/**< True if the size configured should be in log2.
> > > > > +	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
> > > > > +	 */
> > > > > +	uint64_t min_timeout_ns;
> > > > > +	/**< Minimum vector timeout configurable.
> > > > > +	 * @see
> rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> > > > > +	 */
> > > > > +	uint64_t max_timeout_ns;
> > > > > +	/**< Maximum vector timeout configurable.
> > > > > +	 * @see
> rte_event_crypto_adapter_queue_conf::vector_timeout_ns
> > > > > +	 */
> > > > > +};
> > > > > +
> > > > >  /**
> > > > >   * Function type used for adapter configuration callback. The callback is
> > > > >   * used to fill in members of the struct
> > > > > rte_event_crypto_adapter_conf, this @@ -392,10 +464,9 @@
> > > > rte_event_crypto_adapter_free(uint8_t id);
> > > > >   *  Cryptodev queue pair identifier. If queue_pair_id is set -1,
> > > > >   *  adapter adds all the pre configured queue pairs to the instance.
> > > > >   *
> > > > > - * @param event
> > > > > - *  if HW supports cryptodev queue pair to event queue binding,
> > > > > application is
> > > > > - *  expected to fill in event information, else it will be NULL.
> > > > > - *  @see
> > > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
> > > > > + * @param conf
> > > > > + *  Additional configuration structure of type
> > > > > + *  *rte_event_crypto_adapter_queue_conf*
> > > > >   *
> > > > >   * @return
> > > > >   *  - 0: Success, queue pair added correctly.
> > > > > @@ -405,7 +476,7 @@ int
> > > > >  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
> > > > >  			uint8_t cdev_id,
> > > > >  			int32_t queue_pair_id,
> > > > > -			const struct rte_event *event);
> > > > > +			const struct
> rte_event_crypto_adapter_queue_conf
> > > > > *conf);
> > > > >
> > > > >  /**
> > > > >   * Delete a queue pair from an event crypto adapter.
> > > > > @@ -523,6 +594,26 @@
> > > > > rte_event_crypto_adapter_service_id_get(uint8_t
> > > > > id, uint32_t *service_id);  int
> > > > > rte_event_crypto_adapter_event_port_get(uint8_t
> > > > > id, uint8_t *event_port_id);
> > > > >
> > > > > +/**
> > > > > + * Retrieve vector limits for a given event dev and crypto dev pair.
> > > > > + * @see rte_event_crypto_adapter_vector_limits
> > > > > + *
> > > > > + * @param dev_id
> > > > > + *  Event device identifier.
> > > > > + * @param cdev_id
> > > > > + *  Crypto device identifier.
> > > > > + * @param [out] limits
> > > > > + *  A pointer to rte_event_crypto_adapter_vector_limits
> > > > > +structure that has to
> > > > > + * be filled.
> > > > Space missing before "be filled"
> > > Ack
> > >
> > > > > + *
> > > > > + * @return
> > > > > + *  - 0: Success.
> > > > > + *  - <0: Error code on failure.
> > > > > + */
> > > > > +int rte_event_crypto_adapter_vector_limits_get(
> > > > > +	uint8_t dev_id, uint16_t cdev_id,
> > > > > +	struct rte_event_crypto_adapter_vector_limits *limits);
> > > > > +
> > > > >  /**
> > > > >   * Enqueue a burst of crypto operations as event objects
> > > > > supplied in
> > > > > *rte_event*
> > > > >   * structure on an event crypto adapter designated by its event
> > > > > *dev_id* through diff --git
> > > > > a/lib/eventdev/rte_event_eth_rx_adapter.h
> > > > > b/lib/eventdev/rte_event_eth_rx_adapter.h
> > > > > index 3608a7b2cf..c8f2936866 100644
> > > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h
> > > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h
> > > > > @@ -457,7 +457,8 @@ int rte_event_eth_rx_adapter_free(uint8_t id);
> > > > >   * @see RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ
> > > > >   *
> > > > >   * @param conf
> > > > > - *  Additional configuration structure of type
> > > > > *rte_event_eth_rx_adapter_conf*
> > > > > + *  Additional configuration structure of type
> > > > > + *  *rte_event_eth_rx_adapter_queue_conf*
> > > > These changes are not relevant. Please consider sending separate patch.
> > > >
> > > Ack, Will send this change as a separate patch.
> > >
> > > > >   *
> > > > >   * @return
> > > > >   *  - 0: Success, Receive queue added correctly.
> > > > > diff --git a/lib/eventdev/rte_eventdev.h
> > > > > b/lib/eventdev/rte_eventdev.h index
> > > > > 6a6f6ea4c1..1a737bf851 100644
> > > > > --- a/lib/eventdev/rte_eventdev.h
> > > > > +++ b/lib/eventdev/rte_eventdev.h
> > > > > @@ -1203,6 +1203,9 @@ struct rte_event_vector {  #define
> > > > > RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR
> > > \
> > > > >  	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER)
> > > /**< The
> > > > > event vector generated from eth Rx adapter. */
> > > > > +#define RTE_EVENT_TYPE_CRYPTODEV_VECTOR
> \
> > > > > +	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV)
> /**< The
> > > > > event
> > > > > +vector generated from cryptodev adapter. */
> > > > >
> > > > >  #define RTE_EVENT_TYPE_MAX              0x10
> > > > >  /**< Maximum number of event types */ @@ -1420,6 +1423,11 @@
> > > > > rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps);
> > > > >   * the private data information along with the crypto session.
> > > > >   */
> > > > >
> > > > > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR   0x10
> > > > > +/**< Flag indicates HW is capable of aggregating processed
> > > > > + * crypto operations into rte_event_vector.
> > > > > + */
> > > > > +
> > > > >  /**
> > > > >   * Retrieve the event device's crypto adapter capabilities for the
> > > > >   * specified cryptodev device
> > > > > --
> > > > > 2.25.1
  
Jerin Jacob Sept. 27, 2022, 1:26 p.m. UTC | #8
> > > > >
> > > > Right now we are targeting crypto_cn10k PMD and ipsec-secgw event
> > > > mode to support vectorization.
> > > Is there a way to test this? When can be dataplane changes expected?
> > >
> > If the spec looks okay, support in s/w crypto adapter and other h/w PMDs can
> > be added by respective maintainers. Currently, we are adding library change,
> > support for one PMD and an application to test the feature. Feature is exposed
> > with capability flag to not break existing functionality.
> Got it. How do I test this feature without data plane changes?


Hi @Gujjar, Abhinandan S

> If there is a way to test this, please let me know.

Dataplane changes can be tested on the cn10k platform.
This feature is a hardware assisted feature.

> This design is right now tested for cn10k, I am not sure this works for sw adapter.

SW driver support is not added in this series as in order to accept a
API change, one would need,
1)API spec
2)One of the driver
3)Test application to exercise the API.

It is a similar case for all ethdev, rte_flow features etc.
Community can add SW driver support just like any other subsystem APIs.

Also, The proposed library changes don't differentiate between SW & HW PMDs.
The proposed changes are exposed with a capability flag and so SW
crypto adapter will not have any perf impact.

> I need to have perf data with and without vectorization support to approve.

On the cn10k platform, we see nearly 2.5x performance with
vectorization. Eth rx adapter already supports vectorization and this
spec change is in line with that.

Also IPsec gateway update to exercise these APIs. See
http://patches.dpdk.org/project/dpdk/patch/20220804103626.102688-6-vfialko@marvell.com/

Command to test on drivers which have this functionality.

./dpdk-ipsec-secgw -c 0xff0000 -a 0002:01:00.1 -a 0002:20:00.1 -a
0002:1e:00.0 -- -P -p 0x1 -P  --transfer-mode event -l
--event-schedule-type parallel --desc-nb 8192 --event-vector -f
simple.conf

sample.conf

sp ipv4 out esp protect 19 pri 1 dst 192.18.0.0/32 sport 0:65535 dport 0:65535
sa out 19 aead_algo aes-128-gcm aead_key
73:69:78:74:65:65:6e:62:79:74:65:73:20:6b:65:79:64:70:64:6b mode
ipv4-tunnel src 2.1.1.1 dst 1.1.1.1 type lookaside-protocol-offload
port_id 0

neigh port 0 d0:37:45:02:b0:d3
rt ipv4 dst 1.1.0.0/16 port 0

In order to make forward progress and merge patch in RC1, I would request
1)Review the API specific patch(eventdev: introduce event cryptodev
vector type), If spec needs to be changed to adapt any other driver(SW
or HW) then the author should address that.
2)If you think, API usage is not enough with dpdk-ipsec-secgw
application, I think, author should update the test-eventdev
application to support the new mode.Which can be merged after RC1 as
it is a test application change.

Let us know what you think to make forward progress.
  
Gujjar, Abhinandan S Sept. 28, 2022, 2:43 p.m. UTC | #9
> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Tuesday, September 27, 2022 6:56 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> Cc: Volodymyr Fialko <vfialko@marvell.com>; dev@dpdk.org; Jerin Jacob
> Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>; Akhil Goyal <gakhil@marvell.com>; Anoob
> Joseph <anoobj@marvell.com>
> Subject: Re: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> 
> > > > > >
> > > > > Right now we are targeting crypto_cn10k PMD and ipsec-secgw
> > > > > event mode to support vectorization.
> > > > Is there a way to test this? When can be dataplane changes expected?
> > > >
> > > If the spec looks okay, support in s/w crypto adapter and other h/w
> > > PMDs can be added by respective maintainers. Currently, we are
> > > adding library change, support for one PMD and an application to
> > > test the feature. Feature is exposed with capability flag to not break
> existing functionality.
> > Got it. How do I test this feature without data plane changes?
> 
> 
> Hi @Gujjar, Abhinandan S
> 
> > If there is a way to test this, please let me know.
> 
> Dataplane changes can be tested on the cn10k platform.
> This feature is a hardware assisted feature.
> 
> > This design is right now tested for cn10k, I am not sure this works for sw
> adapter.
> 
> SW driver support is not added in this series as in order to accept a API change,
> one would need, 1)API spec 2)One of the driver 3)Test application to exercise
> the API.
> 
> It is a similar case for all ethdev, rte_flow features etc.
> Community can add SW driver support just like any other subsystem APIs.
> 
> Also, The proposed library changes don't differentiate between SW & HW
> PMDs.
> The proposed changes are exposed with a capability flag and so SW crypto
> adapter will not have any perf impact.
> 
> > I need to have perf data with and without vectorization support to approve.
> 
> On the cn10k platform, we see nearly 2.5x performance with vectorization. Eth
> rx adapter already supports vectorization and this spec change is in line with
> that.
> 
> Also IPsec gateway update to exercise these APIs. See
> http://patches.dpdk.org/project/dpdk/patch/20220804103626.102688-6-
> vfialko@marvell.com/
> 
> Command to test on drivers which have this functionality.
> 
> ./dpdk-ipsec-secgw -c 0xff0000 -a 0002:01:00.1 -a 0002:20:00.1 -a
> 0002:1e:00.0 -- -P -p 0x1 -P  --transfer-mode event -l --event-schedule-type
> parallel --desc-nb 8192 --event-vector -f simple.conf
> 
> sample.conf
> 
> sp ipv4 out esp protect 19 pri 1 dst 192.18.0.0/32 sport 0:65535 dport 0:65535
> sa out 19 aead_algo aes-128-gcm aead_key
> 73:69:78:74:65:65:6e:62:79:74:65:73:20:6b:65:79:64:70:64:6b mode ipv4-
> tunnel src 2.1.1.1 dst 1.1.1.1 type lookaside-protocol-offload port_id 0
> 
> neigh port 0 d0:37:45:02:b0:d3
> rt ipv4 dst 1.1.0.0/16 port 0
> 
> In order to make forward progress and merge patch in RC1, I would request
> 1)Review the API specific patch(eventdev: introduce event cryptodev vector
> type), If spec needs to be changed to adapt any other driver(SW or HW) then
> the author should address that.
> 2)If you think, API usage is not enough with dpdk-ipsec-secgw application, I
> think, author should update the test-eventdev application to support the new
> mode.Which can be merged after RC1 as it is a test application change.
> 
> Let us know what you think to make forward progress.

Hi @Jerin Jacob & @Volodymyr Fialko,
Thanks for clarifying. We would like to have a call to discuss on this.
Could you please setup a call & include @Jayatheerthan, Jay also into it?

Thanks
Abhinandan
  
Jerin Jacob Sept. 28, 2022, 4:13 p.m. UTC | #10
On Wed, Sep 28, 2022 at 8:14 PM Gujjar, Abhinandan S
<abhinandan.gujjar@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Jerin Jacob <jerinjacobk@gmail.com>
> > Sent: Tuesday, September 27, 2022 6:56 PM
> > To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> > Cc: Volodymyr Fialko <vfialko@marvell.com>; dev@dpdk.org; Jerin Jacob
> > Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh Bhagavatula
> > <pbhagavatula@marvell.com>; Shijith Thotton <sthotton@marvell.com>;
> > Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> > <sachin.saxena@oss.nxp.com>; Jayatheerthan, Jay
> > <jay.jayatheerthan@intel.com>; Akhil Goyal <gakhil@marvell.com>; Anoob
> > Joseph <anoobj@marvell.com>
> > Subject: Re: [PATCH 1/3] eventdev: introduce event cryptodev vector type
> >
> > > > > > >
> > > > > > Right now we are targeting crypto_cn10k PMD and ipsec-secgw
> > > > > > event mode to support vectorization.
> > > > > Is there a way to test this? When can be dataplane changes expected?
> > > > >
> > > > If the spec looks okay, support in s/w crypto adapter and other h/w
> > > > PMDs can be added by respective maintainers. Currently, we are
> > > > adding library change, support for one PMD and an application to
> > > > test the feature. Feature is exposed with capability flag to not break
> > existing functionality.
> > > Got it. How do I test this feature without data plane changes?
> >
> >
> > Hi @Gujjar, Abhinandan S
> >
> > > If there is a way to test this, please let me know.
> >
> > Dataplane changes can be tested on the cn10k platform.
> > This feature is a hardware assisted feature.
> >
> > > This design is right now tested for cn10k, I am not sure this works for sw
> > adapter.
> >
> > SW driver support is not added in this series as in order to accept a API change,
> > one would need, 1)API spec 2)One of the driver 3)Test application to exercise
> > the API.
> >
> > It is a similar case for all ethdev, rte_flow features etc.
> > Community can add SW driver support just like any other subsystem APIs.
> >
> > Also, The proposed library changes don't differentiate between SW & HW
> > PMDs.
> > The proposed changes are exposed with a capability flag and so SW crypto
> > adapter will not have any perf impact.
> >
> > > I need to have perf data with and without vectorization support to approve.
> >
> > On the cn10k platform, we see nearly 2.5x performance with vectorization. Eth
> > rx adapter already supports vectorization and this spec change is in line with
> > that.
> >
> > Also IPsec gateway update to exercise these APIs. See
> > http://patches.dpdk.org/project/dpdk/patch/20220804103626.102688-6-
> > vfialko@marvell.com/
> >
> > Command to test on drivers which have this functionality.
> >
> > ./dpdk-ipsec-secgw -c 0xff0000 -a 0002:01:00.1 -a 0002:20:00.1 -a
> > 0002:1e:00.0 -- -P -p 0x1 -P  --transfer-mode event -l --event-schedule-type
> > parallel --desc-nb 8192 --event-vector -f simple.conf
> >
> > sample.conf
> >
> > sp ipv4 out esp protect 19 pri 1 dst 192.18.0.0/32 sport 0:65535 dport 0:65535
> > sa out 19 aead_algo aes-128-gcm aead_key
> > 73:69:78:74:65:65:6e:62:79:74:65:73:20:6b:65:79:64:70:64:6b mode ipv4-
> > tunnel src 2.1.1.1 dst 1.1.1.1 type lookaside-protocol-offload port_id 0
> >
> > neigh port 0 d0:37:45:02:b0:d3
> > rt ipv4 dst 1.1.0.0/16 port 0
> >
> > In order to make forward progress and merge patch in RC1, I would request
> > 1)Review the API specific patch(eventdev: introduce event cryptodev vector
> > type), If spec needs to be changed to adapt any other driver(SW or HW) then
> > the author should address that.
> > 2)If you think, API usage is not enough with dpdk-ipsec-secgw application, I
> > think, author should update the test-eventdev application to support the new
> > mode.Which can be merged after RC1 as it is a test application change.
> >
> > Let us know what you think to make forward progress.
>
> Hi @Jerin Jacob & @Volodymyr Fialko,
> Thanks for clarifying. We would like to have a call to discuss on this.
> Could you please setup a call & include @Jayatheerthan, Jay also into it?

Sure. Setting up one at 4PM IST on 29 Oct.

Please find the details.

Hi there,

Jerin Jacob Kollanukkaran is inviting you to a scheduled Zoom meeting.

Topic: Jerin Jacob Kollanukkaran's Personal Meeting Room


Join Zoom Meeting:
https://marvell.zoom.us/j/9901077677?pwd=T2lTTGMwYlc1YTQzMnR4eGRWQXR6QT09
    Password: 339888


Or Telephone:
    Dial(for higher quality, dial a number based on your current location):
        US: +1 646 558 8656  or +1 646 931 3860  or +1 669 444 9171
or +1 669 900 6833  or +1 719 359 4580  or +1 253 215 8782  or +1 301
715 8592  or +1 309 205 3325  or +1 312 626 6799  or +1 346 248 7799
or +1 386 347 5053  or +1 564 217 2000  or 888 788 0099 (Toll Free) or
833 548 0276 (Toll Free) or 833 548 0282 (Toll Free) or 833 928 4608
(Toll Free) or 833 928 4609 (Toll Free) or 833 928 4610 (Toll Free) or
877 853 5247 (Toll Free)
    Meeting ID: 990 107 7677
    Password: 358309
    International numbers available: https://marvell.zoom.us/u/adpcCpMHYt

Or a Video Conference Room:
From Touchpad: Tap Join Zoom button. When prompted, enter 990 107 7677
Password: 358309

For China locations, from Touchpad: Dial* then 990 107 7677
    Password: 358309



>
> Thanks
> Abhinandan
  

Patch

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 81420be73a..c770bc93f6 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -837,14 +837,14 @@  perf_event_crypto_adapter_setup(struct test_perf *t, struct prod_data *p)
 	}
 
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
-		struct rte_event response_info;
+		struct rte_event_crypto_adapter_queue_conf conf;
 
-		response_info.event = 0;
-		response_info.sched_type = RTE_SCHED_TYPE_ATOMIC;
-		response_info.queue_id = p->queue_id;
+		memset(&conf, 0, sizeof(conf));
+		conf.ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
+		conf.ev.queue_id = p->queue_id;
 		ret = rte_event_crypto_adapter_queue_pair_add(
 			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id,
-			&response_info);
+			&conf);
 	} else {
 		ret = rte_event_crypto_adapter_queue_pair_add(
 			TEST_PERF_CA_ID, p->ca.cdev_id, p->ca.cdev_qp_id, NULL);
diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 2ecc7e2cea..bb617c1042 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -1175,6 +1175,10 @@  test_crypto_adapter_create(void)
 static int
 test_crypto_adapter_qp_add_del(void)
 {
+	struct rte_event_crypto_adapter_queue_conf queue_conf = {
+		.ev = response_info,
+	};
+
 	uint32_t cap;
 	int ret;
 
@@ -1183,7 +1187,7 @@  test_crypto_adapter_qp_add_del(void)
 
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
 		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
-				TEST_CDEV_ID, TEST_CDEV_QP_ID, &response_info);
+				TEST_CDEV_ID, TEST_CDEV_QP_ID, &queue_conf);
 	} else
 		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
 					TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL);
@@ -1206,6 +1210,10 @@  configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
 		.new_event_threshold = 1200,
 	};
 
+	struct rte_event_crypto_adapter_queue_conf queue_conf = {
+		.ev = response_info,
+	};
+
 	uint32_t cap;
 	int ret;
 
@@ -1238,7 +1246,7 @@  configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
 
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
 		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
-				TEST_CDEV_ID, TEST_CDEV_QP_ID, &response_info);
+				TEST_CDEV_ID, TEST_CDEV_QP_ID, &queue_conf);
 	} else
 		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
 				TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL);
diff --git a/doc/guides/prog_guide/event_crypto_adapter.rst b/doc/guides/prog_guide/event_crypto_adapter.rst
index 4fb5c688e0..554df7e358 100644
--- a/doc/guides/prog_guide/event_crypto_adapter.rst
+++ b/doc/guides/prog_guide/event_crypto_adapter.rst
@@ -201,10 +201,10 @@  capability, event information must be passed to the add API.
 
         ret = rte_event_crypto_adapter_caps_get(id, evdev, &cap);
         if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
-                struct rte_event event;
+                struct rte_event_crypto_adapter_queue_conf conf;
 
-                // Fill in event information & pass it to add API
-                rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id, &event);
+                // Fill in conf.event information & pass it to add API
+                rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id, &conf);
         } else
                 rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id, NULL);
 
@@ -291,6 +291,23 @@  the ``rte_crypto_op``.
                 rte_memcpy(op + len, &m_data, sizeof(m_data));
         }
 
+Enable event vectorization
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The event crypto adapter can aggregate outcoming crypto operations based on
+provided response information of ``rte_event_crypto_metadata::response_info``
+and generate a ``rte_event`` containing ``rte_event_vector`` whose event type
+is ``RTE_EVENT_TYPE_CRYPTODEV_VECTOR``.
+To enable vectorization application should set
+RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
+``rte_event_crypto_adapter_queue_conf::flag`` and provide vector
+configuration(size, mempool, etc.) with respect of
+``rte_event_crypto_adapter_vector_limits``, which could be obtained by calling
+``rte_event_crypto_adapter_vector_limits_get()``.
+
+The RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR capability indicates whether
+PMD supports this feature.
+
 Start the adapter instance
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c
index 5a0cab40a9..e74ec57382 100644
--- a/drivers/event/cnxk/cn10k_eventdev.c
+++ b/drivers/event/cnxk/cn10k_eventdev.c
@@ -889,11 +889,11 @@  static int
 cn10k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
 			    const struct rte_cryptodev *cdev,
 			    int32_t queue_pair_id,
-			    const struct rte_event *event)
+			    const struct rte_event_crypto_adapter_queue_conf *conf)
 {
 	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
 
-	RTE_SET_USED(event);
+	RTE_SET_USED(conf);
 
 	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn10k");
 	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn10k");
diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c
index 2e27030049..45ed547cb0 100644
--- a/drivers/event/cnxk/cn9k_eventdev.c
+++ b/drivers/event/cnxk/cn9k_eventdev.c
@@ -1120,11 +1120,12 @@  cn9k_crypto_adapter_caps_get(const struct rte_eventdev *event_dev,
 static int
 cn9k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev,
 			   const struct rte_cryptodev *cdev,
-			   int32_t queue_pair_id, const struct rte_event *event)
+			   int32_t queue_pair_id,
+			   const struct rte_event_crypto_adapter_queue_conf *conf)
 {
 	struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
 
-	RTE_SET_USED(event);
+	RTE_SET_USED(conf);
 
 	CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn9k");
 	CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn9k");
diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
index ff6cc0be18..2b9ecd9fbf 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -26,6 +26,7 @@ 
 #include <rte_eventdev.h>
 #include <eventdev_pmd_vdev.h>
 #include <rte_ethdev.h>
+#include <rte_event_crypto_adapter.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_event_eth_tx_adapter.h>
 #include <cryptodev_pmd.h>
@@ -775,10 +776,10 @@  static int
 dpaa_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
 		const struct rte_cryptodev *cryptodev,
 		int32_t rx_queue_id,
-		const struct rte_event *ev)
+		const struct rte_event_crypto_adapter_queue_conf *conf)
 {
 	struct dpaa_eventdev *priv = dev->data->dev_private;
-	uint8_t ev_qid = ev->queue_id;
+	uint8_t ev_qid = conf->ev.queue_id;
 	u16 ch_id = priv->evq_info[ev_qid].ch_id;
 	int ret;
 
@@ -786,10 +787,10 @@  dpaa_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
 
 	if (rx_queue_id == -1)
 		return dpaa_eventdev_crypto_queue_add_all(dev,
-				cryptodev, ev);
+				cryptodev, &conf->ev);
 
 	ret = dpaa_sec_eventq_attach(cryptodev, rx_queue_id,
-			ch_id, ev);
+			ch_id, &conf->ev);
 	if (ret) {
 		DPAA_EVENTDEV_ERR(
 			"dpaa_sec_eventq_attach failed: ret: %d\n", ret);
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index ffc7b8b073..0137736794 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -26,6 +26,7 @@ 
 #include <rte_bus_vdev.h>
 #include <ethdev_driver.h>
 #include <cryptodev_pmd.h>
+#include <rte_event_crypto_adapter.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_event_eth_tx_adapter.h>
 
@@ -865,10 +866,10 @@  static int
 dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
 		const struct rte_cryptodev *cryptodev,
 		int32_t rx_queue_id,
-		const struct rte_event *ev)
+		const struct rte_event_crypto_adapter_queue_conf *conf)
 {
 	struct dpaa2_eventdev *priv = dev->data->dev_private;
-	uint8_t ev_qid = ev->queue_id;
+	uint8_t ev_qid = conf->ev.queue_id;
 	struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon;
 	int ret;
 
@@ -876,10 +877,10 @@  dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev,
 
 	if (rx_queue_id == -1)
 		return dpaa2_eventdev_crypto_queue_add_all(dev,
-				cryptodev, ev);
+				cryptodev, &conf->ev);
 
 	ret = dpaa2_sec_eventq_attach(cryptodev, rx_queue_id,
-				      dpcon, ev);
+				      dpcon, &conf->ev);
 	if (ret) {
 		DPAA2_EVENTDEV_ERR(
 			"dpaa2_sec_eventq_attach failed: ret: %d\n", ret);
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index 9e14e35d10..17acd8ef64 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -745,12 +745,12 @@  static int
 ssovf_crypto_adapter_qp_add(const struct rte_eventdev *dev,
 			    const struct rte_cryptodev *cdev,
 			    int32_t queue_pair_id,
-			    const struct rte_event *event)
+			    const struct rte_event_crypto_adapter_queue_conf *conf)
 {
 	struct cpt_instance *qp;
 	uint8_t qp_id;
 
-	RTE_SET_USED(event);
+	RTE_SET_USED(conf);
 
 	if (queue_pair_id == -1) {
 		for (qp_id = 0; qp_id < cdev->data->nb_queue_pairs; qp_id++) {
diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
index 69402668d8..bcfc9cbcb2 100644
--- a/lib/eventdev/eventdev_pmd.h
+++ b/lib/eventdev/eventdev_pmd.h
@@ -907,6 +907,7 @@  rte_event_pmd_selftest_seqn(struct rte_mbuf *mbuf)
 }
 
 struct rte_cryptodev;
+struct rte_event_crypto_adapter_queue_conf;
 
 /**
  * This API may change without prior notice
@@ -961,11 +962,11 @@  typedef int (*eventdev_crypto_adapter_caps_get_t)
  *   - <0: Error code returned by the driver function.
  *
  */
-typedef int (*eventdev_crypto_adapter_queue_pair_add_t)
-			(const struct rte_eventdev *dev,
-			 const struct rte_cryptodev *cdev,
-			 int32_t queue_pair_id,
-			 const struct rte_event *event);
+typedef int (*eventdev_crypto_adapter_queue_pair_add_t)(
+		const struct rte_eventdev *dev,
+		const struct rte_cryptodev *cdev,
+		int32_t queue_pair_id,
+		const struct rte_event_crypto_adapter_queue_conf *queue_conf);
 
 
 /**
@@ -1074,6 +1075,27 @@  typedef int (*eventdev_crypto_adapter_stats_reset)
 			(const struct rte_eventdev *dev,
 			 const struct rte_cryptodev *cdev);
 
+struct rte_event_crypto_adapter_vector_limits;
+/**
+ * Get event vector limits for a given event, crypto device pair.
+ *
+ * @param dev
+ *   Event device pointer
+ *
+ * @param cdev
+ *   Crypto device pointer
+ *
+ * @param[out] limits
+ *   Pointer to the limits structure to be filled.
+ *
+ * @return
+ *   - 0: Success.
+ *   - <0: Error code returned by the driver function.
+ */
+typedef int (*eventdev_crypto_adapter_vector_limits_get_t)(
+	const struct rte_eventdev *dev, const struct rte_cryptodev *cdev,
+	struct rte_event_crypto_adapter_vector_limits *limits);
+
 /**
  * Retrieve the event device's eth Tx adapter capabilities.
  *
@@ -1339,6 +1361,9 @@  struct eventdev_ops {
 	/**< Get crypto stats */
 	eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
 	/**< Reset crypto stats */
+	eventdev_crypto_adapter_vector_limits_get_t
+		crypto_adapter_vector_limits_get;
+	/**< Get event vector limits for the crypto adapter */
 
 	eventdev_eth_rx_adapter_q_stats_get eth_rx_adapter_queue_stats_get;
 	/**< Get ethernet Rx queue stats */
diff --git a/lib/eventdev/eventdev_trace.h b/lib/eventdev/eventdev_trace.h
index 5ec43d80ee..d48cd58850 100644
--- a/lib/eventdev/eventdev_trace.h
+++ b/lib/eventdev/eventdev_trace.h
@@ -18,6 +18,7 @@  extern "C" {
 #include <rte_trace_point.h>
 
 #include "rte_eventdev.h"
+#include "rte_event_crypto_adapter.h"
 #include "rte_event_eth_rx_adapter.h"
 #include "rte_event_timer_adapter.h"
 
@@ -271,11 +272,12 @@  RTE_TRACE_POINT(
 RTE_TRACE_POINT(
 	rte_eventdev_trace_crypto_adapter_queue_pair_add,
 	RTE_TRACE_POINT_ARGS(uint8_t adptr_id, uint8_t cdev_id,
-		const void *event, int32_t queue_pair_id),
+		int32_t queue_pair_id,
+		const struct rte_event_crypto_adapter_queue_conf *conf),
 	rte_trace_point_emit_u8(adptr_id);
 	rte_trace_point_emit_u8(cdev_id);
 	rte_trace_point_emit_i32(queue_pair_id);
-	rte_trace_point_emit_ptr(event);
+	rte_trace_point_emit_ptr(conf);
 )
 
 RTE_TRACE_POINT(
diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 7c695176f4..73a4f231e2 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -921,11 +921,12 @@  int
 rte_event_crypto_adapter_queue_pair_add(uint8_t id,
 			uint8_t cdev_id,
 			int32_t queue_pair_id,
-			const struct rte_event *event)
+			const struct rte_event_crypto_adapter_queue_conf *conf)
 {
+	struct rte_event_crypto_adapter_vector_limits limits;
 	struct event_crypto_adapter *adapter;
-	struct rte_eventdev *dev;
 	struct crypto_device_info *dev_info;
+	struct rte_eventdev *dev;
 	uint32_t cap;
 	int ret;
 
@@ -951,11 +952,47 @@  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
 	}
 
 	if ((cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) &&
-	    (event == NULL)) {
+	    (conf == NULL)) {
 		RTE_EDEV_LOG_ERR("Conf value can not be NULL for dev_id=%u",
 				  cdev_id);
 		return -EINVAL;
 	}
+	if ((conf != NULL) &&
+	    (conf->flags & RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR)) {
+		if ((cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR) == 0) {
+			RTE_EDEV_LOG_ERR("Event vectorization is not supported,"
+					 "dev %" PRIu8 " cdev %" PRIu8, id,
+					 cdev_id);
+			return -ENOTSUP;
+		}
+
+		ret = rte_event_crypto_adapter_vector_limits_get(
+			adapter->eventdev_id, cdev_id, &limits);
+		if (ret < 0) {
+			RTE_EDEV_LOG_ERR("Failed to get event device vector "
+					 "limits, dev %" PRIu8 " cdev %" PRIu8,
+					 id, cdev_id);
+			return -EINVAL;
+		}
+		if (conf->vector_sz < limits.min_sz ||
+		    conf->vector_sz > limits.max_sz ||
+		    conf->vector_timeout_ns < limits.min_timeout_ns ||
+		    conf->vector_timeout_ns > limits.max_timeout_ns ||
+		    conf->vector_mp == NULL) {
+			RTE_EDEV_LOG_ERR("Invalid event vector configuration,"
+					 " dev %" PRIu8 " cdev %" PRIu8,
+					 id, cdev_id);
+			return -EINVAL;
+		}
+		if (conf->vector_mp->elt_size <
+		    (sizeof(struct rte_event_vector) +
+		     (sizeof(uintptr_t) * conf->vector_sz))) {
+			RTE_EDEV_LOG_ERR("Invalid event vector configuration,"
+					 " dev %" PRIu8 " cdev %" PRIu8,
+					 id, cdev_id);
+			return -EINVAL;
+		}
+	}
 
 	dev_info = &adapter->cdevs[cdev_id];
 
@@ -990,7 +1027,7 @@  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
 		ret = (*dev->dev_ops->crypto_adapter_queue_pair_add)(dev,
 				dev_info->dev,
 				queue_pair_id,
-				event);
+				conf);
 		if (ret)
 			return ret;
 
@@ -1030,8 +1067,8 @@  rte_event_crypto_adapter_queue_pair_add(uint8_t id,
 		rte_service_component_runstate_set(adapter->service_id, 1);
 	}
 
-	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id, event,
-		queue_pair_id);
+	rte_eventdev_trace_crypto_adapter_queue_pair_add(id, cdev_id,
+		queue_pair_id, conf);
 	return 0;
 }
 
@@ -1290,3 +1327,44 @@  rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
 
 	return 0;
 }
+
+int
+rte_event_crypto_adapter_vector_limits_get(
+	uint8_t dev_id, uint16_t cdev_id,
+	struct rte_event_crypto_adapter_vector_limits *limits)
+{
+	struct rte_cryptodev *cdev;
+	struct rte_eventdev *dev;
+	uint32_t cap;
+	int ret;
+
+	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+
+	if (!rte_cryptodev_is_valid_dev(cdev_id)) {
+		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
+		return -EINVAL;
+	}
+
+	if (limits == NULL)
+		return -EINVAL;
+
+	dev = &rte_eventdevs[dev_id];
+	cdev = rte_cryptodev_pmd_get_dev(cdev_id);
+
+	ret = rte_event_crypto_adapter_caps_get(dev_id, cdev_id, &cap);
+	if (ret) {
+		RTE_EDEV_LOG_ERR("Failed to get adapter caps edev %" PRIu8
+				 "cdev %" PRIu16, dev_id, cdev_id);
+		return ret;
+	}
+
+	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR))
+		return -ENOTSUP;
+
+	RTE_FUNC_PTR_OR_ERR_RET(
+		*dev->dev_ops->crypto_adapter_vector_limits_get,
+		-ENOTSUP);
+
+	return dev->dev_ops->crypto_adapter_vector_limits_get(
+		dev, cdev, limits);
+}
diff --git a/lib/eventdev/rte_event_crypto_adapter.h b/lib/eventdev/rte_event_crypto_adapter.h
index d90a19e72c..7dd6171b9b 100644
--- a/lib/eventdev/rte_event_crypto_adapter.h
+++ b/lib/eventdev/rte_event_crypto_adapter.h
@@ -253,6 +253,78 @@  struct rte_event_crypto_adapter_conf {
 	 */
 };
 
+#define RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR	0x1
+/**< This flag indicates that crypto operations processed on the crypto
+ * adapter need to be vectorized
+ * @see rte_event_crypto_adapter_queue_conf::flags
+ */
+
+/**
+ * Adapter queue configuration structure
+ */
+struct rte_event_crypto_adapter_queue_conf {
+	uint32_t flags;
+	/**< Flags for handling crypto operations
+	 * @see RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR
+	 */
+	struct rte_event ev;
+	/**< If HW supports cryptodev queue pair to event queue binding,
+	 * application is expected to fill in event information.
+	 * @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
+	 */
+	uint16_t vector_sz;
+	/**< Indicates the maximum number for crypto operations to combine and
+	 * form a vector.
+	 * @see rte_event_crypto_adapter_vector_limits::min_sz
+	 * @see rte_event_crypto_adapter_vector_limits::max_sz
+	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is set in
+	 * @see rte_event_crypto_adapter_queue_conf::rx_queue_flags
+	 */
+	uint64_t vector_timeout_ns;
+	/**<
+	 * Indicates the maximum number of nanoseconds to wait for aggregating
+	 * crypto operations. Should be within vectorization limits of the
+	 * adapter
+	 * @see rte_event_crypto_adapter_vector_limits::min_timeout_ns
+	 * @see rte_event_crypto_adapter_vector_limits::max_timeout_ns
+	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is set in
+	 * @see rte_event_crypto_adapter_queue_conf::flags
+	 */
+	struct rte_mempool *vector_mp;
+	/**< Indicates the mempool that should be used for allocating
+	 * rte_event_vector container.
+	 * Should be created by using `rte_event_vector_pool_create`.
+	 * Valid when RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR flag is set in
+	 * @see rte_event_crypto_adapter_queue_conf::flags.
+	 */
+};
+
+/**
+ * A structure used to retrieve event crypto adapter vector limits.
+ */
+struct rte_event_crypto_adapter_vector_limits {
+	uint16_t min_sz;
+	/**< Minimum vector limit configurable.
+	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
+	 */
+	uint16_t max_sz;
+	/**< Maximum vector limit configurable.
+	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
+	 */
+	uint8_t log2_sz;
+	/**< True if the size configured should be in log2.
+	 * @see rte_event_crypto_adapter_queue_conf::vector_sz
+	 */
+	uint64_t min_timeout_ns;
+	/**< Minimum vector timeout configurable.
+	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
+	 */
+	uint64_t max_timeout_ns;
+	/**< Maximum vector timeout configurable.
+	 * @see rte_event_crypto_adapter_queue_conf::vector_timeout_ns
+	 */
+};
+
 /**
  * Function type used for adapter configuration callback. The callback is
  * used to fill in members of the struct rte_event_crypto_adapter_conf, this
@@ -392,10 +464,9 @@  rte_event_crypto_adapter_free(uint8_t id);
  *  Cryptodev queue pair identifier. If queue_pair_id is set -1,
  *  adapter adds all the pre configured queue pairs to the instance.
  *
- * @param event
- *  if HW supports cryptodev queue pair to event queue binding, application is
- *  expected to fill in event information, else it will be NULL.
- *  @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
+ * @param conf
+ *  Additional configuration structure of type
+ *  *rte_event_crypto_adapter_queue_conf*
  *
  * @return
  *  - 0: Success, queue pair added correctly.
@@ -405,7 +476,7 @@  int
 rte_event_crypto_adapter_queue_pair_add(uint8_t id,
 			uint8_t cdev_id,
 			int32_t queue_pair_id,
-			const struct rte_event *event);
+			const struct rte_event_crypto_adapter_queue_conf *conf);
 
 /**
  * Delete a queue pair from an event crypto adapter.
@@ -523,6 +594,26 @@  rte_event_crypto_adapter_service_id_get(uint8_t id, uint32_t *service_id);
 int
 rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
 
+/**
+ * Retrieve vector limits for a given event dev and crypto dev pair.
+ * @see rte_event_crypto_adapter_vector_limits
+ *
+ * @param dev_id
+ *  Event device identifier.
+ * @param cdev_id
+ *  Crypto device identifier.
+ * @param [out] limits
+ *  A pointer to rte_event_crypto_adapter_vector_limits structure that has to
+ * be filled.
+ *
+ * @return
+ *  - 0: Success.
+ *  - <0: Error code on failure.
+ */
+int rte_event_crypto_adapter_vector_limits_get(
+	uint8_t dev_id, uint16_t cdev_id,
+	struct rte_event_crypto_adapter_vector_limits *limits);
+
 /**
  * Enqueue a burst of crypto operations as event objects supplied in *rte_event*
  * structure on an event crypto adapter designated by its event *dev_id* through
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h
index 3608a7b2cf..c8f2936866 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.h
+++ b/lib/eventdev/rte_event_eth_rx_adapter.h
@@ -457,7 +457,8 @@  int rte_event_eth_rx_adapter_free(uint8_t id);
  * @see RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ
  *
  * @param conf
- *  Additional configuration structure of type *rte_event_eth_rx_adapter_conf*
+ *  Additional configuration structure of type
+ *  *rte_event_eth_rx_adapter_queue_conf*
  *
  * @return
  *  - 0: Success, Receive queue added correctly.
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 6a6f6ea4c1..1a737bf851 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -1203,6 +1203,9 @@  struct rte_event_vector {
 #define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR                                   \
 	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER)
 /**< The event vector generated from eth Rx adapter. */
+#define RTE_EVENT_TYPE_CRYPTODEV_VECTOR                                        \
+	(RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CRYPTODEV)
+/**< The event vector generated from cryptodev adapter. */
 
 #define RTE_EVENT_TYPE_MAX              0x10
 /**< Maximum number of event types */
@@ -1420,6 +1423,11 @@  rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps);
  * the private data information along with the crypto session.
  */
 
+#define RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR   0x10
+/**< Flag indicates HW is capable of aggregating processed
+ * crypto operations into rte_event_vector.
+ */
+
 /**
  * Retrieve the event device's crypto adapter capabilities for the
  * specified cryptodev device