DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [v3,0/5] eventdev: cover letter - crypto adapter
@ 2018-05-05 18:47 Abhinandan Gujjar
  2018-05-05 18:47 ` [dpdk-dev] [v3,1/5] eventdev: introduce event " Abhinandan Gujjar
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Abhinandan Gujjar @ 2018-05-05 18:47 UTC (permalink / raw)
  To: jerin.jacob, hemant.agrawal, akhil.goyal, dev
  Cc: narender.vangati, abhinandan.gujjar, nikhil.rao, gage.eads

This patchset introduces the event crypto adapter which is intended
to bridge between event devices and crypto devices. Addition of the
event crypto adapter into eventdev library extends the event driven
programming model with crypto devices.

This patchset has dependency on below cryptodev patchset:
[1] https://dpdk.org/dev/patchwork/patch/38172/
[2] https://dpdk.org/dev/patchwork/patch/38173/
[3] https://dpdk.org/dev/patchwork/patch/38174/


Change log:
===========
v3:
 -Changed the adapter mode to OP_NEW & OP_FORWARD
 -Removed struct rte_event_crypto_queue_pair_conf
 -Updated adapter service code
 -Updated the documentation

v2:
 -Added following new capabilities:
  -RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW
  -RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND
  -RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA
 -Updated the service init code
 -Moved adapter mode to the adapter create API
 -Updated the test case for above changes

Abhinandan Gujjar (5):
  eventdev: introduce event crypto adapter
  eventdev: add APIs and PMD callbacks for crypto adapter
  eventdev: add crypto adapter implementation
  test: add event crypto adapter auto-test
  doc: add event crypto adapter documentation

 MAINTAINERS                                        |    7 +
 config/common_base                                 |    1 +
 doc/api/doxy-api-index.md                          |    1 +
 doc/guides/prog_guide/event_crypto_adapter.rst     |  244 +++++
 .../img/event_crypto_adapter_op_forward.svg        | 1073 +++++++++++++++++++
 .../prog_guide/img/event_crypto_adapter_op_new.svg |  968 +++++++++++++++++
 doc/guides/prog_guide/index.rst                    |    1 +
 doc/guides/rel_notes/release_18_05.rst             |    6 +
 drivers/event/sw/sw_evdev.c                        |   13 +
 lib/Makefile                                       |    3 +-
 lib/librte_eventdev/Makefile                       |    3 +
 lib/librte_eventdev/meson.build                    |    8 +-
 lib/librte_eventdev/rte_event_crypto_adapter.c     | 1127 ++++++++++++++++++++
 lib/librte_eventdev/rte_event_crypto_adapter.h     |  554 ++++++++++
 lib/librte_eventdev/rte_eventdev.c                 |   25 +
 lib/librte_eventdev/rte_eventdev.h                 |   54 +
 lib/librte_eventdev/rte_eventdev_pmd.h             |  187 ++++
 lib/librte_eventdev/rte_eventdev_version.map       |   12 +
 test/test/Makefile                                 |    1 +
 test/test/test_event_crypto_adapter.c              |  913 ++++++++++++++++
 20 files changed, 5197 insertions(+), 4 deletions(-)
 create mode 100644 doc/guides/prog_guide/event_crypto_adapter.rst
 create mode 100644 doc/guides/prog_guide/img/event_crypto_adapter_op_forward.svg
 create mode 100644 doc/guides/prog_guide/img/event_crypto_adapter_op_new.svg
 create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.c
 create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.h
 create mode 100644 test/test/test_event_crypto_adapter.c

-- 
1.9.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
  2018-05-05 18:47 [dpdk-dev] [v3,0/5] eventdev: cover letter - crypto adapter Abhinandan Gujjar
@ 2018-05-05 18:47 ` Abhinandan Gujjar
  2018-05-07  9:35   ` Jerin Jacob
  2018-05-05 18:47 ` [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for " Abhinandan Gujjar
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 23+ messages in thread
From: Abhinandan Gujjar @ 2018-05-05 18:47 UTC (permalink / raw)
  To: jerin.jacob, hemant.agrawal, akhil.goyal, dev
  Cc: narender.vangati, abhinandan.gujjar, nikhil.rao, gage.eads

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Signed-off-by: Gage Eads <gage.eads@intel.com>
---
 MAINTAINERS                                    |   5 +
 lib/librte_eventdev/rte_event_crypto_adapter.h | 554 +++++++++++++++++++++++++
 2 files changed, 559 insertions(+)
 create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.h

diff --git a/MAINTAINERS b/MAINTAINERS
index ce06e93..991b465 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -362,6 +362,11 @@ F: lib/librte_eventdev/*timer_adapter*
 F: test/test/test_event_timer_adapter.c
 F: doc/guides/prog_guide/event_timer_adapter.rst
 
+Eventdev Crypto Adapter API - EXPERIMENTAL
+M: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
+T: git://dpdk.org/next/dpdk-next-eventdev
+F: lib/librte_eventdev/*crypto_adapter*
+
 Raw device API - EXPERIMENTAL
 M: Shreyansh Jain <shreyansh.jain@nxp.com>
 M: Hemant Agrawal <hemant.agrawal@nxp.com>
diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.h b/lib/librte_eventdev/rte_event_crypto_adapter.h
new file mode 100644
index 0000000..863c801
--- /dev/null
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.h
@@ -0,0 +1,554 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017-2018 Intel Corporation
+ */
+
+#ifndef _RTE_EVENT_CRYPTO_ADAPTER_
+#define _RTE_EVENT_CRYPTO_ADAPTER_
+
+/**
+ * @file
+ *
+ * RTE Event crypto adapter
+ *
+ * Eventdev library provides couple of adapters to bridge between various
+ * components for providing new event source. The event crypto adapter is
+ * one of those adapters which is intended to bridge between event devices
+ * and crypto devices.
+ *
+ * The crypto adapter adds support to enqueue/dequeue crypto operations to/
+ * from event device. The packet flow between crypto device and the event
+ * device can be accomplished using both SW and HW based transfer mechanisms.
+ * The adapter uses an EAL service core function for SW based packet transfer
+ * and uses the eventdev PMD functions to configure HW based packet transfer
+ * between the crypto device and the event device.
+ *
+ * The application can choose to submit a crypto operation directly to
+ * crypto device or send it to the crypto adapter via eventdev, the crypto
+ * adapter then submits the crypto operation to the crypto device.
+ * The first mode is known as the event new (OP_NEW) mode and the
+ * second as the event forward (OP_FORWARD) mode. The choice of mode can
+ * be specified while creating the adapter.
+ *
+ *
+ * Working model of OP_NEW mode:
+ *
+ *                +--------------+         +--------------+
+ *        --[1]-->|              |         | Crypto stage |
+ *                | Event device |---[2]-->| + enqueue to |
+ *        <--[6]--|              |         |   cryptodev  |
+ *                +--------------+         +--------------+
+ *                       ^                        |
+ *                       |                       [3]
+ *                      [5]                       |
+ *                       |                        v
+ *                +--------------+         +--------------+
+ *                |              |         |              |
+ *                |Crypto adapter|<--[4]---|  Cryptodev   |
+ *                |              |         |              |
+ *                +--------------+         +--------------+
+ *
+ *         [1] Events from the previous stage.
+ *         [2] Application in atomic stage dequeues events from eventdev.
+ *         [3] Crypto operations are submitted to cryptodev.
+ *         [4] Crypto adapter dequeues crypto completions from cryptodev.
+ *         [5] Crypto adapter enqueues events to the eventdev.
+ *         [6] Events to the next stage.
+ *
+ * In the OP_NEW mode, application submits crypto operations directly to
+ * crypto device. The adapter then dequeues crypto completions from crypto
+ * device and enqueue events to the event device.
+ * This mode does not ensure ingress ordering. The application is expected
+ * to be in atomic stage. Events dequeued from the adapter will be treated
+ * as new events.
+ * In this mode, application needs to specify event information (response
+ * information) which is needed to enqueue an event after the crypto operation
+ * is completed.
+ *
+ *
+ * Working model of OP_FORWARD mode:
+ *
+ *                +--------------+         +--------------+
+ *        --[1]-->|              |---[2]-->|              |
+ *                | Event device |         | Ordered stage|
+ *        <--[8]--|              |<--[3]---|              |
+ *                +--------------+         +--------------+
+ *                    ^      |
+ *                    |     [4]
+ *                   [7]     |
+ *                    |      v
+ *               +----------------+       +--------------+
+ *               |                |--[5]->|              |
+ *               | Crypto adapter |       |   Cryptodev  |
+ *               |                |<-[6]--|              |
+ *               +----------------+       +--------------+
+ *
+ *
+ *         [1] Events from the previous stage.
+ *         [2] Application in ordered stage dequeues events from eventdev.
+ *         [3] Application enqueues crypto operations as events to eventdev.
+ *         [4] Crypto adapter dequeues event from eventdev.
+ *         [5] Crypto adapter submits crypto operations to cryptodev
+ *             (Atomic stage).
+ *         [6] Crypto adapter dequeues crypto completions from cryptodev
+ *         [7] Crypto adapter enqueues events to the eventdev
+ *         [8] Events to the next stage
+ *
+ * In the OP_FORWARD mode, if HW supports *_OP_FORWARD capability the
+ * application can directly submit the crypto operations to the cryptodev.
+ * If not, application retrieves crypto adapter's event port using
+ * rte_event_crypto_adapter_event_port_get() API. Then, links its event
+ * queue to this port and starts enqueuing crypto operations as events
+ * to the eventdev. The adapter then dequeues the events and submits the
+ * crypto operations to the cryptodev. After the crypto completions, the
+ * adapter enqueues events to the event device.
+ * Application can use this mode, when ingress packet ordering is needed.
+ * Events dequeued from the adapter will be treated as forwarded events.
+ * In this mode, the application needs to specify the cryptodev ID
+ * and queue pair ID (request information) needed to enqueue a crypto
+ * operation in addition to the event information (response information)
+ * needed to enqueue an event after the crypto operation has completed.
+ *
+ *
+ * The event crypto adapter provides common APIs to configure the packet flow
+ * from the crypto device to event devices for both SW and HW based transfers.
+ * The crypto event adapter's functions are:
+ *  - rte_event_crypto_adapter_create_ext()
+ *  - rte_event_crypto_adapter_create()
+ *  - rte_event_crypto_adapter_free()
+ *  - rte_event_crypto_adapter_queue_pair_add()
+ *  - rte_event_crypto_adapter_queue_pair_del()
+ *  - rte_event_crypto_adapter_start()
+ *  - rte_event_crypto_adapter_stop()
+ *  - rte_event_crypto_adapter_stats_get()
+ *  - rte_event_crypto_adapter_stats_reset()
+
+ * The application creates an instance using rte_event_crypto_adapter_create()
+ * or rte_event_crypto_adapter_create_ext().
+ *
+ * Cryptodev queue pair addition/deletion is done using the
+ * rte_event_crypto_adapter_queue_pair_xxx() APIs. If HW supports
+ * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability, event
+ * information must be passed to the add API.
+ *
+ * The SW adapter or HW PMD uses rte_crypto_op::sess_type to decide whether
+ * request/response(private) data is located in the crypto/security session
+ * or at an offset in the rte_crypto_op.
+ *
+ * For session-based operations, the set and get API provides a mechanism for
+ * an application to store and retrieve the data information stored
+ * along with the crypto session.
+ * The RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA capability indicates
+ * whether HW or SW supports this feature.
+ *
+ * For session-less mode, the adapter gets the private data information placed
+ * along with the ``struct rte_crypto_op``.
+ * The rte_crypto_op::private_data_offset provides an offset to locate the
+ * request/response information in the rte_crypto_op. This offset is counted
+ * from the start of the rte_crypto_op including initialization vector (IV).
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#include "rte_eventdev.h"
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this enum may change without prior notice
+ *
+ * Crypto event adapter mode
+ */
+enum rte_event_crypto_adapter_mode {
+	RTE_EVENT_CRYPTO_ADAPTER_OP_NEW,
+	/**< Start the crypto adapter in event new mode.
+	 * @see RTE_EVENT_OP_NEW.
+	 * Application submits crypto operations to the cryptodev.
+	 * Adapter only dequeues the crypto completions from cryptodev
+	 * and enqueue events to the eventdev.
+	 */
+	RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD,
+	/**< Start the crypto adapter in event forward mode.
+	 * @see RTE_EVENT_OP_FORWARD.
+	 * Application submits crypto requests as events to the crypto
+	 * adapter. Adapter submits crypto requests to the cryptodev
+	 * and crypto completions are enqueued back to the eventdev.
+	 */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * Crypto event request structure will be filled by application to
+ * provide event request information to the adapter.
+ */
+struct rte_event_crypto_request {
+	uint8_t resv[8];
+	/**< Overlaps with first 8 bytes of struct rte_event
+	 * that encode the response event information. Application
+	 * is expected to fill in struct rte_event response_info.
+	 */
+	uint16_t cdev_id;
+	/**< cryptodev ID to be used */
+	uint16_t queue_pair_id;
+	/**< cryptodev queue pair ID to be used */
+	uint32_t resv1;
+	/**< Reserved bits */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * Crypto event metadata structure will be filled by application
+ * to provide crypto request and event response information.
+ *
+ * If crypto events are enqueued using a HW mechanism, the cryptodev
+ * PMD will use the event response information to set up the event
+ * that is enqueued back to eventdev after completion of the crypto
+ * operation. If the transfer is done by SW, event response information
+ * will be used by the adapter.
+ */
+union rte_event_crypto_metadata {
+	struct rte_event_crypto_request request_info;
+	/**< Request information to be filled in by application
+	 * for OP_FORWARD mode.
+	 */
+	struct rte_event response_info;
+	/**< Response information to be filled in by application
+	 * for OP_NEW and OP_FORWARD mode.
+	 */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * Adapter configuration structure that the adapter configuration callback
+ * function is expected to fill out
+ * @see rte_event_crypto_adapter_conf_cb
+ */
+struct rte_event_crypto_adapter_conf {
+	uint8_t event_port_id;
+	/**< Event port identifier, the adapter enqueues events to this
+	 * port and dequeues crypto request events in OP_FORWARD mode.
+	 */
+	uint32_t max_nb;
+	/**< The adapter can return early if it has processed at least
+	 * max_nb crypto ops. This isn't treated as a requirement; batching
+	 * may cause the adapter to process more than max_nb crypto ops.
+	 */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Function type used for adapter configuration callback. The callback is
+ * used to fill in members of the struct rte_event_crypto_adapter_conf, this
+ * callback is invoked when creating a SW service for packet transfer from
+ * cryptodev queue pair to the event device. The SW service is created within
+ * the rte_event_crypto_adapter_queue_pair_add() function if SW based packet
+ * transfers from cryptodev queue pair to the event device are required.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param dev_id
+ *  Event device identifier.
+ *
+ * @param conf
+ *  Structure that needs to be populated by this callback.
+ *
+ * @param arg
+ *  Argument to the callback. This is the same as the conf_arg passed to the
+ *  rte_event_crypto_adapter_create_ext().
+ */
+typedef int (*rte_event_crypto_adapter_conf_cb) (uint8_t id, uint8_t dev_id,
+			struct rte_event_crypto_adapter_conf *conf,
+			void *arg);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * A structure used to retrieve statistics for an event crypto adapter
+ * instance.
+ */
+
+struct rte_event_crypto_adapter_stats {
+	uint64_t event_poll_count;
+	/**< Event port poll count */
+	uint64_t event_deq_count;
+	/**< Event dequeue count */
+	uint64_t crypto_enq_count;
+	/**< Cryptodev enqueue count */
+	uint64_t crypto_enq_fail;
+	/**< Cryptodev enqueue failed count */
+	uint64_t crypto_deq_count;
+	/**< Cryptodev dequeue count */
+	uint64_t event_enq_count;
+	/**< Event enqueue count */
+	uint64_t event_enq_retry_count;
+	/**< Event enqueue retry count */
+	uint64_t event_enq_fail_count;
+	/**< Event enqueue fail count */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Create a new event crypto adapter with the specified identifier.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param dev_id
+ *  Event device identifier.
+ *
+ * @param conf_cb
+ *  Callback function that fills in members of a
+ *  struct rte_event_crypto_adapter_conf struct passed into
+ *  it.
+ *
+ * @param mode
+ *  Flag to indicate the mode of the adapter.
+ *  @see rte_event_crypto_adapter_mode
+ *
+ * @param conf_arg
+ *  Argument that is passed to the conf_cb function.
+ *
+ * @return
+ *   - 0: Success
+ *   - <0: Error code on failure
+ */
+int __rte_experimental
+rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id,
+				    rte_event_crypto_adapter_conf_cb conf_cb,
+				    enum rte_event_crypto_adapter_mode mode,
+				    void *conf_arg);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Create a new event crypto adapter with the specified identifier.
+ * This function uses an internal configuration function that creates an event
+ * port. This default function reconfigures the event device with an
+ * additional event port and set up the event port using the port_config
+ * parameter passed into this function. In case the application needs more
+ * control in configuration of the service, it should use the
+ * rte_event_crypto_adapter_create_ext() version.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param dev_id
+ *  Event device identifier.
+ *
+ * @param port_config
+ *  Argument of type *rte_event_port_conf* that is passed to the conf_cb
+ *  function.
+ *
+ * @param mode
+ *  Flag to indicate the mode of the adapter.
+ *  @see rte_event_crypto_adapter_mode
+ *
+ * @return
+ *   - 0: Success
+ *   - <0: Error code on failure
+ */
+int __rte_experimental
+rte_event_crypto_adapter_create(uint8_t id, uint8_t dev_id,
+				struct rte_event_port_conf *port_config,
+				enum rte_event_crypto_adapter_mode mode);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Free an event crypto adapter
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @return
+ *   - 0: Success
+ *   - <0: Error code on failure, If the adapter still has queue pairs
+ *      added to it, the function returns -EBUSY.
+ */
+int __rte_experimental
+rte_event_crypto_adapter_free(uint8_t id);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Add a queue pair to an event crypto adapter.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param cdev_id
+ *  Cryptodev identifier.
+ *
+ * @param queue_pair_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
+ *
+ * @return
+ *  - 0: Success, queue pair added correctly.
+ *  - <0: Error code on failure.
+ */
+int __rte_experimental
+rte_event_crypto_adapter_queue_pair_add(uint8_t id,
+			uint8_t cdev_id,
+			int32_t queue_pair_id,
+			const struct rte_event *event);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Delete a queue pair from an event crypto adapter.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param cdev_id
+ *  Cryptodev identifier.
+ *
+ * @param queue_pair_id
+ *  Cryptodev queue pair identifier.
+ *
+ * @return
+ *  - 0: Success, queue pair deleted successfully.
+ *  - <0: Error code on failure.
+ */
+int __rte_experimental
+rte_event_crypto_adapter_queue_pair_del(uint8_t id, uint8_t cdev_id,
+					int32_t queue_pair_id);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Start event crypto adapter
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ *
+ * @return
+ *  - 0: Success, adapter started successfully.
+ *  - <0: Error code on failure.
+ */
+int __rte_experimental
+rte_event_crypto_adapter_start(uint8_t id);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Stop event crypto adapter
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @return
+ *  - 0: Success, adapter stopped successfully.
+ *  - <0: Error code on failure.
+ */
+int __rte_experimental
+rte_event_crypto_adapter_stop(uint8_t id);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Retrieve statistics for an adapter
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param [out] stats
+ *  A pointer to structure used to retrieve statistics for an adapter.
+ *
+ * @return
+ *  - 0: Success, retrieved successfully.
+ *  - <0: Error code on failure.
+ */
+int __rte_experimental
+rte_event_crypto_adapter_stats_get(uint8_t id,
+				struct rte_event_crypto_adapter_stats *stats);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Reset statistics for an adapter.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @return
+ *  - 0: Success, statistics reset successfully.
+ *  - <0: Error code on failure.
+ */
+int __rte_experimental
+rte_event_crypto_adapter_stats_reset(uint8_t id);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Retrieve the service ID of an adapter. If the adapter doesn't use
+ * a rte_service function, this function returns -ESRCH.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param [out] service_id
+ *  A pointer to a uint32_t, to be filled in with the service id.
+ *
+ * @return
+ *  - 0: Success
+ *  - <0: Error code on failure, if the adapter doesn't use a rte_service
+ * function, this function returns -ESRCH.
+ */
+int __rte_experimental
+rte_event_crypto_adapter_service_id_get(uint8_t id, uint32_t *service_id);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Retrieve the event port of an adapter.
+ *
+ * @param id
+ *  Adapter identifier.
+ *
+ * @param [out] event_port_id
+ *  Application links its event queue to this adapter port which is used
+ *  in RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
+ *
+ * @return
+ *  - 0: Success
+ *  - <0: Error code on failure.
+ */
+int __rte_experimental
+rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
+
+#ifdef __cplusplus
+}
+#endif
+#endif	/* _RTE_EVENT_CRYPTO_ADAPTER_ */
-- 
1.9.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for crypto adapter
  2018-05-05 18:47 [dpdk-dev] [v3,0/5] eventdev: cover letter - crypto adapter Abhinandan Gujjar
  2018-05-05 18:47 ` [dpdk-dev] [v3,1/5] eventdev: introduce event " Abhinandan Gujjar
@ 2018-05-05 18:47 ` Abhinandan Gujjar
  2018-05-07  9:52   ` Jerin Jacob
  2018-05-07 15:28   ` Akhil Goyal
  2018-05-05 18:47 ` [dpdk-dev] [v3,3/5] eventdev: add crypto adapter implementation Abhinandan Gujjar
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 23+ messages in thread
From: Abhinandan Gujjar @ 2018-05-05 18:47 UTC (permalink / raw)
  To: jerin.jacob, hemant.agrawal, akhil.goyal, dev
  Cc: narender.vangati, abhinandan.gujjar, nikhil.rao, gage.eads

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 drivers/event/sw/sw_evdev.c            |  13 +++
 lib/librte_eventdev/rte_eventdev.c     |  25 +++++
 lib/librte_eventdev/rte_eventdev.h     |  54 ++++++++++
 lib/librte_eventdev/rte_eventdev_pmd.h | 187 +++++++++++++++++++++++++++++++++
 4 files changed, 279 insertions(+)

diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index dcb6551..10f0e1a 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -480,6 +480,17 @@
 	return 0;
 }
 
+static int
+sw_crypto_adapter_caps_get(const struct rte_eventdev *dev,
+			   const struct rte_cryptodev *cdev,
+			   uint32_t *caps)
+{
+	RTE_SET_USED(dev);
+	RTE_SET_USED(cdev);
+	*caps = RTE_EVENT_CRYPTO_ADAPTER_SW_CAP;
+	return 0;
+}
+
 static void
 sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info)
 {
@@ -809,6 +820,8 @@ static int32_t sw_sched_service_func(void *args)
 
 			.timer_adapter_caps_get = sw_timer_adapter_caps_get,
 
+			.crypto_adapter_caps_get = sw_crypto_adapter_caps_get,
+
 			.xstats_get = sw_xstats_get,
 			.xstats_get_names = sw_xstats_get_names,
 			.xstats_get_by_name = sw_xstats_get_by_name,
diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index 3f016f4..7ca9fd1 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -29,6 +29,8 @@
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_ethdev.h>
+#include <rte_cryptodev.h>
+#include <rte_cryptodev_pmd.h>
 
 #include "rte_eventdev.h"
 #include "rte_eventdev_pmd.h"
@@ -145,6 +147,29 @@
 				: 0;
 }
 
+int __rte_experimental
+rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id,
+				  uint32_t *caps)
+{
+	struct rte_eventdev *dev;
+	struct rte_cryptodev *cdev;
+
+	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id))
+		return -EINVAL;
+
+	dev = &rte_eventdevs[dev_id];
+	cdev = rte_cryptodev_pmd_get_dev(cdev_id);
+
+	if (caps == NULL)
+		return -EINVAL;
+	*caps = 0;
+
+	return dev->dev_ops->crypto_adapter_caps_get ?
+		(*dev->dev_ops->crypto_adapter_caps_get)
+		(dev, cdev, caps) : -ENOTSUP;
+}
+
 static inline int
 rte_event_dev_queue_config(struct rte_eventdev *dev, uint8_t nb_queues)
 {
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index 8297f24..551ffd2 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -8,6 +8,8 @@
 #ifndef _RTE_EVENTDEV_H_
 #define _RTE_EVENTDEV_H_
 
+#include <rte_compat.h>
+
 /**
  * @file
  *
@@ -1135,6 +1137,58 @@ struct rte_event {
 int __rte_experimental
 rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps);
 
+/* Crypto adapter capability bitmap flag */
+#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW   0x1
+/**< Flag indicates HW is capable of generating events in
+ * RTE_EVENT_OP_NEW enqueue operation. Cryptodev will send
+ * packets to the event device as new events using an internal
+ * event port.
+ */
+
+#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD   0x2
+/**< Flag indicates HW is capable of generating events in
+ * RTE_EVENT_OP_FWD enqueue operation. Cryptodev will send
+ * packets to the event device as forwarded event using an
+ * internal event port.
+ */
+
+#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND  0x4
+/**< Flag indicates HW is capable of mapping crypto queue pair to
+ * event queue.
+ */
+
+#define RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA   0x8
+/**< Flag indicates HW/SW suports a mechanism to store and retrieve
+ * the private data information along with the crypto session.
+ */
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Retrieve the event device's crypto adapter capabilities for the
+ * specified cryptodev device
+ *
+ * @param dev_id
+ *   The identifier of the device.
+ *
+ * @param cdev_id
+ *   The identifier of the cryptodev device.
+ *
+ * @param[out] caps
+ *   A pointer to memory filled with event adapter capabilities.
+ *   It is expected to be pre-allocated & initialized by caller.
+ *
+ * @return
+ *   - 0: Success, driver provides event adapter capabilities for the
+ *     cryptodev device.
+ *   - <0: Error code returned by the driver function.
+ *
+ */
+int __rte_experimental
+rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id,
+				  uint32_t *caps);
+
 struct rte_eventdev_ops;
 struct rte_eventdev;
 
diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h
index 2dcb528..3fbb4d2 100644
--- a/lib/librte_eventdev/rte_eventdev_pmd.h
+++ b/lib/librte_eventdev/rte_eventdev_pmd.h
@@ -70,6 +70,9 @@
 		((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \
 			(RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ))
 
+#define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \
+		RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA
+
 /**< Ethernet Rx adapter cap to return If the packet transfers from
  * the ethdev to eventdev use a SW service function
  */
@@ -617,6 +620,175 @@ typedef int (*eventdev_eth_rx_adapter_stats_reset)
  */
 typedef int (*eventdev_selftest)(void);
 
+
+struct rte_cryptodev;
+
+/**
+ * This API may change without prior notice
+ *
+ * Retrieve the event device's crypto adapter capabilities for the
+ * specified cryptodev
+ *
+ * @param dev
+ *   Event device pointer
+ *
+ * @param cdev
+ *   cryptodev pointer
+ *
+ * @param[out] caps
+ *   A pointer to memory filled with event adapter capabilities.
+ *   It is expected to be pre-allocated & initialized by caller.
+ *
+ * @return
+ *   - 0: Success, driver provides event adapter capabilities for the
+ *	cryptodev.
+ *   - <0: Error code returned by the driver function.
+ *
+ */
+typedef int (*eventdev_crypto_adapter_caps_get_t)
+					(const struct rte_eventdev *dev,
+					 const struct rte_cryptodev *cdev,
+					 uint32_t *caps);
+
+/**
+ * This API may change without prior notice
+ *
+ * Add crypto queue pair to event device. This callback is invoked if
+ * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
+ * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
+ *
+ * @param dev
+ *   Event device pointer
+ *
+ * @param cdev
+ *   cryptodev pointer
+ *
+ * @param queue_pair_id
+ *   cryptodev queue pair identifier.
+ *
+ * @param event
+ *  Event information required for binding cryptodev queue pair to event queue.
+ *  This structure will have a valid value for only those HW PMDs supporting
+ *  @see RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND capability.
+ *
+ * @return
+ *   - 0: Success, cryptodev queue pair added successfully.
+ *   - <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);
+
+
+/**
+ * This API may change without prior notice
+ *
+ * Delete crypto queue pair to event device. This callback is invoked if
+ * the caps returned from rte_event_crypto_adapter_caps_get(, cdev_id)
+ * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set.
+ *
+ * @param dev
+ *   Event device pointer
+ *
+ * @param cdev
+ *   cryptodev pointer
+ *
+ * @param queue_pair_id
+ *   cryptodev queue pair identifier.
+ *
+ * @return
+ *   - 0: Success, cryptodev queue pair deleted successfully.
+ *   - <0: Error code returned by the driver function.
+ *
+ */
+typedef int (*eventdev_crypto_adapter_queue_pair_del_t)
+					(const struct rte_eventdev *dev,
+					 const struct rte_cryptodev *cdev,
+					 int32_t queue_pair_id);
+
+/**
+ * Start crypto adapter. This callback is invoked if
+ * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
+ * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
+ * from cdev_id have been added to the event device.
+ *
+ * @param dev
+ *   Event device pointer
+ *
+ * @param cdev
+ *   Crypto device pointer
+ *
+ * @return
+ *   - 0: Success, crypto adapter started successfully.
+ *   - <0: Error code returned by the driver function.
+ */
+typedef int (*eventdev_crypto_adapter_start_t)
+					(const struct rte_eventdev *dev,
+					 const struct rte_cryptodev *cdev);
+
+/**
+ * Stop crypto adapter. This callback is invoked if
+ * the caps returned from rte_event_crypto_adapter_caps_get(.., cdev_id)
+ * has RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_* set and queue pairs
+ * from cdev_id have been added to the event device.
+ *
+ * @param dev
+ *   Event device pointer
+ *
+ * @param cdev
+ *   Crypto device pointer
+ *
+ * @return
+ *   - 0: Success, crypto adapter stopped successfully.
+ *   - <0: Error code returned by the driver function.
+ */
+typedef int (*eventdev_crypto_adapter_stop_t)
+					(const struct rte_eventdev *dev,
+					 const struct rte_cryptodev *cdev);
+
+struct rte_event_crypto_adapter_stats;
+
+/**
+ * Retrieve crypto adapter statistics.
+ *
+ * @param dev
+ *   Event device pointer
+ *
+ * @param cdev
+ *   Crypto device pointer
+ *
+ * @param[out] stats
+ *   Pointer to stats structure
+ *
+ * @return
+ *   Return 0 on success.
+ */
+
+typedef int (*eventdev_crypto_adapter_stats_get)
+			(const struct rte_eventdev *dev,
+			 const struct rte_cryptodev *cdev,
+			 struct rte_event_crypto_adapter_stats *stats);
+
+/**
+ * Reset crypto adapter statistics.
+ *
+ * @param dev
+ *   Event device pointer
+ *
+ * @param cdev
+ *   Crypto device pointer
+ *
+ * @return
+ *   Return 0 on success.
+ */
+
+typedef int (*eventdev_crypto_adapter_stats_reset)
+			(const struct rte_eventdev *dev,
+			 const struct rte_cryptodev *cdev);
+
 /** Event device operations function pointer table */
 struct rte_eventdev_ops {
 	eventdev_info_get_t dev_infos_get;	/**< Get device info. */
@@ -675,6 +847,21 @@ struct rte_eventdev_ops {
 	eventdev_timer_adapter_caps_get_t timer_adapter_caps_get;
 	/**< Get timer adapter capabilities */
 
+	eventdev_crypto_adapter_caps_get_t crypto_adapter_caps_get;
+	/**< Get crypto adapter capabilities */
+	eventdev_crypto_adapter_queue_pair_add_t crypto_adapter_queue_pair_add;
+	/**< Add queue pair to crypto adapter */
+	eventdev_crypto_adapter_queue_pair_del_t crypto_adapter_queue_pair_del;
+	/**< Delete queue pair from crypto adapter */
+	eventdev_crypto_adapter_start_t crypto_adapter_start;
+	/**< Start crypto adapter */
+	eventdev_crypto_adapter_stop_t crypto_adapter_stop;
+	/**< Stop crypto adapter */
+	eventdev_crypto_adapter_stats_get crypto_adapter_stats_get;
+	/**< Get crypto stats */
+	eventdev_crypto_adapter_stats_reset crypto_adapter_stats_reset;
+	/**< Reset crypto stats */
+
 	eventdev_selftest dev_selftest;
 	/**< Start eventdev Selftest */
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [v3,3/5] eventdev: add crypto adapter implementation
  2018-05-05 18:47 [dpdk-dev] [v3,0/5] eventdev: cover letter - crypto adapter Abhinandan Gujjar
  2018-05-05 18:47 ` [dpdk-dev] [v3,1/5] eventdev: introduce event " Abhinandan Gujjar
  2018-05-05 18:47 ` [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for " Abhinandan Gujjar
@ 2018-05-05 18:47 ` Abhinandan Gujjar
  2018-05-07  4:58   ` [dpdk-dev] [v3, 3/5] " Jerin Jacob
  2018-05-07  6:50   ` Jerin Jacob
  2018-05-05 18:47 ` [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test Abhinandan Gujjar
  2018-05-05 18:47 ` [dpdk-dev] [v3,5/5] doc: add event crypto adapter documentation Abhinandan Gujjar
  4 siblings, 2 replies; 23+ messages in thread
From: Abhinandan Gujjar @ 2018-05-05 18:47 UTC (permalink / raw)
  To: jerin.jacob, hemant.agrawal, akhil.goyal, dev
  Cc: narender.vangati, abhinandan.gujjar, nikhil.rao, gage.eads

Event crypto adapter is added to the meson build system

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Signed-off-by: Gage Eads <gage.eads@intel.com>
---
 config/common_base                             |    1 +
 lib/Makefile                                   |    3 +-
 lib/librte_eventdev/Makefile                   |    3 +
 lib/librte_eventdev/meson.build                |    8 +-
 lib/librte_eventdev/rte_event_crypto_adapter.c | 1127 ++++++++++++++++++++++++
 lib/librte_eventdev/rte_eventdev_version.map   |   12 +
 6 files changed, 1150 insertions(+), 4 deletions(-)
 create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.c

diff --git a/config/common_base b/config/common_base
index 03a8688..8420d29 100644
--- a/config/common_base
+++ b/config/common_base
@@ -577,6 +577,7 @@ CONFIG_RTE_LIBRTE_EVENTDEV_DEBUG=n
 CONFIG_RTE_EVENT_MAX_DEVS=16
 CONFIG_RTE_EVENT_MAX_QUEUES_PER_DEV=64
 CONFIG_RTE_EVENT_TIMER_ADAPTER_NUM_MAX=32
+CONFIG_RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE=32
 
 #
 # Compile PMD for skeleton event device
diff --git a/lib/Makefile b/lib/Makefile
index 057bf78..efddee0 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -32,7 +32,8 @@ DEPDIRS-librte_security := librte_eal librte_mempool librte_ring librte_mbuf
 DEPDIRS-librte_security += librte_ethdev
 DEPDIRS-librte_security += librte_cryptodev
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += librte_eventdev
-DEPDIRS-librte_eventdev := librte_eal librte_ring librte_ethdev librte_hash librte_mempool librte_timer
+DEPDIRS-librte_eventdev := librte_eal librte_ring librte_ether librte_hash \
+                           librte_mempool librte_timer librte_cryptodev
 DIRS-$(CONFIG_RTE_LIBRTE_RAWDEV) += librte_rawdev
 DEPDIRS-librte_rawdev := librte_eal librte_ethdev
 DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += librte_vhost
diff --git a/lib/librte_eventdev/Makefile b/lib/librte_eventdev/Makefile
index 297df4a..804b036 100644
--- a/lib/librte_eventdev/Makefile
+++ b/lib/librte_eventdev/Makefile
@@ -15,12 +15,14 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 LDLIBS += -lrte_eal -lrte_ring -lrte_ethdev -lrte_hash -lrte_mempool -lrte_timer
+LDLIBS += -lrte_cryptodev -lrte_mempool
 
 # library source files
 SRCS-y += rte_eventdev.c
 SRCS-y += rte_event_ring.c
 SRCS-y += rte_event_eth_rx_adapter.c
 SRCS-y += rte_event_timer_adapter.c
+SRCS-y += rte_event_crypto_adapter.c
 
 # export include files
 SYMLINK-y-include += rte_eventdev.h
@@ -31,6 +33,7 @@ SYMLINK-y-include += rte_event_ring.h
 SYMLINK-y-include += rte_event_eth_rx_adapter.h
 SYMLINK-y-include += rte_event_timer_adapter.h
 SYMLINK-y-include += rte_event_timer_adapter_pmd.h
+SYMLINK-y-include += rte_event_crypto_adapter.h
 
 # versioning export map
 EXPORT_MAP := rte_eventdev_version.map
diff --git a/lib/librte_eventdev/meson.build b/lib/librte_eventdev/meson.build
index 232b870..df9be41 100644
--- a/lib/librte_eventdev/meson.build
+++ b/lib/librte_eventdev/meson.build
@@ -6,7 +6,8 @@ allow_experimental_apis = true
 sources = files('rte_eventdev.c',
 		'rte_event_ring.c',
 		'rte_event_eth_rx_adapter.c',
-		'rte_event_timer_adapter.c')
+		'rte_event_timer_adapter.c',
+		'rte_event_crypto_adapter.c')
 headers = files('rte_eventdev.h',
 		'rte_eventdev_pmd.h',
 		'rte_eventdev_pmd_pci.h',
@@ -14,5 +15,6 @@ headers = files('rte_eventdev.h',
 		'rte_event_ring.h',
 		'rte_event_eth_rx_adapter.h',
 		'rte_event_timer_adapter.h',
-		'rte_event_timer_adapter_pmd.h')
-deps += ['ring', 'ethdev', 'hash', 'mempool', 'timer']
+		'rte_event_timer_adapter_pmd.h',
+		'rte_event_crypto_adapter.h')
+deps += ['ring', 'ethdev', 'hash', 'mempool', 'timer', 'cryptodev']
diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.c b/lib/librte_eventdev/rte_event_crypto_adapter.c
new file mode 100644
index 0000000..a93219e
--- /dev/null
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.c
@@ -0,0 +1,1127 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017-2018 Intel Corporation
+ */
+
+#include <string.h>
+#include <stdbool.h>
+#include <rte_common.h>
+#include <rte_dev.h>
+#include <rte_errno.h>
+#include <rte_cryptodev.h>
+#include <rte_cryptodev_pmd.h>
+#include <rte_log.h>
+#include <rte_malloc.h>
+#include <rte_service_component.h>
+
+#include "rte_eventdev.h"
+#include "rte_eventdev_pmd.h"
+#include "rte_event_crypto_adapter.h"
+
+#define BATCH_SIZE 32
+#define DEFAULT_MAX_NB 128
+#define CRYPTO_ADAPTER_NAME_LEN 32
+#define CRYPTO_ADAPTER_MEM_NAME_LEN 32
+#define CRYPTO_ADAPTER_MAX_EV_ENQ_RETRIES 100
+
+/* Flush an instance's enqueue buffers every CRYPTO_ENQ_FLUSH_THRESHOLD
+ * iterations of eca_crypto_adapter_enq_run()
+ */
+#define CRYPTO_ENQ_FLUSH_THRESHOLD 1024
+
+struct rte_event_crypto_adapter {
+	/* Event device identifier */
+	uint8_t eventdev_id;
+	/* Event port identifier */
+	uint8_t event_port_id;
+	/* Store event device's implicit release capability */
+	uint8_t implicit_release_disabled;
+	/* Max crypto ops processed in any service function invocation */
+	uint32_t max_nb;
+	/* Lock to serialize config updates with service function */
+	rte_spinlock_t lock;
+	/* Next crypto device to be processed */
+	uint16_t next_cdev_id;
+	/* Per crypto device structure */
+	struct crypto_device_info *cdevs;
+	/* Loop counter to flush crypto ops */
+	uint16_t transmit_loop_count;
+	/* Per instance stats structure */
+	struct rte_event_crypto_adapter_stats crypto_stats;
+	/* Configuration callback for rte_service configuration */
+	rte_event_crypto_adapter_conf_cb conf_cb;
+	/* Configuration callback argument */
+	void *conf_arg;
+	/* Set if  default_cb is being used */
+	int default_cb_arg;
+	/* Service initialization state */
+	uint8_t service_inited;
+	/* Memory allocation name */
+	char mem_name[CRYPTO_ADAPTER_MEM_NAME_LEN];
+	/* Socket identifier cached from eventdev */
+	int socket_id;
+	/* Per adapter EAL service */
+	uint32_t service_id;
+	/* No. of queue pairs configured */
+	uint16_t nb_qps;
+	/* Adapter mode */
+	enum rte_event_crypto_adapter_mode mode;
+} __rte_cache_aligned;
+
+/* Per crypto device information */
+struct crypto_device_info {
+	/* Pointer to cryptodev */
+	struct rte_cryptodev *dev;
+	/* Pointer to queue pair info */
+	struct crypto_queue_pair_info *qpairs;
+	/* Next queue pair to be processed */
+	uint16_t next_queue_pair_id;
+	/* Set to indicate cryptodev->eventdev packet
+	 * transfer uses a hardware mechanism
+	 */
+	uint8_t internal_event_port;
+	/* Set to indicate processing has been started */
+	uint8_t dev_started;
+	/* If num_qpairs > 0, the start callback will
+	 * be invoked if not already invoked
+	 */
+	uint16_t num_qpairs;
+} __rte_cache_aligned;
+
+/* Per queue pair information */
+struct crypto_queue_pair_info {
+	/* Set to indicate queue pair is enabled */
+	bool qp_enabled;
+	/* Pointer to hold rte_crypto_ops for batching */
+	struct rte_crypto_op **op_buffer;
+	/* No of crypto ops accumulated */
+	uint8_t len;
+} __rte_cache_aligned;
+
+static struct rte_event_crypto_adapter **event_crypto_adapter;
+
+/* Macros to check for valid adapter */
+#define RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \
+	if (!eca_valid_id(id)) { \
+		RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d\n", id); \
+		return retval; \
+	} \
+} while (0)
+
+static inline int
+eca_valid_id(uint8_t id)
+{
+	return id < RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE;
+}
+
+static int
+eca_init(void)
+{
+	const char *name = "crypto_adapter_array";
+	const struct rte_memzone *mz;
+	unsigned int sz;
+
+	sz = sizeof(*event_crypto_adapter) *
+	    RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE;
+	sz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE);
+
+	mz = rte_memzone_lookup(name);
+	if (mz == NULL) {
+		mz = rte_memzone_reserve_aligned(name, sz, rte_socket_id(), 0,
+						 RTE_CACHE_LINE_SIZE);
+		if (mz == NULL) {
+			RTE_EDEV_LOG_ERR("failed to reserve memzone err = %"
+					PRId32, rte_errno);
+			return -rte_errno;
+		}
+	}
+
+	event_crypto_adapter = mz->addr;
+	return 0;
+}
+
+static inline struct rte_event_crypto_adapter *
+eca_id_to_adapter(uint8_t id)
+{
+	return event_crypto_adapter ?
+		event_crypto_adapter[id] : NULL;
+}
+
+static int
+eca_default_config_cb(uint8_t id, uint8_t dev_id,
+			struct rte_event_crypto_adapter_conf *conf, void *arg)
+{
+	struct rte_event_dev_config dev_conf;
+	struct rte_eventdev *dev;
+	uint8_t port_id;
+	int started;
+	int ret;
+	struct rte_event_port_conf *port_conf = arg;
+	struct rte_event_crypto_adapter *adapter = eca_id_to_adapter(id);
+
+	dev = &rte_eventdevs[adapter->eventdev_id];
+	dev_conf = dev->data->dev_conf;
+
+	started = dev->data->dev_started;
+	if (started)
+		rte_event_dev_stop(dev_id);
+	port_id = dev_conf.nb_event_ports;
+	dev_conf.nb_event_ports += 1;
+	ret = rte_event_dev_configure(dev_id, &dev_conf);
+	if (ret) {
+		RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", dev_id);
+		if (started) {
+			if (rte_event_dev_start(dev_id))
+				return -EIO;
+		}
+		return ret;
+	}
+
+	ret = rte_event_port_setup(dev_id, port_id, port_conf);
+	if (ret) {
+		RTE_EDEV_LOG_ERR("failed to setup event port %u\n", port_id);
+		return ret;
+	}
+
+	conf->event_port_id = port_id;
+	conf->max_nb = DEFAULT_MAX_NB;
+	if (started)
+		ret = rte_event_dev_start(dev_id);
+
+	adapter->default_cb_arg = 1;
+	return ret;
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id,
+				rte_event_crypto_adapter_conf_cb conf_cb,
+				enum rte_event_crypto_adapter_mode mode,
+				void *conf_arg)
+{
+	struct rte_event_crypto_adapter *adapter;
+	char mem_name[CRYPTO_ADAPTER_NAME_LEN];
+	struct rte_event_dev_info dev_info;
+	int socket_id;
+	uint8_t i;
+	int ret;
+
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+	if (conf_cb == NULL)
+		return -EINVAL;
+
+	if (event_crypto_adapter == NULL) {
+		ret = eca_init();
+		if (ret)
+			return ret;
+	}
+
+	adapter = eca_id_to_adapter(id);
+	if (adapter != NULL) {
+		RTE_EDEV_LOG_ERR("Crypto adapter id %u already exists!", id);
+		return -EEXIST;
+	}
+
+	socket_id = rte_event_dev_socket_id(dev_id);
+	snprintf(mem_name, CRYPTO_ADAPTER_MEM_NAME_LEN,
+		 "rte_event_crypto_adapter_%d", id);
+
+	adapter = rte_zmalloc_socket(mem_name, sizeof(*adapter),
+			RTE_CACHE_LINE_SIZE, socket_id);
+	if (adapter == NULL) {
+		RTE_EDEV_LOG_ERR("Failed to get mem for event crypto adapter!");
+		return -ENOMEM;
+	}
+
+	ret = rte_event_dev_info_get(dev_id, &dev_info);
+	if (ret < 0) {
+		RTE_EDEV_LOG_ERR("Failed to get info for eventdev %d: %s!",
+				 dev_id, dev_info.driver_name);
+		return ret;
+	}
+
+	adapter->implicit_release_disabled = (dev_info.event_dev_cap &
+			RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE);
+	adapter->eventdev_id = dev_id;
+	adapter->socket_id = socket_id;
+	adapter->conf_cb = conf_cb;
+	adapter->conf_arg = conf_arg;
+	adapter->mode = mode;
+	strcpy(adapter->mem_name, mem_name);
+	adapter->cdevs = rte_zmalloc_socket(adapter->mem_name,
+					rte_cryptodev_count() *
+					sizeof(struct crypto_device_info), 0,
+					socket_id);
+	if (adapter->cdevs == NULL) {
+		RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices\n");
+		rte_free(adapter);
+		return -ENOMEM;
+	}
+
+	rte_spinlock_init(&adapter->lock);
+	for (i = 0; i < rte_cryptodev_count(); i++)
+		adapter->cdevs[i].dev = rte_cryptodev_pmd_get_dev(i);
+
+	event_crypto_adapter[id] = adapter;
+
+	return 0;
+}
+
+
+int __rte_experimental
+rte_event_crypto_adapter_create(uint8_t id, uint8_t dev_id,
+				struct rte_event_port_conf *port_config,
+				enum rte_event_crypto_adapter_mode mode)
+{
+	struct rte_event_port_conf *pc;
+	int ret;
+
+	if (port_config == NULL)
+		return -EINVAL;
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	pc = rte_malloc(NULL, sizeof(*pc), 0);
+	if (pc == NULL)
+		return -ENOMEM;
+	*pc = *port_config;
+	ret = rte_event_crypto_adapter_create_ext(id, dev_id,
+						  eca_default_config_cb,
+						  mode,
+						  pc);
+	if (ret)
+		rte_free(pc);
+
+	return ret;
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_free(uint8_t id)
+{
+	struct rte_event_crypto_adapter *adapter;
+
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	adapter = eca_id_to_adapter(id);
+	if (adapter == NULL)
+		return -EINVAL;
+
+	if (adapter->nb_qps) {
+		RTE_EDEV_LOG_ERR("%" PRIu16 "Queue pairs not deleted",
+				adapter->nb_qps);
+		return -EBUSY;
+	}
+
+	if (adapter->default_cb_arg)
+		rte_free(adapter->conf_arg);
+	rte_free(adapter->cdevs);
+	rte_free(adapter);
+	event_crypto_adapter[id] = NULL;
+
+	return 0;
+}
+
+static inline unsigned int
+eca_enq_to_cryptodev(struct rte_event_crypto_adapter *adapter,
+		 struct rte_event *ev, unsigned int cnt)
+{
+	struct rte_event_crypto_adapter_stats *stats = &adapter->crypto_stats;
+	union rte_event_crypto_metadata *m_data = NULL;
+	struct crypto_queue_pair_info *qp_info = NULL;
+	struct rte_crypto_op *crypto_op;
+	unsigned int i, n;
+	uint16_t qp_id, len, ret;
+	uint8_t cdev_id;
+
+	len = 0;
+	ret = 0;
+	n = 0;
+	stats->event_deq_count += cnt;
+
+	for (i = 0; i < cnt; i++) {
+		crypto_op = ev[i].event_ptr;
+		if (crypto_op == NULL)
+			continue;
+		if (crypto_op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
+			m_data = rte_cryptodev_sym_session_get_private_data(
+					crypto_op->sym->session);
+			if (m_data == NULL) {
+				rte_pktmbuf_free(crypto_op->sym->m_src);
+				rte_crypto_op_free(crypto_op);
+				continue;
+			}
+
+			cdev_id = m_data->request_info.cdev_id;
+			qp_id = m_data->request_info.queue_pair_id;
+			qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
+			if (qp_info == NULL) {
+				rte_pktmbuf_free(crypto_op->sym->m_src);
+				rte_crypto_op_free(crypto_op);
+				continue;
+			}
+			len = qp_info->len;
+			qp_info->op_buffer[len] = crypto_op;
+			len++;
+		} else if (crypto_op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
+				crypto_op->private_data_offset) {
+			m_data = (union rte_event_crypto_metadata *)
+				 ((uint8_t *)crypto_op +
+					crypto_op->private_data_offset);
+			cdev_id = m_data->request_info.cdev_id;
+			qp_id = m_data->request_info.queue_pair_id;
+			qp_info = &adapter->cdevs[cdev_id].qpairs[qp_id];
+			if (qp_info == NULL) {
+				rte_pktmbuf_free(crypto_op->sym->m_src);
+				rte_crypto_op_free(crypto_op);
+				continue;
+			}
+			len = qp_info->len;
+			qp_info->op_buffer[len] = crypto_op;
+			len++;
+		} else {
+			rte_pktmbuf_free(crypto_op->sym->m_src);
+			rte_crypto_op_free(crypto_op);
+			continue;
+		}
+
+		if (len == BATCH_SIZE) {
+			struct rte_crypto_op **op_buffer = qp_info->op_buffer;
+			ret = rte_cryptodev_enqueue_burst(cdev_id,
+							  qp_id,
+							  op_buffer,
+							  BATCH_SIZE);
+
+			stats->crypto_enq_count += ret;
+
+			while (ret < len) {
+				struct rte_crypto_op *op;
+				op = op_buffer[ret++];
+				stats->crypto_enq_fail++;
+				rte_pktmbuf_free(op->sym->m_src);
+				rte_crypto_op_free(op);
+			}
+
+			len = 0;
+		}
+
+		if (qp_info)
+			qp_info->len = len;
+		n += ret;
+	}
+
+	return n;
+}
+
+static unsigned int
+eca_crypto_enq_flush(struct rte_event_crypto_adapter *adapter)
+{
+	struct rte_event_crypto_adapter_stats *stats = &adapter->crypto_stats;
+	struct crypto_device_info *curr_dev;
+	struct crypto_queue_pair_info *curr_queue;
+	struct rte_crypto_op **op_buffer;
+	struct rte_cryptodev *dev;
+	uint8_t cdev_id;
+	uint16_t qp;
+	uint16_t ret;
+	uint16_t num_cdev = rte_cryptodev_count();
+
+	ret = 0;
+	for (cdev_id = 0; cdev_id < num_cdev; cdev_id++) {
+		curr_dev = &adapter->cdevs[cdev_id];
+		if (curr_dev == NULL)
+			continue;
+		dev = curr_dev->dev;
+
+		for (qp = 0; qp < dev->data->nb_queue_pairs; qp++) {
+
+			curr_queue = &curr_dev->qpairs[qp];
+			if (!curr_queue->qp_enabled)
+				continue;
+
+			op_buffer = curr_queue->op_buffer;
+			ret = rte_cryptodev_enqueue_burst(cdev_id,
+							  qp,
+							  op_buffer,
+							  curr_queue->len);
+			stats->crypto_enq_count += ret;
+
+			while (ret < curr_queue->len) {
+				struct rte_crypto_op *op;
+				op = op_buffer[ret++];
+				stats->crypto_enq_fail++;
+				rte_pktmbuf_free(op->sym->m_src);
+				rte_crypto_op_free(op);
+			}
+			curr_queue->len = 0;
+		}
+	}
+
+	return ret;
+}
+
+static int
+eca_crypto_adapter_enq_run(struct rte_event_crypto_adapter *adapter,
+			unsigned int max_enq)
+{
+	struct rte_event_crypto_adapter_stats *stats = &adapter->crypto_stats;
+	struct rte_event ev[BATCH_SIZE];
+	unsigned int nb_enq, nb_enqueued;
+	uint16_t n;
+	uint8_t event_dev_id = adapter->eventdev_id;
+	uint8_t event_port_id = adapter->event_port_id;
+
+	nb_enqueued = 0;
+	if (adapter->mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW)
+		return 0;
+
+	for (nb_enq = 0; nb_enq < max_enq; nb_enq += n) {
+		stats->event_poll_count++;
+		n = rte_event_dequeue_burst(event_dev_id,
+					    event_port_id, ev, BATCH_SIZE, 0);
+
+		if (!n)
+			break;
+
+		nb_enqueued += eca_enq_to_cryptodev(adapter, ev, n);
+	}
+
+	if ((++adapter->transmit_loop_count &
+		(CRYPTO_ENQ_FLUSH_THRESHOLD - 1)) == 0) {
+		nb_enqueued += eca_crypto_enq_flush(adapter);
+	}
+
+	return nb_enqueued;
+}
+
+static inline void
+eca_ops_enqueue_burst(struct rte_event_crypto_adapter *adapter,
+		  struct rte_crypto_op **ops, uint16_t num)
+{
+	struct rte_event_crypto_adapter_stats *stats = &adapter->crypto_stats;
+	union rte_event_crypto_metadata *m_data = NULL;
+	uint8_t event_dev_id = adapter->eventdev_id;
+	uint8_t event_port_id = adapter->event_port_id;
+	struct rte_event events[BATCH_SIZE];
+	uint16_t nb_enqueued, nb_ev;
+	uint8_t retry;
+	uint8_t i;
+
+	nb_ev = 0;
+	retry = 0;
+	nb_enqueued = 0;
+	num = RTE_MIN(num, BATCH_SIZE);
+	for (i = 0; i < num; i++) {
+		struct rte_event *ev = &events[nb_ev++];
+		if (ops[i]->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
+			m_data = rte_cryptodev_sym_session_get_private_data(
+					ops[i]->sym->session);
+		} else if (ops[i]->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
+				ops[i]->private_data_offset) {
+			m_data = (union rte_event_crypto_metadata *)
+				 ((uint8_t *)ops[i] +
+				  ops[i]->private_data_offset);
+		}
+
+		if (unlikely(m_data == NULL)) {
+			rte_pktmbuf_free(ops[i]->sym->m_src);
+			rte_crypto_op_free(ops[i]);
+			continue;
+		}
+
+		rte_memcpy(ev, &m_data->response_info, sizeof(ev));
+		ev->event_ptr = ops[i];
+		ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
+		if (adapter->implicit_release_disabled)
+			ev->op = RTE_EVENT_OP_FORWARD;
+		else
+			ev->op = RTE_EVENT_OP_NEW;
+	}
+
+	do {
+		nb_enqueued += rte_event_enqueue_burst(event_dev_id,
+						  event_port_id,
+						  &events[nb_enqueued],
+						  nb_ev - nb_enqueued);
+	} while (retry++ < CRYPTO_ADAPTER_MAX_EV_ENQ_RETRIES &&
+		 nb_enqueued < nb_ev);
+
+	/* Free mbufs and rte_crypto_ops for failed events */
+	for (i = nb_enqueued; i < nb_ev; i++) {
+		struct rte_crypto_op *op = events[i].event_ptr;
+		rte_pktmbuf_free(op->sym->m_src);
+		rte_crypto_op_free(op);
+	}
+
+	stats->event_enq_fail_count += nb_ev - nb_enqueued;
+	stats->event_enq_count += nb_enqueued;
+	stats->event_enq_retry_count += retry - 1;
+}
+
+static inline unsigned int
+eca_crypto_adapter_deq_run(struct rte_event_crypto_adapter *adapter,
+			unsigned int max_deq)
+{
+	struct rte_event_crypto_adapter_stats *stats = &adapter->crypto_stats;
+	struct crypto_device_info *curr_dev;
+	struct crypto_queue_pair_info *curr_queue;
+	struct rte_crypto_op *ops[BATCH_SIZE];
+	uint16_t n, nb_deq;
+	struct rte_cryptodev *dev;
+	uint8_t cdev_id;
+	uint16_t qp, dev_qps;
+	bool done;
+	uint16_t num_cdev = rte_cryptodev_count();
+
+	nb_deq = 0;
+	do {
+		uint16_t queues = 0;
+		done = true;
+
+		for (cdev_id = adapter->next_cdev_id;
+			cdev_id < num_cdev; cdev_id++) {
+			curr_dev = &adapter->cdevs[cdev_id];
+			if (curr_dev == NULL)
+				continue;
+			dev = curr_dev->dev;
+			dev_qps = dev->data->nb_queue_pairs;
+
+			for (qp = curr_dev->next_queue_pair_id;
+				queues < dev_qps; qp = (qp + 1) % dev_qps,
+				queues++) {
+
+				curr_queue = &curr_dev->qpairs[qp];
+				if (!curr_queue->qp_enabled)
+					continue;
+
+				n = rte_cryptodev_dequeue_burst(cdev_id, qp,
+					ops, BATCH_SIZE);
+				if (!n)
+					continue;
+
+				done = false;
+				stats->crypto_deq_count += n;
+				eca_ops_enqueue_burst(adapter, ops, n);
+				nb_deq += n;
+
+				if (nb_deq > max_deq) {
+					if ((qp + 1) == dev_qps) {
+						adapter->next_cdev_id =
+							(cdev_id + 1)
+							% num_cdev;
+					}
+					curr_dev->next_queue_pair_id = (qp + 1)
+						% dev->data->nb_queue_pairs;
+
+					return nb_deq;
+				}
+			}
+		}
+	} while (done == false);
+	return nb_deq;
+}
+
+static void
+eca_crypto_adapter_run(struct rte_event_crypto_adapter *adapter,
+			unsigned int max_ops)
+{
+	while (max_ops) {
+		unsigned int e_cnt, d_cnt;
+
+		e_cnt = eca_crypto_adapter_deq_run(adapter, max_ops);
+		max_ops -= RTE_MIN(max_ops, e_cnt);
+
+		d_cnt = eca_crypto_adapter_enq_run(adapter, max_ops);
+		max_ops -= RTE_MIN(max_ops, d_cnt);
+
+		if (e_cnt == 0 && d_cnt == 0)
+			break;
+
+	}
+}
+
+static int
+eca_service_func(void *args)
+{
+	struct rte_event_crypto_adapter *adapter = args;
+
+	if (rte_spinlock_trylock(&adapter->lock) == 0)
+		return 0;
+	eca_crypto_adapter_run(adapter, adapter->max_nb);
+	rte_spinlock_unlock(&adapter->lock);
+
+	return 0;
+}
+
+static int
+eca_init_service(struct rte_event_crypto_adapter *adapter, uint8_t id)
+{
+	struct rte_event_crypto_adapter_conf adapter_conf;
+	struct rte_service_spec service;
+	int ret;
+
+	if (adapter->service_inited)
+		return 0;
+
+	memset(&service, 0, sizeof(service));
+	snprintf(service.name, CRYPTO_ADAPTER_NAME_LEN,
+		"rte_event_crypto_adapter_%d", id);
+	service.socket_id = adapter->socket_id;
+	service.callback = eca_service_func;
+	service.callback_userdata = adapter;
+	/* Service function handles locking for queue add/del updates */
+	service.capabilities = RTE_SERVICE_CAP_MT_SAFE;
+	ret = rte_service_component_register(&service, &adapter->service_id);
+	if (ret) {
+		RTE_EDEV_LOG_ERR("failed to register service %s err = %" PRId32,
+			service.name, ret);
+		return ret;
+	}
+
+	ret = adapter->conf_cb(id, adapter->eventdev_id,
+		&adapter_conf, adapter->conf_arg);
+	if (ret) {
+		RTE_EDEV_LOG_ERR("configuration callback failed err = %" PRId32,
+			ret);
+		return ret;
+	}
+
+	adapter->max_nb = adapter_conf.max_nb;
+	adapter->event_port_id = adapter_conf.event_port_id;
+	adapter->service_inited = 1;
+
+	return ret;
+}
+
+static void
+eca_update_qp_info(struct rte_event_crypto_adapter *adapter,
+			struct crypto_device_info *dev_info,
+			int32_t queue_pair_id,
+			uint8_t add)
+{
+	struct crypto_queue_pair_info *qp_info;
+	int enabled;
+	uint16_t i;
+
+	if (dev_info->qpairs == NULL)
+		return;
+
+	if (queue_pair_id == -1) {
+		for (i = 0; i < dev_info->dev->data->nb_queue_pairs; i++)
+			eca_update_qp_info(adapter, dev_info, i, add);
+	} else {
+		qp_info = &dev_info->qpairs[queue_pair_id];
+		enabled = qp_info->qp_enabled;
+		if (add) {
+			adapter->nb_qps += !enabled;
+			dev_info->num_qpairs += !enabled;
+		} else {
+			adapter->nb_qps -= enabled;
+			dev_info->num_qpairs -= enabled;
+		}
+		qp_info->qp_enabled = !!add;
+	}
+}
+
+static int
+eca_add_queue_pair(struct rte_event_crypto_adapter *adapter,
+		uint8_t cdev_id,
+		int queue_pair_id)
+{
+	struct crypto_device_info *dev_info = &adapter->cdevs[cdev_id];
+	struct crypto_queue_pair_info *qpairs;
+	uint32_t i;
+
+	if (dev_info->qpairs == NULL) {
+		dev_info->qpairs =
+		    rte_zmalloc_socket(adapter->mem_name,
+					dev_info->dev->data->nb_queue_pairs *
+					sizeof(struct crypto_queue_pair_info),
+					0, adapter->socket_id);
+		if (dev_info->qpairs == NULL)
+			return -ENOMEM;
+
+		qpairs = dev_info->qpairs;
+		qpairs->op_buffer = rte_zmalloc_socket(adapter->mem_name,
+					BATCH_SIZE *
+					sizeof(struct rte_crypto_op *),
+					0, adapter->socket_id);
+		if (!qpairs->op_buffer) {
+			rte_free(qpairs);
+			return -ENOMEM;
+		}
+	}
+
+	if (queue_pair_id == -1) {
+		for (i = 0; i < dev_info->dev->data->nb_queue_pairs; i++)
+			eca_update_qp_info(adapter, dev_info, i, 1);
+	} else
+		eca_update_qp_info(adapter, dev_info,
+					(uint16_t)queue_pair_id, 1);
+
+	return 0;
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_queue_pair_add(uint8_t id,
+			uint8_t cdev_id,
+			int32_t queue_pair_id,
+			const struct rte_event *event)
+{
+	struct rte_event_crypto_adapter *adapter;
+	struct rte_eventdev *dev;
+	struct crypto_device_info *dev_info;
+	uint32_t cap;
+	int ret;
+
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) {
+		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
+		return -EINVAL;
+	}
+
+	adapter = eca_id_to_adapter(id);
+	if (adapter == NULL)
+		return -EINVAL;
+
+	dev = &rte_eventdevs[adapter->eventdev_id];
+	ret = rte_event_crypto_adapter_caps_get(adapter->eventdev_id,
+						cdev_id,
+						&cap);
+	if (ret) {
+		RTE_EDEV_LOG_ERR("Failed to get adapter caps dev %" PRIu8
+			" cdev %" PRIu8, id, cdev_id);
+		return ret;
+	}
+
+	if ((cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) &&
+	    (event == NULL)) {
+		RTE_EDEV_LOG_ERR("Conf value can not be NULL for dev_id=%u",
+				  cdev_id);
+		return -EINVAL;
+	}
+
+	dev_info = &adapter->cdevs[cdev_id];
+
+	if (queue_pair_id != -1 &&
+	    (uint16_t)queue_pair_id >= dev_info->dev->data->nb_queue_pairs) {
+		RTE_EDEV_LOG_ERR("Invalid queue_pair_id %" PRIu16,
+				 (uint16_t)queue_pair_id);
+		return -EINVAL;
+	}
+
+	/* In case HW cap is RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD,
+	 * no need of service core as HW supports event forward capability.
+	 */
+	if ((cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) ||
+	    (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND &&
+	     adapter->mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) ||
+	    (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW &&
+	     adapter->mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW)) {
+		RTE_FUNC_PTR_OR_ERR_RET(
+			*dev->dev_ops->crypto_adapter_queue_pair_add,
+			-ENOTSUP);
+		if (dev_info->qpairs == NULL) {
+			dev_info->qpairs =
+			    rte_zmalloc_socket(adapter->mem_name,
+					dev_info->dev->data->nb_queue_pairs *
+					sizeof(struct crypto_queue_pair_info),
+					0, adapter->socket_id);
+			if (dev_info->qpairs == NULL)
+				return -ENOMEM;
+		}
+
+		ret = (*dev->dev_ops->crypto_adapter_queue_pair_add)(dev,
+				dev_info->dev,
+				queue_pair_id,
+				event);
+		if (ret)
+			return ret;
+
+		else
+			eca_update_qp_info(adapter, &adapter->cdevs[cdev_id],
+					   queue_pair_id, 1);
+	}
+
+	/* In case HW cap is RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW,
+	 * or SW adapter, initiate services so the application can choose
+	 * which ever way it wants to use the adapter.
+	 * Case 1: RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW
+	 *         Application may wants to use one of below two mode
+	 *          a. OP_FORWARD mode -> HW Dequeue + SW enqueue
+	 *          b. OP_NEW mode -> HW Dequeue
+	 * Case 2: No HW caps, use SW adapter
+	 *          a. OP_FORWARD mode -> SW enqueue & dequeue
+	 *          b. OP_NEW mode -> SW Dequeue
+	 */
+	if ((cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW &&
+	     adapter->mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) ||
+	     (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW) &&
+	      !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
+	      !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) &&
+	       (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA))) {
+		rte_spinlock_lock(&adapter->lock);
+		ret = eca_init_service(adapter, id);
+		if (ret == 0)
+			ret = eca_add_queue_pair(adapter, cdev_id,
+						 queue_pair_id);
+		rte_spinlock_unlock(&adapter->lock);
+
+		if (ret)
+			return ret;
+
+		rte_service_component_runstate_set(adapter->service_id, 1);
+	}
+
+	return 0;
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_queue_pair_del(uint8_t id, uint8_t cdev_id,
+					int32_t queue_pair_id)
+{
+	struct rte_event_crypto_adapter *adapter;
+	struct crypto_device_info *dev_info;
+	struct rte_eventdev *dev;
+	int ret;
+	uint32_t cap;
+	uint16_t i;
+
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id)) {
+		RTE_EDEV_LOG_ERR("Invalid dev_id=%" PRIu8, cdev_id);
+		return -EINVAL;
+	}
+
+	adapter = eca_id_to_adapter(id);
+	if (adapter == NULL)
+		return -EINVAL;
+
+	dev = &rte_eventdevs[adapter->eventdev_id];
+	ret = rte_event_crypto_adapter_caps_get(adapter->eventdev_id,
+						cdev_id,
+						&cap);
+	if (ret)
+		return ret;
+
+	dev_info = &adapter->cdevs[cdev_id];
+
+	if (queue_pair_id != -1 &&
+	    (uint16_t)queue_pair_id >= dev_info->dev->data->nb_queue_pairs) {
+		RTE_EDEV_LOG_ERR("Invalid queue_pair_id %" PRIu16,
+				 (uint16_t)queue_pair_id);
+		return -EINVAL;
+	}
+
+	if ((cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) ||
+	    (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW &&
+	     adapter->mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW)) {
+		RTE_FUNC_PTR_OR_ERR_RET(
+			*dev->dev_ops->crypto_adapter_queue_pair_del,
+			-ENOTSUP);
+		ret = (*dev->dev_ops->crypto_adapter_queue_pair_del)(dev,
+						dev_info->dev,
+						queue_pair_id);
+		if (ret == 0) {
+			eca_update_qp_info(adapter,
+					&adapter->cdevs[cdev_id],
+					queue_pair_id,
+					0);
+			if (dev_info->num_qpairs == 0) {
+				rte_free(dev_info->qpairs);
+				dev_info->qpairs = NULL;
+			}
+		}
+	} else {
+		if (adapter->nb_qps == 0)
+			return 0;
+
+		rte_spinlock_lock(&adapter->lock);
+		if (queue_pair_id == -1) {
+			for (i = 0; i < dev_info->dev->data->nb_queue_pairs;
+				i++)
+				eca_update_qp_info(adapter, dev_info,
+							queue_pair_id, 0);
+		} else {
+			eca_update_qp_info(adapter, dev_info,
+						(uint16_t)queue_pair_id, 0);
+		}
+
+		if (dev_info->num_qpairs == 0) {
+			rte_free(dev_info->qpairs);
+			dev_info->qpairs = NULL;
+		}
+
+		rte_spinlock_unlock(&adapter->lock);
+		rte_service_component_runstate_set(adapter->service_id,
+				adapter->nb_qps);
+	}
+
+	return ret;
+}
+
+static int
+eca_adapter_ctrl(uint8_t id, int start)
+{
+	struct rte_event_crypto_adapter *adapter;
+	struct crypto_device_info *dev_info;
+	struct rte_eventdev *dev;
+	uint32_t i;
+	int use_service;
+	int stop = !start;
+
+	use_service = 0;
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+	adapter = eca_id_to_adapter(id);
+	if (adapter == NULL)
+		return -EINVAL;
+
+	dev = &rte_eventdevs[adapter->eventdev_id];
+
+	for (i = 0; i < rte_cryptodev_count(); i++) {
+		dev_info = &adapter->cdevs[i];
+		/* if start  check for num queue pairs */
+		if (start && !dev_info->num_qpairs)
+			continue;
+		/* if stop check if dev has been started */
+		if (stop && !dev_info->dev_started)
+			continue;
+		use_service |= !dev_info->internal_event_port;
+		dev_info->dev_started = start;
+		if (dev_info->internal_event_port == 0)
+			continue;
+		start ? (*dev->dev_ops->crypto_adapter_start)(dev,
+						&dev_info->dev[i]) :
+			(*dev->dev_ops->crypto_adapter_stop)(dev,
+						&dev_info->dev[i]);
+	}
+
+	if (use_service)
+		rte_service_runstate_set(adapter->service_id, start);
+
+	return 0;
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_start(uint8_t id)
+{
+	struct rte_event_crypto_adapter *adapter;
+
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+	adapter = eca_id_to_adapter(id);
+	if (adapter == NULL)
+		return -EINVAL;
+
+	return eca_adapter_ctrl(id, 1);
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_stop(uint8_t id)
+{
+	return eca_adapter_ctrl(id, 0);
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_stats_get(uint8_t id,
+				struct rte_event_crypto_adapter_stats *stats)
+{
+	struct rte_event_crypto_adapter *adapter;
+	struct rte_event_crypto_adapter_stats dev_stats_sum = { 0 };
+	struct rte_event_crypto_adapter_stats dev_stats;
+	struct rte_eventdev *dev;
+	struct crypto_device_info *dev_info;
+	uint32_t i;
+	int ret;
+
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	adapter = eca_id_to_adapter(id);
+	if (adapter == NULL || stats == NULL)
+		return -EINVAL;
+
+	dev = &rte_eventdevs[adapter->eventdev_id];
+	memset(stats, 0, sizeof(*stats));
+	for (i = 0; i < rte_cryptodev_count(); i++) {
+		dev_info = &adapter->cdevs[i];
+		if (dev_info->internal_event_port == 0 ||
+			dev->dev_ops->crypto_adapter_stats_get == NULL)
+			continue;
+		ret = (*dev->dev_ops->crypto_adapter_stats_get)(dev,
+						dev_info->dev,
+						&dev_stats);
+		if (ret)
+			continue;
+
+		dev_stats_sum.crypto_deq_count += dev_stats.crypto_deq_count;
+		dev_stats_sum.event_enq_count +=
+			dev_stats.event_enq_count;
+	}
+
+	if (adapter->service_inited)
+		*stats = adapter->crypto_stats;
+
+	stats->crypto_deq_count += dev_stats_sum.crypto_deq_count;
+	stats->event_enq_count += dev_stats_sum.event_enq_count;
+
+	return 0;
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_stats_reset(uint8_t id)
+{
+	struct rte_event_crypto_adapter *adapter;
+	struct crypto_device_info *dev_info;
+	struct rte_eventdev *dev;
+	uint32_t i;
+
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	adapter = eca_id_to_adapter(id);
+	if (adapter == NULL)
+		return -EINVAL;
+
+	dev = &rte_eventdevs[adapter->eventdev_id];
+	for (i = 0; i < rte_cryptodev_count(); i++) {
+		dev_info = &adapter->cdevs[i];
+		if (dev_info->internal_event_port == 0 ||
+			dev->dev_ops->crypto_adapter_stats_reset == NULL)
+			continue;
+		(*dev->dev_ops->crypto_adapter_stats_reset)(dev,
+						dev_info->dev);
+	}
+
+	memset(&adapter->crypto_stats, 0, sizeof(adapter->crypto_stats));
+	return 0;
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_service_id_get(uint8_t id, uint32_t *service_id)
+{
+	struct rte_event_crypto_adapter *adapter;
+
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	adapter = eca_id_to_adapter(id);
+	if (adapter == NULL || service_id == NULL)
+		return -EINVAL;
+
+	if (adapter->service_inited)
+		*service_id = adapter->service_id;
+
+	return adapter->service_inited ? 0 : -ESRCH;
+}
+
+int __rte_experimental
+rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id)
+{
+	struct rte_event_crypto_adapter *adapter;
+
+	RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
+
+	adapter = eca_id_to_adapter(id);
+	if (adapter == NULL || event_port_id == NULL)
+		return -EINVAL;
+
+	*event_port_id = adapter->event_port_id;
+
+	return 0;
+}
diff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map
index 3ee28f7..2c674f5 100644
--- a/lib/librte_eventdev/rte_eventdev_version.map
+++ b/lib/librte_eventdev/rte_eventdev_version.map
@@ -97,4 +97,16 @@ EXPERIMENTAL {
 	rte_event_timer_arm_burst;
 	rte_event_timer_arm_tmo_tick_burst;
 	rte_event_timer_cancel_burst;
+        rte_event_crypto_adapter_create_ext;
+	rte_event_crypto_adapter_create;
+	rte_event_crypto_adapter_free;
+	rte_event_crypto_adapter_queue_pair_add;
+	rte_event_crypto_adapter_queue_pair_del;
+	rte_event_crypto_adapter_start;
+	rte_event_crypto_adapter_stop;
+	rte_event_crypto_adapter_stats_get;
+	rte_event_crypto_adapter_stats_reset;
+	rte_event_crypto_adapter_service_id_get;
+	rte_event_crypto_adapter_event_port_get;
+
 } DPDK_18.05;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test
  2018-05-05 18:47 [dpdk-dev] [v3,0/5] eventdev: cover letter - crypto adapter Abhinandan Gujjar
                   ` (2 preceding siblings ...)
  2018-05-05 18:47 ` [dpdk-dev] [v3,3/5] eventdev: add crypto adapter implementation Abhinandan Gujjar
@ 2018-05-05 18:47 ` Abhinandan Gujjar
  2018-05-07  5:20   ` Jerin Jacob
                     ` (2 more replies)
  2018-05-05 18:47 ` [dpdk-dev] [v3,5/5] doc: add event crypto adapter documentation Abhinandan Gujjar
  4 siblings, 3 replies; 23+ messages in thread
From: Abhinandan Gujjar @ 2018-05-05 18:47 UTC (permalink / raw)
  To: jerin.jacob, hemant.agrawal, akhil.goyal, dev
  Cc: narender.vangati, abhinandan.gujjar, nikhil.rao, gage.eads

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 MAINTAINERS                           |   1 +
 test/test/Makefile                    |   1 +
 test/test/test_event_crypto_adapter.c | 913 ++++++++++++++++++++++++++++++++++
 3 files changed, 915 insertions(+)
 create mode 100644 test/test/test_event_crypto_adapter.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 991b465..60ebef7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -366,6 +366,7 @@ Eventdev Crypto Adapter API - EXPERIMENTAL
 M: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
 T: git://dpdk.org/next/dpdk-next-eventdev
 F: lib/librte_eventdev/*crypto_adapter*
+F: test/test/test_event_crypto_adapter.c
 
 Raw device API - EXPERIMENTAL
 M: Shreyansh Jain <shreyansh.jain@nxp.com>
diff --git a/test/test/Makefile b/test/test/Makefile
index 2630ab4..3a45ab2 100644
--- a/test/test/Makefile
+++ b/test/test/Makefile
@@ -185,6 +185,7 @@ SRCS-y += test_eventdev.c
 SRCS-y += test_event_ring.c
 SRCS-y += test_event_eth_rx_adapter.c
 SRCS-y += test_event_timer_adapter.c
+SRCS-y += test_event_crypto_adapter.c
 endif
 
 ifeq ($(CONFIG_RTE_LIBRTE_RAWDEV),y)
diff --git a/test/test/test_event_crypto_adapter.c b/test/test/test_event_crypto_adapter.c
new file mode 100644
index 0000000..099adcb
--- /dev/null
+++ b/test/test/test_event_crypto_adapter.c
@@ -0,0 +1,913 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include <string.h>
+#include <rte_common.h>
+#include <rte_mempool.h>
+#include <rte_mbuf.h>
+#include <rte_cryptodev.h>
+#include <rte_eventdev.h>
+#include <rte_bus_vdev.h>
+#include <rte_service.h>
+#include <rte_event_crypto_adapter.h>
+#include "test.h"
+
+#define PKT_TRACE                  0
+#define NUM                        1
+#define DEFAULT_NUM_XFORMS        (2)
+#define NUM_MBUFS                 (8191)
+#define MBUF_CACHE_SIZE           (256)
+#define MAXIMUM_IV_LENGTH         (16)
+#define DEFAULT_NUM_OPS_INFLIGHT  (128)
+#define TEST_APP_PORT_ID           0
+#define TEST_APP_EV_QUEUE_ID       0
+#define TEST_CRYPTO_EV_QUEUE_ID    1
+#define TEST_ADAPTER_ID            0
+#define TEST_CDEV_ID               0
+#define TEST_CDEV_QP_ID            0
+#define PACKET_LENGTH              64
+#define NB_TEST_PORTS              1
+#define NB_TEST_QUEUES             2
+#define CRYPTODEV_NAME_NULL_PMD    crypto_null
+
+#define MBUF_SIZE              (sizeof(struct rte_mbuf) + \
+				RTE_PKTMBUF_HEADROOM + PACKET_LENGTH)
+#define IV_OFFSET              (sizeof(struct rte_crypto_op) + \
+				sizeof(struct rte_crypto_sym_op) + \
+				DEFAULT_NUM_XFORMS * \
+				sizeof(struct rte_crypto_sym_xform))
+
+
+static const uint8_t text_64B[] = {
+	0x05, 0x15, 0x77, 0x32, 0xc9, 0x66, 0x91, 0x50,
+	0x93, 0x9f, 0xbb, 0x4e, 0x2e, 0x5a, 0x02, 0xd0,
+	0x2d, 0x9d, 0x31, 0x5d, 0xc8, 0x9e, 0x86, 0x36,
+	0x54, 0x5c, 0x50, 0xe8, 0x75, 0x54, 0x74, 0x5e,
+	0xd5, 0xa2, 0x84, 0x21, 0x2d, 0xc5, 0xf8, 0x1c,
+	0x55, 0x1a, 0xba, 0x91, 0xce, 0xb5, 0xa3, 0x1e,
+	0x31, 0xbf, 0xe9, 0xa1, 0x97, 0x5c, 0x2b, 0xd6,
+	0x57, 0xa5, 0x9f, 0xab, 0xbd, 0xb0, 0x9b, 0x9c
+};
+
+struct event_crypto_adapter_test_params {
+	struct rte_mempool *mbuf_pool;
+	struct rte_mempool *op_mpool;
+	struct rte_mempool *session_mpool;
+	struct rte_cryptodev_config *config;
+	uint8_t crypto_event_port_id;
+};
+
+struct rte_event response_info = {
+	.queue_id = TEST_APP_EV_QUEUE_ID,
+	.sched_type = RTE_SCHED_TYPE_ATOMIC,
+	.flow_id = 0xAABB,
+	.sub_event_type = 0,
+	.event_type = 0,
+	.priority = 0,
+	.impl_opaque = 0
+};
+
+struct rte_event_crypto_request request_info = {
+	.cdev_id = TEST_CDEV_ID,
+	.queue_pair_id = TEST_CDEV_QP_ID
+};
+
+static struct event_crypto_adapter_test_params params;
+static uint8_t crypto_adapter_setup_done;
+static uint32_t slcore_id;
+static int evdev;
+
+static struct rte_mbuf *
+alloc_fill_mbuf(struct rte_mempool *mpool, const uint8_t *data,
+		size_t len, uint8_t blocksize)
+{
+	struct rte_mbuf *m = rte_pktmbuf_alloc(mpool);
+	size_t t_len = len - (blocksize ? (len % blocksize) : 0);
+
+	if (m) {
+		char *dst = rte_pktmbuf_append(m, t_len);
+
+		if (!dst) {
+			rte_pktmbuf_free(m);
+			return NULL;
+		}
+
+		rte_memcpy(dst, (const void *)data, t_len);
+	}
+	return m;
+}
+
+static int
+send_recv_ev(struct rte_event *ev)
+{
+	struct rte_crypto_op *op;
+	struct rte_event recv_ev;
+	int ret;
+
+	ret = rte_event_enqueue_burst(evdev, TEST_APP_PORT_ID, ev, NUM);
+	TEST_ASSERT_EQUAL(ret, NUM,
+			  "Failed to send event to crypto adapter\n");
+
+	while (rte_event_dequeue_burst(evdev,
+			TEST_APP_PORT_ID, &recv_ev, NUM, 0) == 0)
+		rte_pause();
+
+	op = recv_ev.event_ptr;
+#if PKT_TRACE
+	struct rte_mbuf *m = op->sym->m_src;
+	rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
+#endif
+	rte_pktmbuf_free(op->sym->m_src);
+	rte_crypto_op_free(op);
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_crypto_adapter_stats(void)
+{
+	struct rte_event_crypto_adapter_stats stats;
+
+	rte_event_crypto_adapter_stats_get(TEST_ADAPTER_ID, &stats);
+	printf(" +------------------------------------------------------+\n");
+	printf(" + Crypto adapter stats for instance %u:\n", TEST_ADAPTER_ID);
+	printf(" + Event port poll count          %lu\n",
+		stats.event_poll_count);
+	printf(" + Event dequeue count            %lu\n",
+		stats.event_deq_count);
+	printf(" + Cryptodev enqueue count        %lu\n",
+		stats.crypto_enq_count);
+	printf(" + Cryptodev enqueue failed count %lu\n",
+		stats.crypto_enq_fail);
+	printf(" + Cryptodev dequeue count        %lu\n",
+		stats.crypto_deq_count);
+	printf(" + Event enqueue count            %lu\n",
+		stats.event_enq_count);
+	printf(" + Event enqueue retry count      %lu\n",
+		stats.event_enq_retry_count);
+	printf(" + Event enqueue fail count       %lu\n",
+		stats.event_enq_fail_count);
+	printf(" +------------------------------------------------------+\n");
+
+	rte_event_crypto_adapter_stats_reset(TEST_ADAPTER_ID);
+	return TEST_SUCCESS;
+}
+
+static int
+test_op_forward_mode(uint8_t session_less)
+{
+	struct rte_crypto_sym_xform cipher_xform;
+	struct rte_cryptodev_sym_session *sess;
+	union rte_event_crypto_metadata m_data;
+	struct rte_crypto_sym_op *sym_op;
+	struct rte_crypto_op *op;
+	struct rte_mbuf *m;
+	struct rte_event ev;
+	uint32_t cap;
+	int ret;
+
+	memset(&m_data, 0, sizeof(m_data));
+
+	m = alloc_fill_mbuf(params.mbuf_pool, text_64B, PACKET_LENGTH, 0);
+	TEST_ASSERT_NOT_NULL(m, "Failed to allocate mbuf!\n");
+#if PKT_TRACE
+	rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
+#endif
+	/* Setup Cipher Parameters */
+	cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+	cipher_xform.next = NULL;
+
+	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
+	cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
+
+	op = rte_crypto_op_alloc(params.op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(op,
+		"Failed to allocate symmetric crypto operation struct\n");
+
+	sym_op = op->sym;
+
+	if (!session_less) {
+		sess = rte_cryptodev_sym_session_create(params.session_mpool);
+		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
+
+		/* Create Crypto session*/
+		rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
+				&cipher_xform, params.session_mpool);
+
+		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
+							evdev, &cap);
+		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
+			/* Fill in private date information */
+			rte_memcpy(&m_data.response_info, &response_info,
+				sizeof(response_info));
+			rte_memcpy(&m_data.request_info, &request_info,
+				sizeof(request_info));
+			rte_cryptodev_sym_session_set_private_data(sess,
+						&m_data, sizeof(m_data));
+		}
+
+		rte_crypto_op_attach_sym_session(op, sess);
+	} else {
+		struct rte_crypto_sym_xform *first_xform;
+
+		rte_crypto_op_sym_xforms_alloc(op, NUM);
+		op->sess_type = RTE_CRYPTO_OP_SESSIONLESS;
+		first_xform = &cipher_xform;
+		sym_op->xform = first_xform;
+		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH +
+				(sizeof(struct rte_crypto_sym_xform) * 2);
+		op->private_data_offset = len;
+		/* Fill in private data information */
+		rte_memcpy(&m_data.response_info, &response_info,
+			   sizeof(response_info));
+		rte_memcpy(&m_data.request_info, &request_info,
+			   sizeof(request_info));
+		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
+	}
+
+	sym_op->m_src = m;
+	sym_op->cipher.data.offset = 0;
+	sym_op->cipher.data.length = PACKET_LENGTH;
+
+	/* Fill in event info and update event_ptr with rte_crypto_op */
+	memset(&ev, 0, sizeof(ev));
+	ev.queue_id = TEST_CRYPTO_EV_QUEUE_ID;
+	ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
+	ev.flow_id = 0xAABB;
+	ev.event_ptr = op;
+
+	ret = send_recv_ev(&ev);
+	TEST_ASSERT_SUCCESS(ret, "Failed to send/receive event to "
+				"crypto adapter\n");
+
+	test_crypto_adapter_stats();
+
+	return TEST_SUCCESS;
+}
+
+static int
+map_adapter_service_core(void)
+{
+	uint32_t adapter_service_id;
+
+	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_service_id_get(
+			    TEST_ADAPTER_ID, &adapter_service_id),
+			    "Failed to get event crypto adapter service id");
+
+	TEST_ASSERT_SUCCESS(rte_service_map_lcore_set(adapter_service_id,
+			slcore_id, 1), "Failed to map adapter service");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_sessionless_with_op_forward_mode(void)
+{
+	uint32_t cap;
+	int ret;
+
+	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+		map_adapter_service_core();
+
+	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
+				"Failed to start event crypto adapter");
+
+	ret = test_op_forward_mode(1);
+	TEST_ASSERT_SUCCESS(ret, "Sessionless - ENQ-DEQ mode test failed\n");
+	return TEST_SUCCESS;
+}
+
+static int
+test_session_with_op_forward_mode(void)
+{
+	uint32_t cap;
+	int ret;
+
+	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+		map_adapter_service_core();
+
+	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID
+				), "Failed to start event crypto adapter");
+
+	ret = test_op_forward_mode(0);
+	TEST_ASSERT_SUCCESS(ret, "Session based - ENQ-DEQ mode test failed\n");
+	return TEST_SUCCESS;
+}
+
+static int
+send_op_recv_ev(struct rte_crypto_op *op)
+{
+	struct rte_crypto_op *recv_op;
+	struct rte_event ev;
+	int ret;
+
+	ret = rte_cryptodev_enqueue_burst(TEST_CDEV_ID, TEST_CDEV_QP_ID,
+					  &op, NUM);
+	TEST_ASSERT_EQUAL(ret, NUM, "Failed to enqueue to cryptodev\n");
+	memset(&ev, 0, sizeof(ev));
+
+	while (rte_event_dequeue_burst(evdev,
+		TEST_APP_PORT_ID, &ev, NUM, 0) == 0)
+		rte_pause();
+
+	recv_op = ev.event_ptr;
+#if PKT_TRACE
+	struct rte_mbuf *m = recv_op->sym->m_src;
+	rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
+#endif
+	rte_pktmbuf_free(recv_op->sym->m_src);
+	rte_crypto_op_free(recv_op);
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_op_new_mode(uint8_t session_less)
+{
+	struct rte_crypto_sym_xform cipher_xform;
+	struct rte_cryptodev_sym_session *sess;
+	union rte_event_crypto_metadata m_data;
+	struct rte_crypto_sym_op *sym_op;
+	struct rte_crypto_op *op;
+	struct rte_mbuf *m;
+	uint32_t cap;
+	int ret;
+
+	memset(&m_data, 0, sizeof(m_data));
+
+	m = alloc_fill_mbuf(params.mbuf_pool, text_64B, PACKET_LENGTH, 0);
+	TEST_ASSERT_NOT_NULL(m, "Failed to allocate mbuf!\n");
+#if PKT_TRACE
+	rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
+#endif
+	/* Setup Cipher Parameters */
+	cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
+	cipher_xform.next = NULL;
+
+	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
+	cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
+
+	op = rte_crypto_op_alloc(params.op_mpool,
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
+	TEST_ASSERT_NOT_NULL(op, "Failed to allocate crypto_op!\n");
+
+	sym_op = op->sym;
+
+	if (!session_less) {
+		sess = rte_cryptodev_sym_session_create(params.session_mpool);
+		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
+
+		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
+							evdev, &cap);
+		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
+			/* Fill in private data information */
+			rte_memcpy(&m_data.response_info, &response_info,
+				   sizeof(m_data));
+			rte_cryptodev_sym_session_set_private_data(sess,
+						&m_data, sizeof(m_data));
+		}
+		rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
+				&cipher_xform, params.session_mpool);
+		rte_crypto_op_attach_sym_session(op, sess);
+	} else {
+		struct rte_crypto_sym_xform *first_xform;
+
+		rte_crypto_op_sym_xforms_alloc(op, NUM);
+		op->sess_type = RTE_CRYPTO_OP_SESSIONLESS;
+		first_xform = &cipher_xform;
+		sym_op->xform = first_xform;
+		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH +
+				(sizeof(struct rte_crypto_sym_xform) * 2);
+		op->private_data_offset = len;
+		/* Fill in private data information */
+		rte_memcpy(&m_data.response_info, &response_info,
+			   sizeof(m_data));
+		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
+	}
+
+	sym_op->m_src = m;
+	sym_op->cipher.data.offset = 0;
+	sym_op->cipher.data.length = PACKET_LENGTH;
+
+	ret = send_op_recv_ev(op);
+	TEST_ASSERT_SUCCESS(ret, "Failed to enqueue op to cryptodev\n");
+
+	test_crypto_adapter_stats();
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_sessionless_with_op_new_mode(void)
+{
+	uint32_t cap;
+	int ret;
+
+	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) ||
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+		map_adapter_service_core();
+
+	/* start the event crypto adapter */
+	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
+				"Failed to start event crypto adapter");
+
+	ret = test_op_new_mode(1);
+	TEST_ASSERT_SUCCESS(ret, "Sessionless - DEQ_ONLY test failed\n");
+	return TEST_SUCCESS;
+}
+
+static int
+test_session_with_op_new_mode(void)
+{
+	uint32_t cap;
+	int ret;
+
+	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) ||
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+		map_adapter_service_core();
+
+	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
+				"Failed to start event crypto adapter");
+
+	ret = test_op_new_mode(0);
+	TEST_ASSERT_SUCCESS(ret, "Session based - DEQ_ONLY test failed\n");
+	return TEST_SUCCESS;
+}
+
+static int
+configure_cryptodev(void)
+{
+	struct rte_cryptodev_qp_conf qp_conf;
+	struct rte_cryptodev_config conf;
+	struct rte_cryptodev_info info;
+	unsigned int session_size;
+	uint8_t nb_devs;
+	int ret;
+
+	params.mbuf_pool = rte_pktmbuf_pool_create(
+			"CRYPTO_ADAPTER_MBUFPOOL",
+			NUM_MBUFS, MBUF_CACHE_SIZE, 0, MBUF_SIZE,
+			rte_socket_id());
+	if (params.mbuf_pool == NULL) {
+		RTE_LOG(ERR, USER1, "Can't create CRYPTO_MBUFPOOL\n");
+		return TEST_FAILED;
+	}
+
+	params.op_mpool = rte_crypto_op_pool_create(
+			"EVENT_CRYPTO_SYM_OP_POOL",
+			RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+			NUM_MBUFS, MBUF_CACHE_SIZE,
+			DEFAULT_NUM_XFORMS *
+			sizeof(struct rte_crypto_sym_xform) +
+			MAXIMUM_IV_LENGTH,
+			rte_socket_id());
+	if (params.op_mpool == NULL) {
+		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
+		return TEST_FAILED;
+	}
+
+	/* Create a NULL crypto device */
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_NULL_PMD)));
+	if (!nb_devs) {
+		ret = rte_vdev_init(
+			RTE_STR(CRYPTODEV_NAME_NULL_PMD), NULL);
+
+		TEST_ASSERT(ret == 0, "Failed to create pmd:%s instance\n",
+			    RTE_STR(CRYPTODEV_NAME_NULL_PMD));
+	}
+
+	nb_devs = rte_cryptodev_count();
+	if (!nb_devs) {
+		RTE_LOG(ERR, USER1, "No crypto devices found?\n");
+		return TEST_FAILED;
+	}
+
+	/*
+	 * Create mempool with maximum number of sessions * 2,
+	 * to include the session headers & private data
+	 */
+	session_size = rte_cryptodev_get_private_session_size(TEST_CDEV_ID);
+	session_size += sizeof(union rte_event_crypto_metadata);
+
+	params.session_mpool = rte_mempool_create(
+				"CRYPTO_ADAPTER_SESSION_MP",
+				info.sym.max_nb_sessions * 2,
+				session_size,
+				0, 0, NULL, NULL, NULL,
+				NULL, SOCKET_ID_ANY,
+				0);
+
+	TEST_ASSERT_NOT_NULL(params.session_mpool,
+			"session mempool allocation failed\n");
+
+	rte_cryptodev_info_get(TEST_CDEV_ID, &info);
+	conf.nb_queue_pairs = info.max_nb_queue_pairs;
+	conf.socket_id = SOCKET_ID_ANY;
+
+	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(TEST_CDEV_ID,
+			&conf),
+			"Failed to configure cryptodev %u with %u qps\n",
+			TEST_CDEV_ID, conf.nb_queue_pairs);
+
+	qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT;
+
+	TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
+			TEST_CDEV_ID, TEST_CDEV_QP_ID, &qp_conf,
+			rte_cryptodev_socket_id(TEST_CDEV_ID),
+			params.session_mpool),
+			"Failed to setup queue pair %u on cryptodev %u\n",
+			TEST_CDEV_QP_ID, TEST_CDEV_ID);
+
+	return TEST_SUCCESS;
+}
+
+static inline void
+evdev_set_conf_values(struct rte_event_dev_config *dev_conf,
+			struct rte_event_dev_info *info)
+{
+	memset(dev_conf, 0, sizeof(struct rte_event_dev_config));
+	dev_conf->dequeue_timeout_ns = info->min_dequeue_timeout_ns;
+	dev_conf->nb_event_ports = NB_TEST_PORTS;
+	dev_conf->nb_event_queues = NB_TEST_QUEUES;
+	dev_conf->nb_event_queue_flows = info->max_event_queue_flows;
+	dev_conf->nb_event_port_dequeue_depth =
+			info->max_event_port_dequeue_depth;
+	dev_conf->nb_event_port_enqueue_depth =
+			info->max_event_port_enqueue_depth;
+	dev_conf->nb_event_port_enqueue_depth =
+			info->max_event_port_enqueue_depth;
+	dev_conf->nb_events_limit =
+			info->max_num_events;
+}
+
+static int
+configure_eventdev(void)
+{
+	const char *eventdev_name = "event_sw0";
+	struct rte_event_queue_conf queue_conf;
+	struct rte_event_dev_config devconf;
+	struct rte_event_dev_info info;
+	uint32_t queue_count;
+	uint32_t port_count;
+	int ret;
+	uint8_t qid;
+
+	evdev = rte_event_dev_get_dev_id(eventdev_name);
+	if (evdev < 0) {
+		if (rte_vdev_init(eventdev_name, NULL) < 0) {
+			RTE_LOG(DEBUG, USER1, "Error creating eventdev\n");
+			return TEST_FAILED;
+		}
+		evdev = rte_event_dev_get_dev_id(eventdev_name);
+		if (evdev < 0) {
+			RTE_LOG(DEBUG, USER1, "Error finding eventdev!\n");
+			return TEST_FAILED;
+		}
+	}
+
+	ret = rte_event_dev_info_get(evdev, &info);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info\n");
+
+	evdev_set_conf_values(&devconf, &info);
+
+	ret = rte_event_dev_configure(evdev, &devconf);
+	TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev\n");
+
+	/* Set up event queue */
+	ret = rte_event_dev_attr_get(evdev, RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+					&queue_count);
+	TEST_ASSERT_SUCCESS(ret, "Queue count get failed\n");
+	TEST_ASSERT_EQUAL(queue_count, 2, "Unexpected queue count\n");
+
+	qid = TEST_APP_EV_QUEUE_ID;
+	ret = rte_event_queue_setup(evdev, qid, NULL);
+	TEST_ASSERT_SUCCESS(ret, "Failed to setup queue=%d\n", qid);
+
+	queue_conf.nb_atomic_flows = info.max_event_queue_flows;
+	queue_conf.nb_atomic_order_sequences = 32;
+	queue_conf.schedule_type = RTE_SCHED_TYPE_ATOMIC;
+	queue_conf.priority = RTE_EVENT_DEV_PRIORITY_HIGHEST;
+	queue_conf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_SINGLE_LINK;
+
+	qid = TEST_CRYPTO_EV_QUEUE_ID;
+	ret = rte_event_queue_setup(evdev, qid, &queue_conf);
+	TEST_ASSERT_SUCCESS(ret, "Failed to setup queue=%u\n", qid);
+
+	/* Set up event port */
+	ret = rte_event_dev_attr_get(evdev, RTE_EVENT_DEV_ATTR_PORT_COUNT,
+					&port_count);
+	TEST_ASSERT_SUCCESS(ret, "Port count get failed\n");
+	TEST_ASSERT_EQUAL(port_count, 1, "Unexpected port count\n");
+
+	ret = rte_event_port_setup(evdev, TEST_APP_PORT_ID, NULL);
+	TEST_ASSERT_SUCCESS(ret, "Failed to setup port=%d\n",
+			    TEST_APP_PORT_ID);
+
+	qid = TEST_APP_EV_QUEUE_ID;
+	ret = rte_event_port_link(evdev, TEST_APP_PORT_ID, &qid, NULL, 1);
+	TEST_ASSERT(ret >= 0, "Failed to link queue port=%d\n",
+		    TEST_APP_PORT_ID);
+
+	return TEST_SUCCESS;
+}
+
+static void
+test_crypto_adapter_free(void)
+{
+	rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
+}
+
+static int
+test_crypto_adapter_create(void)
+{
+	struct rte_event_port_conf conf = {
+		.dequeue_depth = 8,
+		.enqueue_depth = 8,
+		.new_event_threshold = 1200,
+	};
+	int ret;
+
+	/* Create adapter with default port creation callback */
+	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
+					      TEST_CDEV_ID,
+					      &conf, 0);
+	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_crypto_adapter_qp_add_del(void)
+{
+	uint32_t cap;
+	int ret;
+
+	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	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);
+	} else
+		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
+					TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL);
+
+	TEST_ASSERT_SUCCESS(ret, "Failed to create add queue pair\n");
+
+	ret = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
+					TEST_CDEV_ID, TEST_CDEV_QP_ID);
+	TEST_ASSERT_SUCCESS(ret, "Failed to delete add queue pair\n");
+
+	return TEST_SUCCESS;
+}
+
+static int
+configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
+{
+	struct rte_event_port_conf conf = {
+		.dequeue_depth = 8,
+		.enqueue_depth = 8,
+		.new_event_threshold = 1200,
+	};
+
+	uint32_t cap;
+	int ret;
+
+	/* Create adapter with default port creation callback */
+	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
+					      TEST_CDEV_ID,
+					      &conf, mode);
+	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
+
+	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	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);
+	} else
+		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
+				TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL);
+
+	TEST_ASSERT_SUCCESS(ret, "Failed to add queue pair\n");
+
+	ret = rte_event_crypto_adapter_event_port_get(TEST_ADAPTER_ID,
+				&params.crypto_event_port_id);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get event port\n");
+
+	return TEST_SUCCESS;
+}
+
+static void
+test_crypto_adapter_stop(void)
+{
+	uint32_t evdev_service_id, adapter_service_id;
+
+	/* retrieve service ids */
+	rte_event_dev_service_id_get(evdev, &evdev_service_id);
+	rte_event_crypto_adapter_service_id_get(
+			TEST_ADAPTER_ID, &adapter_service_id);
+
+	/* stop services */
+	rte_service_runstate_set(evdev_service_id, 0);
+	rte_service_runstate_set(adapter_service_id, 0);
+	rte_service_lcore_stop(slcore_id);
+	rte_service_lcore_del(slcore_id);
+	rte_event_crypto_adapter_stop(TEST_ADAPTER_ID);
+	rte_event_dev_stop(evdev);
+}
+
+static int
+test_crypto_adapter_conf(enum rte_event_crypto_adapter_mode mode)
+{
+	uint32_t evdev_service_id;
+	uint8_t qid;
+	int ret;
+
+	if (!crypto_adapter_setup_done) {
+		ret = configure_event_crypto_adapter(mode);
+		if (!ret) {
+			qid = TEST_CRYPTO_EV_QUEUE_ID;
+			ret = rte_event_port_link(evdev,
+				params.crypto_event_port_id, &qid, NULL, 1);
+			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
+					"port=%u\n", qid,
+					params.crypto_event_port_id);
+		}
+		crypto_adapter_setup_done = 1;
+	}
+
+	/* retrieve service ids */
+	TEST_ASSERT_SUCCESS(rte_event_dev_service_id_get(evdev,
+			    &evdev_service_id), "Failed to get event device "
+			    "service id");
+
+	/* add a service core and start it */
+	TEST_ASSERT_SUCCESS(rte_service_lcore_add(slcore_id),
+			"Failed to add service core");
+	TEST_ASSERT_SUCCESS(rte_service_lcore_start(slcore_id),
+			"Failed to start service core");
+
+	/* map services to it */
+	TEST_ASSERT_SUCCESS(rte_service_map_lcore_set(evdev_service_id,
+			slcore_id, 1), "Failed to map evdev service");
+
+	/* set services to running */
+	TEST_ASSERT_SUCCESS(rte_service_runstate_set(evdev_service_id, 1),
+			"Failed to start evdev service");
+
+	/* start the eventdev */
+	TEST_ASSERT_SUCCESS(rte_event_dev_start(evdev),
+			"Failed to start event device");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_crypto_adapter_conf_op_forward_mode(void)
+{
+	enum rte_event_crypto_adapter_mode mode;
+
+	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
+	test_crypto_adapter_conf(mode);
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_crypto_adapter_conf_op_new_mode(void)
+{
+	enum rte_event_crypto_adapter_mode mode;
+
+	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
+	test_crypto_adapter_conf(mode);
+	return TEST_SUCCESS;
+}
+
+
+static int
+testsuite_setup(void)
+{
+	int ret;
+
+	slcore_id = rte_get_next_lcore(-1, 1, 0);
+	TEST_ASSERT_NOT_EQUAL(slcore_id, RTE_MAX_LCORE, "At least 2 lcores "
+			"are required to run this autotest\n");
+
+	/* Setup and start event device. */
+	ret = configure_eventdev();
+	TEST_ASSERT_SUCCESS(ret, "Failed to setup eventdev\n");
+
+	/* Setup and start crypto device. */
+	ret = configure_cryptodev();
+	TEST_ASSERT_SUCCESS(ret, "cryptodev initialization failed\n");
+
+	return TEST_SUCCESS;
+}
+
+static void
+crypto_teardown(void)
+{
+	/* Free mbuf mempool */
+	if (params.mbuf_pool != NULL) {
+		RTE_LOG(DEBUG, USER1, "CRYPTO_ADAPTER_MBUFPOOL count %u\n",
+		rte_mempool_avail_count(params.mbuf_pool));
+		rte_mempool_free(params.mbuf_pool);
+		params.mbuf_pool = NULL;
+	}
+
+	/* Free session mempool */
+	if (params.session_mpool != NULL) {
+		RTE_LOG(DEBUG, USER1, "CRYPTO_ADAPTER_SESSION_MP count %u\n",
+		rte_mempool_avail_count(params.session_mpool));
+		rte_mempool_free(params.session_mpool);
+		params.session_mpool = NULL;
+	}
+
+	/* Free ops mempool */
+	if (params.op_mpool != NULL) {
+		RTE_LOG(DEBUG, USER1, "EVENT_CRYPTO_SYM_OP_POOL count %u\n",
+		rte_mempool_avail_count(params.op_mpool));
+		rte_mempool_free(params.op_mpool);
+		params.op_mpool = NULL;
+	}
+}
+
+static void
+eventdev_teardown(void)
+{
+	rte_event_dev_stop(evdev);
+}
+
+static void
+testsuite_teardown(void)
+{
+	crypto_teardown();
+	eventdev_teardown();
+}
+
+static struct unit_test_suite service_tests  = {
+	.suite_name = "Event crypto adapter test suite",
+	.setup = testsuite_setup,
+	.teardown = testsuite_teardown,
+	.unit_test_cases = {
+
+		TEST_CASE_ST(NULL, test_crypto_adapter_free,
+				test_crypto_adapter_create),
+
+		TEST_CASE_ST(test_crypto_adapter_create,
+				test_crypto_adapter_free,
+				test_crypto_adapter_qp_add_del),
+
+		TEST_CASE_ST(test_crypto_adapter_create,
+				test_crypto_adapter_free,
+				test_crypto_adapter_stats),
+
+		TEST_CASE_ST(test_crypto_adapter_conf_op_forward_mode,
+				test_crypto_adapter_stop,
+				test_session_with_op_forward_mode),
+
+		TEST_CASE_ST(test_crypto_adapter_conf_op_forward_mode,
+				test_crypto_adapter_stop,
+				test_sessionless_with_op_forward_mode),
+
+		TEST_CASE_ST(test_crypto_adapter_conf_op_new_mode,
+				test_crypto_adapter_stop,
+				test_session_with_op_new_mode),
+
+		TEST_CASE_ST(test_crypto_adapter_conf_op_new_mode,
+				test_crypto_adapter_stop,
+				test_sessionless_with_op_new_mode),
+
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	}
+};
+
+static int
+test_event_crypto_adapter(void)
+{
+	return unit_test_suite_runner(&service_tests);
+}
+
+REGISTER_TEST_COMMAND(event_crypto_adapter_autotest,
+		test_event_crypto_adapter);
-- 
1.9.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [v3,5/5] doc: add event crypto adapter documentation
  2018-05-05 18:47 [dpdk-dev] [v3,0/5] eventdev: cover letter - crypto adapter Abhinandan Gujjar
                   ` (3 preceding siblings ...)
  2018-05-05 18:47 ` [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test Abhinandan Gujjar
@ 2018-05-05 18:47 ` Abhinandan Gujjar
  2018-05-07 12:27   ` [dpdk-dev] [v3, 5/5] " Jerin Jacob
  4 siblings, 1 reply; 23+ messages in thread
From: Abhinandan Gujjar @ 2018-05-05 18:47 UTC (permalink / raw)
  To: jerin.jacob, hemant.agrawal, akhil.goyal, dev
  Cc: narender.vangati, abhinandan.gujjar, nikhil.rao, gage.eads

Add entries in the programmer's guide, API index, maintainer's file
and release notes for the event crypto adapter.

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 MAINTAINERS                                        |    1 +
 doc/api/doxy-api-index.md                          |    1 +
 doc/guides/prog_guide/event_crypto_adapter.rst     |  244 +++++
 .../img/event_crypto_adapter_op_forward.svg        | 1073 ++++++++++++++++++++
 .../prog_guide/img/event_crypto_adapter_op_new.svg |  968 ++++++++++++++++++
 doc/guides/prog_guide/index.rst                    |    1 +
 doc/guides/rel_notes/release_18_05.rst             |    6 +
 7 files changed, 2294 insertions(+)
 create mode 100644 doc/guides/prog_guide/event_crypto_adapter.rst
 create mode 100644 doc/guides/prog_guide/img/event_crypto_adapter_op_forward.svg
 create mode 100644 doc/guides/prog_guide/img/event_crypto_adapter_op_new.svg

diff --git a/MAINTAINERS b/MAINTAINERS
index 60ebef7..ea5dc40 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -367,6 +367,7 @@ M: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
 T: git://dpdk.org/next/dpdk-next-eventdev
 F: lib/librte_eventdev/*crypto_adapter*
 F: test/test/test_event_crypto_adapter.c
+F: doc/guides/prog_guide/event_crypto_adapter.rst
 
 Raw device API - EXPERIMENTAL
 M: Shreyansh Jain <shreyansh.jain@nxp.com>
diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 26ce7b4..0162bb7 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -21,6 +21,7 @@ The public API headers are grouped by topics:
   [eventdev]           (@ref rte_eventdev.h),
   [event_eth_rx_adapter]   (@ref rte_event_eth_rx_adapter.h),
   [event_timer_adapter]    (@ref rte_event_timer_adapter.h),
+  [event_crypto_adapter]   (@ref rte_event_crypto_adapter.h),
   [rawdev]             (@ref rte_rawdev.h),
   [metrics]            (@ref rte_metrics.h),
   [bitrate]            (@ref rte_bitrate.h),
diff --git a/doc/guides/prog_guide/event_crypto_adapter.rst b/doc/guides/prog_guide/event_crypto_adapter.rst
new file mode 100644
index 0000000..899f393
--- /dev/null
+++ b/doc/guides/prog_guide/event_crypto_adapter.rst
@@ -0,0 +1,244 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2018 Intel Corporation.
+
+Event Crypto Adapter Library
+============================
+
+The DPDK Event device library :doc:`<eventdev>`provides event driven
+programming model with features to schedule events. The cryptodev
+library :doc:`<cryptodev_lib>` provides interface to crypto poll mode
+drivers which supports different crypto operations. The Event Crypto
+Adapter is one of the event adapter which is intended to bridge between
+event devices and crypto device.
+
+The packet flow from crypto device to the event device can be accomplished
+using both SW and HW based transfer mechanisms.
+The Adapter queries an eventdev PMD to determine which mechanism to be used.
+The adapter uses an EAL service core function for SW based packet transfer
+and uses the eventdev PMD functions to configure HW based packet transfer
+between the crypto device and the event device.
+
+Crypto adapter uses a new event type called ``RTE_EVENT_TYPE_CRYPTODEV``
+to indicate the event source.
+
+API Overview
+------------
+
+This section has a brief introduction to the event crypto adapter APIs.
+The application is expected to create an adapter which is associated with
+a single eventdev, then add cryptodev and queue pair to the adapter instance.
+
+Adapter can be started in ``RTE_EVENT_CRYPTO_ADAPTER_OP_NEW`` or
+``RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD`` mode.
+In the first mode, application submits crypto operations directly to the crypto device.
+Adapter only dequeues crypto completions and enqueues them as events to the event device.
+
+.. figure:: img/event_crypto_adapter_op_new.*
+
+In the second mode, application enqueues crypto operations as events to the event device.
+The crypto adapter dequeues events and submits crypto operations to the crypto device.
+After the crypto completions, adapter enqueues them as events to the event device.
+
+.. figure:: img/event_crypto_adapter_op_forward.*
+
+Create an adapter instance
+--------------------------
+
+An adapter instance is created using ``rte_event_crypto_adapter_create()``. This
+function is called with event device to be associated with the adapter and port
+configuration for the adapter to setup an event port(if the adapter needs to use
+a service function).
+
+.. code-block:: c
+
+        int err;
+        uint8_t dev_id, id;
+        struct rte_event_dev_info dev_info;
+        struct rte_event_port_conf conf;
+        enum rte_event_crypto_adapter_mode mode;
+
+        err = rte_event_dev_info_get(id, &dev_info);
+
+        conf.new_event_threshold = dev_info.max_num_events;
+        conf.dequeue_depth = dev_info.max_event_port_dequeue_depth;
+        conf.enqueue_depth = dev_info.max_event_port_enqueue_depth;
+	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
+        err = rte_event_crypto_adapter_create(id, dev_id, &conf, mode);
+
+If the application desires to have finer control of eventdev port allocation
+and setup, it can use the ``rte_event_crypto_adapter_create_ext()`` function.
+The ``rte_event_crypto_adapter_create_ext()`` function is passed as a callback
+function. The callback function is invoked if the adapter needs to use a
+service function and needs to create an event port for it. The callback is
+expected to fill the ``struct rte_event_crypto_adapter_conf`` structure
+passed to it.
+
+For OP_FORWARD mode, the event port created by adapter can be retrieved using
+``rte_event_crypto_adapter_event_port_get()`` API.
+Application can use this event port to link with event queue on which it
+enqueues events towards the crypto adapter.
+
+.. code-block:: c
+
+        uint8_t id, evdev, crypto_ev_port_id, app_qid;
+        struct rte_event ev;
+        int ret;
+
+        ret = rte_event_crypto_adapter_event_port_get(id, &crypto_ev_port_id);
+        ret = rte_event_queue_setup(evdev, app_qid, NULL);
+        ret = rte_event_port_link(evdev, crypto_ev_port_id, &app_qid, NULL, 1);
+
+        /* Fill in event info and update event_ptr with rte_crypto_op */
+        memset(&ev, 0, sizeof(ev));
+        ev.queue_id = app_qid;
+        .
+        .
+        ev.event_ptr = op;
+        ret = rte_event_enqueue_burst(evdev, app_ev_port_id, ev, nb_events);
+
+
+Adding queue pair to the adapter instance
+-----------------------------------------
+
+Cryptodev device id and queue pair are created using cryptodev APIs.
+For more information see :doc:`here  <cryptodev_lib>`.
+
+.. code-block:: c
+
+        struct rte_cryptodev_config conf;
+        struct rte_cryptodev_qp_conf qp_conf;
+        uint8_t cdev_id = 0;
+        uint16_t qp_id = 0;
+
+        rte_cryptodev_configure(cdev_id, &conf);
+        rte_cryptodev_queue_pair_setup(cdev_id, qp_id, &qp_conf);
+
+These cryptodev id and queue pair are added to the instance using the
+``rte_event_crypto_adapter_queue_pair_add()`` function.
+The same is removed using ``rte_event_crypto_adapter_queue_pair_del()``.
+
+.. code-block:: c
+
+        struct rte_event_crypto_queue_pair_conf conf;
+
+        rte_event_crypto_adapter_queue_pair_add(id, cdev_id, qp_id, &conf);
+
+
+Querying adapter capabilities
+-----------------------------
+
+The ``rte_event_crypto_adapter_caps_get()`` function allows
+the application to query the adapter capabilities for an eventdev and cryptodev
+combination. This API provides whether cryptodev and eventdev are connected using
+internal HW port or not.
+
+.. code-block:: c
+
+        rte_event_crypto_adapter_caps_get(dev_id, cdev_id, &cap);
+
+
+Configure the service function
+------------------------------
+
+If the adapter uses a service function, the application is required to assign
+a service core to the service function as show below.
+
+.. code-block:: c
+
+        uint32_t service_id;
+
+        if (rte_event_crypto_adapter_service_id_get(id, &service_id) == 0)
+                rte_service_map_lcore_set(service_id, CORE_ID);
+
+
+Set event request/response information
+--------------------------------------
+
+In the OP_FORWARD mode, the application needs to specify the cryptodev ID
+and queue pair ID (request information) in addition to the event
+information (response information) needed to enqueue an event after
+the crypto operation has completed. The request and response information
+are specified in the ``struct rte_crypto_op`` private data or session's
+private data.
+
+In the OP_NEW mode, the application is required to provide only the
+response information.
+
+The SW adapter or HW PMD uses ``rte_crypto_op::sess_type`` to
+decide whether request/response data is located in the crypto session/
+crypto security session or at an offset in the ``struct rte_crypto_op``.
+The ``rte_crypto_op::private_data_offset`` is used to locate the request/
+response in the ``rte_crypto_op``.
+
+For crypto session, ``rte_cryptodev_sym_session_set_private_data()`` API
+will be used to set request/response data. The same data will be obtained
+by ``rte_cryptodev_sym_session_get_private_data()`` API.  The
+RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA capability indicates
+whether HW or SW supports this feature.
+
+For security session, ``rte_security_session_set_private_data()`` API
+will be used to set request/response data. The same data will be obtained
+by ``rte_security_session_get_private_data()`` API.
+
+For session-less it is mandatory to place the request/response data with
+the ``rte_crypto_op``.
+
+.. code-block:: c
+
+        union rte_event_crypto_metadata m_data;
+        struct rte_event ev;
+        struct rte_crypto_op *op;
+
+        /* Allocate & fill op structure */
+        op = rte_crypto_op_alloc();
+
+        memset(&m_data, 0, sizeof(m_data));
+        memset(&ev, 0, sizeof(ev));
+        /* Fill event information and update event_ptr to rte_crypto_op */
+        ev.event_ptr = op;
+
+        if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
+                /* Copy response information */
+                rte_memcpy(&m_data.response_info, &ev, sizeof(ev));
+                /* Copy request information */
+                m_data.request_info.cdev_id = cdev_id;
+                m_data.request_info.queue_pair_id = qp_id;
+                /* Call set API to store private data information */
+                rte_cryptodev_sym_session_set_private_data(
+                        op->sym->session,
+                        &m_data,
+                        sizeof(m_data));
+        } if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
+                uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH +
+                               (sizeof(struct rte_crypto_sym_xform) * 2);
+                op->private_data_offset = len;
+                /* Copy response information */
+                rte_memcpy(&m_data.response_info, &ev, sizeof(ev));
+                /* Copy request information */
+                m_data.request_info.cdev_id = cdev_id;
+                m_data.request_info.queue_pair_id = qp_id;
+                /* Store private data information along with rte_crypto_op */
+                rte_memcpy(op + len, &m_data, sizeof(m_data));
+        }
+
+Start the adapter instance
+--------------------------
+
+The application calls ``rte_event_crypto_adapter_start()`` to start the adapter.
+This function calls the start callbacks of the eventdev PMDs for hardware based
+eventdev-cryptodev connections and ``rte_service_run_state_set()`` to enable the
+service function if one exists.
+
+.. code-block:: c
+
+        rte_event_crypto_adapter_start(id, mode);
+
+
+Get adapter statistics
+----------------------
+
+The  ``rte_event_crypto_adapter_stats_get()`` function reports counters defined
+in struct ``rte_event_crypto_adapter_stats``. The received packet and
+enqueued event counts are a sum of the counts from the eventdev PMD callbacks
+if the callback is supported, and the counts maintained by the service function,
+if one exists.
diff --git a/doc/guides/prog_guide/img/event_crypto_adapter_op_forward.svg b/doc/guides/prog_guide/img/event_crypto_adapter_op_forward.svg
new file mode 100644
index 0000000..38be6a2
--- /dev/null
+++ b/doc/guides/prog_guide/img/event_crypto_adapter_op_forward.svg
@@ -0,0 +1,1073 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="720px"
+   height="486px"
+   id="svg13237"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="event_crypto_adapter_enq_deq.svg">
+  <defs
+     id="defs13239">
+    <marker
+       inkscape:stockid="Arrow1Sstart"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Sstart"
+       style="overflow:visible">
+      <path
+         id="path8416"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.2) translate(6,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Send"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Send"
+       style="overflow:visible;">
+      <path
+         id="path8419"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
+         transform="scale(0.2) rotate(180) translate(6,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="DiamondL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="DiamondL"
+       style="overflow:visible">
+      <path
+         id="path8483"
+         d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8)" />
+    </marker>
+    <marker
+       inkscape:stockid="DotL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="DotL"
+       style="overflow:visible">
+      <path
+         id="path8465"
+         d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8) translate(7.4, 1)" />
+    </marker>
+    <marker
+       inkscape:stockid="SquareL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="SquareL"
+       style="overflow:visible">
+      <path
+         id="path8474"
+         d="M -5.0,-5.0 L -5.0,5.0 L 5.0,5.0 L 5.0,-5.0 L -5.0,-5.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8)" />
+    </marker>
+    <marker
+       inkscape:stockid="TriangleOutL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="TriangleOutL"
+       style="overflow:visible">
+      <path
+         id="path8546"
+         d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lstart"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Lstart"
+       style="overflow:visible">
+      <path
+         id="path8404"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8) translate(12.5,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Mend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Mend"
+       style="overflow:visible;">
+      <path
+         id="path8413"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
+         transform="scale(0.4) rotate(180) translate(10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow2Lend"
+       style="overflow:visible;">
+      <path
+         id="path8425"
+         style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+         d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+         transform="scale(1.1) rotate(180) translate(1,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Lend"
+       style="overflow:visible;">
+      <path
+         id="path8407"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
+         transform="scale(0.8) rotate(180) translate(12.5,0)" />
+    </marker>
+    <filter
+       id="filter_2"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15" />
+    </filter>
+    <filter
+       id="filter_2-3"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1" />
+    </filter>
+    <filter
+       id="filter_2-0"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-7" />
+    </filter>
+    <filter
+       id="filter_2-0-8"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-7-7" />
+    </filter>
+    <filter
+       id="filter_2-3-9"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1-6" />
+    </filter>
+    <filter
+       id="filter_2-3-6"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1-63" />
+    </filter>
+    <filter
+       id="filter_2-3-91"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1-3" />
+    </filter>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-5"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-3"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-6"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-0"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lstart"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lstart-7"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8404-0"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(0.8,0,0,0.8,10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-51"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-1"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-3"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-6"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-62"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-9"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-2"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-7"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lstart"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lstart-7-9"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8404-0-3"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(0.8,0,0,0.8,10,0)" />
+    </marker>
+    <filter
+       id="filter_2-3-6-1"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1-63-8" />
+    </filter>
+    <filter
+       id="filter_2-3-92"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1-2" />
+    </filter>
+    <filter
+       id="filter_2-3-94"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1-7" />
+    </filter>
+    <marker
+       inkscape:stockid="Arrow1Lstart"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lstart-7-6"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8404-0-1"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(0.8,0,0,0.8,10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-55"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-4"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="356.77003"
+     inkscape:cy="290.74194"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1200"
+     inkscape:window-height="898"
+     inkscape:window-x="0"
+     inkscape:window-y="31"
+     inkscape:window-maximized="1"
+     inkscape:snap-nodes="false">
+    <inkscape:grid
+       type="xygrid"
+       id="grid13454" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata13242">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <g
+       style="font-size:12px;fill:none;stroke-linecap:square;stroke-miterlimit:3;overflow:visible"
+       id="shape1-1-2-4"
+       v:mID="1"
+       v:groupContext="shape"
+       transform="matrix(2.1604167,0,0,1.5671361,88.874699,-812.39909)">
+      <title
+         id="title22-7-5">Square</title>
+      <desc
+         id="desc24-7-8">Atomic Queue #1</desc>
+      <v:userDefs>
+        <v:ud
+           v:nameU="visVersion"
+           v:val="VT0(15):26" />
+      </v:userDefs>
+      <v:textBlock
+         v:margins="rect(4,4,4,4)" />
+      <v:textRect
+         cx="30.75"
+         cy="581.25"
+         width="61.5"
+         height="61.5" />
+      <g
+         id="shadow1-2-9-5"
+         v:groupContext="shadow"
+         v:shadowOffsetX="0.345598"
+         v:shadowOffsetY="-1.97279"
+         v:shadowType="1"
+         transform="translate(0.345598,1.97279)"
+         class="st1"
+         style="visibility:visible">
+        <rect
+           x="0"
+           y="550.5"
+           width="61.5"
+           height="61.5"
+           class="st2"
+           id="rect27-8-7"
+           style="fill:#5b9bd5;fill-opacity:0.22000002;stroke:#5b9bd5;stroke-opacity:0.22000002;filter:url(#filter_2-3-91)" />
+      </g>
+      <g
+         id="g13515-33">
+        <g
+           id="g13534-8">
+          <rect
+             x="0"
+             y="550.5"
+             width="61.5"
+             height="61.5"
+             class="st3"
+             id="rect29-1-95"
+             style="fill:#5b9bd5;stroke:#c7c8c8;stroke-width:0.25" />
+        </g>
+      </g>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.71226478;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:url(#Arrow1Lstart-7);marker-end:none"
+       d="m 312.28671,240.74335 -84.28774,0"
+       id="path17209"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.71898615px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow1Lend)"
+       d="m 221.6484,77.57125 94.28101,0"
+       id="path17209-8"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <g
+       style="font-size:12px;fill:none;stroke-linecap:square;stroke-miterlimit:3;overflow:visible"
+       id="shape1-1-2"
+       v:mID="1"
+       v:groupContext="shape"
+       transform="matrix(2.1604167,0,0,1.5671361,314.24227,-811.89589)">
+      <title
+         id="title22-7">Square</title>
+      <desc
+         id="desc24-7">Atomic Queue #1</desc>
+      <v:userDefs>
+        <v:ud
+           v:nameU="visVersion"
+           v:val="VT0(15):26" />
+      </v:userDefs>
+      <v:textBlock
+         v:margins="rect(4,4,4,4)" />
+      <v:textRect
+         cx="30.75"
+         cy="581.25"
+         width="61.5"
+         height="61.5" />
+      <g
+         id="shadow1-2-9"
+         v:groupContext="shadow"
+         v:shadowOffsetX="0.345598"
+         v:shadowOffsetY="-1.97279"
+         v:shadowType="1"
+         transform="translate(0.345598,1.97279)"
+         class="st1"
+         style="visibility:visible">
+        <rect
+           x="0"
+           y="550.5"
+           width="61.5"
+           height="61.5"
+           class="st2"
+           id="rect27-8"
+           style="fill:#5b9bd5;fill-opacity:0.22000002;stroke:#5b9bd5;stroke-opacity:0.22000002;filter:url(#filter_2-3)" />
+      </g>
+      <g
+         id="g13515">
+        <g
+           id="g13534">
+          <rect
+             x="0"
+             y="550.5"
+             width="61.5"
+             height="61.5"
+             class="st3"
+             id="rect29-1"
+             style="fill:#5b9bd5;stroke:#c7c8c8;stroke-width:0.25" />
+        </g>
+      </g>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.72471404;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:url(#Arrow1Lstart);marker-end:none"
+       d="m 89.025329,74.39932 -64.275286,0"
+       id="path17209-3"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,-4.325033,28.642983)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-3"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,-1.93108,192.80833)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-1"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.75141162;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:url(#Arrow1Lstart-7);marker-end:none"
+       d="m 18.763392,120.7432 68.995153,0"
+       id="path17209-3-0"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z"
+       transform="matrix(0.73232502,0,0,0.75477602,-218.16394,72.68276)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-2"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z"
+       transform="matrix(0.73232502,0,0,0.75477602,-217.40136,26.716271)" />
+    <g
+       id="g29167-4"
+       transform="matrix(0.73232502,0,0,0.75477602,-217.31662,28.007562)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-9"
+           sodipodi:role="line">1</tspan></text>
+    </g>
+    <g
+       id="g29167-9"
+       transform="matrix(0.73232502,0,0,0.75477602,-4.9726112,28.689051)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-3"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-3"
+           sodipodi:role="line">2</tspan></text>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.67803264px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow1Lstart-7);marker-end:none"
+       d="m 181,214.66098 0,-69.32196"
+       id="path17211-7-1-6"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <g
+       id="g29167"
+       transform="matrix(0.73232502,0,0,0.75477602,-218.07919,73.10621)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165"
+           sodipodi:role="line">8</tspan></text>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.67803264px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow1Lstart-7);marker-end:none"
+       d="m 131,145.8531 0,69.32197"
+       id="path17211-7-1"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,-140.37076,129.97088)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-8"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <g
+       id="g29167-2"
+       transform="matrix(0.73232502,0,0,0.75477602,-140.28602,131.01695)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-92"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-8"
+           sodipodi:role="line">7</tspan></text>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.71898615px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow1Lend)"
+       d="m 317.1405,116 -94.281,0"
+       id="path17209-8-0"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,-3.4914,66.68745)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-6"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <g
+       id="g29167-46"
+       transform="matrix(0.73232502,0,0,0.75477602,-4.40666,67.48829)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-1"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-5"
+           sodipodi:role="line">3</tspan></text>
+    </g>
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,-90.692582,130.31695)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-8-6"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <g
+       id="g29167-6"
+       transform="matrix(0.73232502,0,0,0.75477602,-90.84634,131.60918)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-17"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-2"
+           sodipodi:role="line">4</tspan></text>
+    </g>
+    <g
+       id="g29167-2-0"
+       transform="matrix(0.73232502,0,0,0.75477602,-2.424397,194.0216)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-92-6"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-8-2"
+           sodipodi:role="line">5</tspan></text>
+    </g>
+    <g
+       style="font-size:12px;fill:none;stroke-linecap:square;stroke-miterlimit:3;overflow:visible"
+       id="shape1-1-2-8"
+       v:mID="1"
+       v:groupContext="shape"
+       transform="matrix(2.1604167,0,0,1.5671361,93.82055,-648.98949)">
+      <title
+         id="title22-7-97">Square</title>
+      <desc
+         id="desc24-7-3">Atomic Queue #1</desc>
+      <v:userDefs>
+        <v:ud
+           v:nameU="visVersion"
+           v:val="VT0(15):26" />
+      </v:userDefs>
+      <v:textBlock
+         v:margins="rect(4,4,4,4)" />
+      <v:textRect
+         cx="30.75"
+         cy="581.25"
+         width="61.5"
+         height="61.5" />
+      <g
+         id="shadow1-2-9-6"
+         v:groupContext="shadow"
+         v:shadowOffsetX="0.345598"
+         v:shadowOffsetY="-1.97279"
+         v:shadowType="1"
+         transform="translate(0.345598,1.97279)"
+         class="st1"
+         style="visibility:visible">
+        <rect
+           x="0"
+           y="550.5"
+           width="61.5"
+           height="61.5"
+           class="st2"
+           id="rect27-8-12"
+           style="fill:#5b9bd5;fill-opacity:0.22000002;stroke:#5b9bd5;stroke-opacity:0.22000002;filter:url(#filter_2-3-92)" />
+      </g>
+      <g
+         id="g13515-9">
+        <g
+           id="g13534-3">
+          <rect
+             x="0"
+             y="550.5"
+             width="61.5"
+             height="61.5"
+             class="st3"
+             id="rect29-1-1"
+             style="fill:#5b9bd5;stroke:#c7c8c8;stroke-width:0.25" />
+        </g>
+      </g>
+    </g>
+    <g
+       style="font-size:12px;fill:none;stroke-linecap:square;stroke-miterlimit:3;overflow:visible"
+       id="shape1-1-2-84"
+       v:mID="1"
+       v:groupContext="shape"
+       transform="matrix(2.1604167,0,0,1.5671361,314.82055,-648.98949)">
+      <title
+         id="title22-7-50">Square</title>
+      <desc
+         id="desc24-7-36">Atomic Queue #1</desc>
+      <v:userDefs>
+        <v:ud
+           v:nameU="visVersion"
+           v:val="VT0(15):26" />
+      </v:userDefs>
+      <v:textBlock
+         v:margins="rect(4,4,4,4)" />
+      <v:textRect
+         cx="30.75"
+         cy="581.25"
+         width="61.5"
+         height="61.5" />
+      <g
+         id="shadow1-2-9-1"
+         v:groupContext="shadow"
+         v:shadowOffsetX="0.345598"
+         v:shadowOffsetY="-1.97279"
+         v:shadowType="1"
+         transform="translate(0.345598,1.97279)"
+         class="st1"
+         style="visibility:visible">
+        <rect
+           x="0"
+           y="550.5"
+           width="61.5"
+           height="61.5"
+           class="st2"
+           id="rect27-8-0"
+           style="fill:#5b9bd5;fill-opacity:0.22000002;stroke:#5b9bd5;stroke-opacity:0.22000002;filter:url(#filter_2-3-94)" />
+      </g>
+      <g
+         id="g13515-6">
+        <g
+           id="g13534-32">
+          <rect
+             x="0"
+             y="550.5"
+             width="61.5"
+             height="61.5"
+             class="st3"
+             id="rect29-1-0"
+             style="fill:#5b9bd5;stroke:#c7c8c8;stroke-width:0.25" />
+        </g>
+      </g>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.71226478;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:none;marker-end:url(#Arrow1Lend)"
+       d="m 313.14387,285 -84.28774,0"
+       id="path17209-7"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,-2.692582,236.31695)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-1-6"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <g
+       id="g29167-2-0-5"
+       transform="matrix(0.73232502,0,0,0.75477602,-2.424397,237.0216)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-92-6-6"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-8-2-9"
+           sodipodi:role="line">6</tspan></text>
+    </g>
+    <g
+       id="g29167-4-3"
+       transform="matrix(0.73232502,0,0,0.75477602,-154.60784,51.117791)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9-6"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:24.21093369px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-9-7"
+           sodipodi:role="line">Eventdev</tspan></text>
+    </g>
+    <g
+       id="g29167-4-3-5"
+       transform="matrix(0.73232502,0,0,0.75477602,-144.65044,201.97821)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9-6-3"
+         y="70"
+         x="412.93716"
+         style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:24.21093369px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="412.93716"
+           id="tspan29165-9-7-5"
+           sodipodi:role="line">Crypto</tspan><tspan
+           style="font-size:24.21093369px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="100.26366"
+           x="412.93716"
+           sodipodi:role="line"
+           id="tspan3201">Adapter</tspan></text>
+    </g>
+    <g
+       id="g29167-4-3-5-6"
+       transform="matrix(0.73232502,0,0,0.75477602,77.53518,40.62529)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9-6-3-2"
+         y="70"
+         x="412.93716"
+         style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:24.21093369px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="412.93716"
+           id="tspan29165-9-7-5-9"
+           sodipodi:role="line">Ordered</tspan><tspan
+           style="font-size:24.21093369px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="100.26366"
+           x="412.93716"
+           sodipodi:role="line"
+           id="tspan3201-1">stage</tspan></text>
+    </g>
+    <g
+       id="g29167-4-3-5-2"
+       transform="matrix(0.73232502,0,0,0.75477602,77.535182,213.62529)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9-6-3-7"
+         y="70"
+         x="412.93716"
+         style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:24.21093369px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="412.93716"
+           sodipodi:role="line"
+           id="tspan3201-9">Cryptodev</tspan></text>
+    </g>
+    <g
+       id="g29167-4-3-5-3"
+       transform="matrix(0.73232502,0,0,0.75477602,188.53518,-3.37471)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9-6-3-6"
+         y="70"
+         x="375.65271"
+         style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3201-6">1. Events from the previous stage.</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="93.538406"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3260"></tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="117.07681"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3262">2. Application in ordered stage</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="140.61522"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3288">    dequeues events from eventdev.</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="164.15363"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3264"></tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="187.69203"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3266">3. Application enqueues crypto</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="211.23044"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3290">    operations as events to eventdev.</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="234.76884"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3268"></tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="258.30725"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3270">4. Crypto adapter dequeues event</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="281.84564"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3292">    from eventdev.</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="305.38406"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3272"></tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="328.92245"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3274">5. Crypto adapter submits crypto</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="352.46088"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3294">    operations to cryptodev (Atomic</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="375.99927"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3296">    stage)</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="399.53769"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3276"></tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="423.07608"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3278">6. Crypto adapter dequeues crypto</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="446.6145"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3298">    completions from cryptodev</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="470.15289"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3280"></tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="493.69131"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3282">7. Crypto adapter enqueues events</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="517.22974"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3300">    to the eventdev</tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="540.76813"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3284"></tspan><tspan
+           style="font-size:18.83072472px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="564.30652"
+           x="375.65271"
+           sodipodi:role="line"
+           id="tspan3286">8. Events to the next stage</tspan></text>
+    </g>
+  </g>
+</svg>
diff --git a/doc/guides/prog_guide/img/event_crypto_adapter_op_new.svg b/doc/guides/prog_guide/img/event_crypto_adapter_op_new.svg
new file mode 100644
index 0000000..c87321f
--- /dev/null
+++ b/doc/guides/prog_guide/img/event_crypto_adapter_op_new.svg
@@ -0,0 +1,968 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="720px"
+   height="486px"
+   id="svg13237"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   sodipodi:docname="event_crypto_adapter_deq_only.svg">
+  <defs
+     id="defs13239">
+    <marker
+       inkscape:stockid="Arrow1Sstart"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Sstart"
+       style="overflow:visible">
+      <path
+         id="path8416"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.2) translate(6,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Send"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Send"
+       style="overflow:visible;">
+      <path
+         id="path8419"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
+         transform="scale(0.2) rotate(180) translate(6,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="DiamondL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="DiamondL"
+       style="overflow:visible">
+      <path
+         id="path8483"
+         d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8)" />
+    </marker>
+    <marker
+       inkscape:stockid="DotL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="DotL"
+       style="overflow:visible">
+      <path
+         id="path8465"
+         d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8) translate(7.4, 1)" />
+    </marker>
+    <marker
+       inkscape:stockid="SquareL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="SquareL"
+       style="overflow:visible">
+      <path
+         id="path8474"
+         d="M -5.0,-5.0 L -5.0,5.0 L 5.0,5.0 L 5.0,-5.0 L -5.0,-5.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8)" />
+    </marker>
+    <marker
+       inkscape:stockid="TriangleOutL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="TriangleOutL"
+       style="overflow:visible">
+      <path
+         id="path8546"
+         d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lstart"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Lstart"
+       style="overflow:visible">
+      <path
+         id="path8404"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+         transform="scale(0.8) translate(12.5,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Mend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Mend"
+       style="overflow:visible;">
+      <path
+         id="path8413"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
+         transform="scale(0.4) rotate(180) translate(10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow2Lend"
+       style="overflow:visible;">
+      <path
+         id="path8425"
+         style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+         d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+         transform="scale(1.1) rotate(180) translate(1,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Lend"
+       style="overflow:visible;">
+      <path
+         id="path8407"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
+         transform="scale(0.8) rotate(180) translate(12.5,0)" />
+    </marker>
+    <filter
+       id="filter_2"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15" />
+    </filter>
+    <filter
+       id="filter_2-3"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1" />
+    </filter>
+    <filter
+       id="filter_2-0"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-7" />
+    </filter>
+    <filter
+       id="filter_2-0-8"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-7-7" />
+    </filter>
+    <filter
+       id="filter_2-3-9"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1-6" />
+    </filter>
+    <filter
+       id="filter_2-3-6"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1-63" />
+    </filter>
+    <filter
+       id="filter_2-3-91"
+       color-interpolation-filters="sRGB">
+      <feGaussianBlur
+         stdDeviation="2"
+         id="feGaussianBlur15-1-3" />
+    </filter>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-5"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-3"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-6"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-0"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lstart"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lstart-7"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8404-0"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(0.8,0,0,0.8,10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-51"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-1"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-3"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-6"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-62"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-9"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend-2"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path8407-7"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+    </marker>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="356.77003"
+     inkscape:cy="236.69667"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1200"
+     inkscape:window-height="898"
+     inkscape:window-x="0"
+     inkscape:window-y="31"
+     inkscape:window-maximized="1"
+     inkscape:snap-nodes="false">
+    <inkscape:grid
+       type="xygrid"
+       id="grid13454" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata13242">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <g
+       style="font-size:12px;fill:none;stroke-linecap:square;stroke-miterlimit:3;overflow:visible"
+       id="shape1-1-2-0"
+       v:mID="1"
+       v:groupContext="shape"
+       transform="matrix(2.1604167,0,0,1.5671361,323.2187,-632.25927)">
+      <title
+         id="title22-7-6">Square</title>
+      <desc
+         id="desc24-7-4">Atomic Queue #1</desc>
+      <v:userDefs>
+        <v:ud
+           v:nameU="visVersion"
+           v:val="VT0(15):26" />
+      </v:userDefs>
+      <v:textBlock
+         v:margins="rect(4,4,4,4)" />
+      <v:textRect
+         cx="30.75"
+         cy="581.25"
+         width="61.5"
+         height="61.5" />
+      <g
+         id="shadow1-2-9-0"
+         v:groupContext="shadow"
+         v:shadowOffsetX="0.345598"
+         v:shadowOffsetY="-1.97279"
+         v:shadowType="1"
+         transform="translate(0.345598,1.97279)"
+         class="st1"
+         style="visibility:visible">
+        <rect
+           x="0"
+           y="550.5"
+           width="61.5"
+           height="61.5"
+           class="st2"
+           id="rect27-8-9"
+           style="fill:#5b9bd5;fill-opacity:0.22000002;stroke:#5b9bd5;stroke-opacity:0.22000002;filter:url(#filter_2-3-9)" />
+      </g>
+      <g
+         id="g13515-4">
+        <g
+           id="g13534-5">
+          <rect
+             x="0"
+             y="550.5"
+             width="61.5"
+             height="61.5"
+             class="st3"
+             id="rect29-1-4"
+             style="fill:#5b9bd5;stroke:#c7c8c8;stroke-width:0.25" />
+        </g>
+      </g>
+    </g>
+    <g
+       style="font-size:12px;fill:none;stroke-linecap:square;stroke-miterlimit:3;overflow:visible"
+       id="shape1-1-2-4"
+       v:mID="1"
+       v:groupContext="shape"
+       transform="matrix(2.1604167,0,0,1.5671361,88.874699,-812.39909)">
+      <title
+         id="title22-7-5">Square</title>
+      <desc
+         id="desc24-7-8">Atomic Queue #1</desc>
+      <v:userDefs>
+        <v:ud
+           v:nameU="visVersion"
+           v:val="VT0(15):26" />
+      </v:userDefs>
+      <v:textBlock
+         v:margins="rect(4,4,4,4)" />
+      <v:textRect
+         cx="30.75"
+         cy="581.25"
+         width="61.5"
+         height="61.5" />
+      <g
+         id="shadow1-2-9-5"
+         v:groupContext="shadow"
+         v:shadowOffsetX="0.345598"
+         v:shadowOffsetY="-1.97279"
+         v:shadowType="1"
+         transform="translate(0.345598,1.97279)"
+         class="st1"
+         style="visibility:visible">
+        <rect
+           x="0"
+           y="550.5"
+           width="61.5"
+           height="61.5"
+           class="st2"
+           id="rect27-8-7"
+           style="fill:#5b9bd5;fill-opacity:0.22000002;stroke:#5b9bd5;stroke-opacity:0.22000002;filter:url(#filter_2-3-91)" />
+      </g>
+      <g
+         id="g13515-33">
+        <g
+           id="g13534-8">
+          <rect
+             x="0"
+             y="550.5"
+             width="61.5"
+             height="61.5"
+             class="st3"
+             id="rect29-1-95"
+             style="fill:#5b9bd5;stroke:#c7c8c8;stroke-width:0.25" />
+        </g>
+      </g>
+    </g>
+    <g
+       style="font-size:12px;fill:none;stroke-linecap:square;stroke-miterlimit:3;overflow:visible"
+       id="shape1-1-2-9"
+       v:mID="1"
+       v:groupContext="shape"
+       transform="matrix(2.1604167,0,0,1.5671361,88.874699,-630.24651)">
+      <title
+         id="title22-7-9">Square</title>
+      <desc
+         id="desc24-7-5">Atomic Queue #1</desc>
+      <v:userDefs>
+        <v:ud
+           v:nameU="visVersion"
+           v:val="VT0(15):26" />
+      </v:userDefs>
+      <v:textBlock
+         v:margins="rect(4,4,4,4)" />
+      <v:textRect
+         cx="30.75"
+         cy="581.25"
+         width="61.5"
+         height="61.5" />
+      <g
+         id="shadow1-2-9-2"
+         v:groupContext="shadow"
+         v:shadowOffsetX="0.345598"
+         v:shadowOffsetY="-1.97279"
+         v:shadowType="1"
+         transform="translate(0.345598,1.97279)"
+         class="st1"
+         style="visibility:visible">
+        <rect
+           x="0"
+           y="550.5"
+           width="61.5"
+           height="61.5"
+           class="st2"
+           id="rect27-8-1"
+           style="fill:#5b9bd5;fill-opacity:0.22000002;stroke:#5b9bd5;stroke-opacity:0.22000002;filter:url(#filter_2-3-6)" />
+      </g>
+      <g
+         id="g13515-3">
+        <g
+           id="g13534-0">
+          <rect
+             x="0"
+             y="550.5"
+             width="61.5"
+             height="61.5"
+             class="st3"
+             id="rect29-1-9"
+             style="fill:#5b9bd5;stroke:#c7c8c8;stroke-width:0.25" />
+        </g>
+      </g>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.74346578px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow1Lend)"
+       d="m 220.66064,98.57125 101.22528,0"
+       id="path17209-8"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <g
+       style="font-size:12px;fill:none;stroke-linecap:square;stroke-miterlimit:3;overflow:visible"
+       id="shape1-1-2"
+       v:mID="1"
+       v:groupContext="shape"
+       transform="matrix(2.1604167,0,0,1.5671361,322.24227,-811.89589)">
+      <title
+         id="title22-7">Square</title>
+      <desc
+         id="desc24-7">Atomic Queue #1</desc>
+      <v:userDefs>
+        <v:ud
+           v:nameU="visVersion"
+           v:val="VT0(15):26" />
+      </v:userDefs>
+      <v:textBlock
+         v:margins="rect(4,4,4,4)" />
+      <v:textRect
+         cx="30.75"
+         cy="581.25"
+         width="61.5"
+         height="61.5" />
+      <g
+         id="shadow1-2-9"
+         v:groupContext="shadow"
+         v:shadowOffsetX="0.345598"
+         v:shadowOffsetY="-1.97279"
+         v:shadowType="1"
+         transform="translate(0.345598,1.97279)"
+         class="st1"
+         style="visibility:visible">
+        <rect
+           x="0"
+           y="550.5"
+           width="61.5"
+           height="61.5"
+           class="st2"
+           id="rect27-8"
+           style="fill:#5b9bd5;fill-opacity:0.22000002;stroke:#5b9bd5;stroke-opacity:0.22000002;filter:url(#filter_2-3)" />
+      </g>
+      <g
+         id="g13515">
+        <g
+           id="g13534">
+          <rect
+             x="0"
+             y="550.5"
+             width="61.5"
+             height="61.5"
+             class="st3"
+             id="rect29-1"
+             style="fill:#5b9bd5;stroke:#c7c8c8;stroke-width:0.25" />
+        </g>
+      </g>
+    </g>
+    <g
+       id="g13518"
+       transform="matrix(0.73232502,0,0,0.75477602,25.29268,348.89752)">
+      <g
+         id="g13526">
+        <flowRoot
+           xml:space="preserve"
+           id="flowRoot13464-9"
+           style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+           transform="translate(-12.00521,-129.65179)"><flowRegion
+             id="flowRegion13466-1"><rect
+               id="rect13468-2"
+               width="195.99997"
+               height="112.00001"
+               x="273.33334"
+               y="175.33333"
+               style="text-align:center;text-anchor:middle" /></flowRegion><flowPara
+             style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+             id="flowPara13511" /></flowRoot>      </g>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.75141162;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:url(#Arrow1Lstart);marker-end:none"
+       d="m 88.758545,71.39932 -68.995153,0"
+       id="path17209-3"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,-4.325033,50.642983)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-3"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.74346578px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow1Lend)"
+       d="m 322.61264,283 -101.22528,0"
+       id="path17209-8-0"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,0.0689171,234.80833)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-1"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.74346578px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
+       d="m 155,232.14235 0,-84.2847"
+       id="path17211-7-1"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,-116.37076,141.97088)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-8"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.75141162;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:url(#Arrow1Lstart-7);marker-end:none"
+       d="m 19.763392,125.7432 68.995153,0"
+       id="path17209-3-0"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z"
+       transform="matrix(0.73232502,0,0,0.75477602,-218.16394,76.68276)" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-2"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z"
+       transform="matrix(0.73232502,0,0,0.75477602,-219.40136,22.716271)" />
+    <g
+       id="g29167-4"
+       transform="matrix(0.73232502,0,0,0.75477602,-219.31662,24.007562)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-9"
+           sodipodi:role="line">1</tspan></text>
+    </g>
+    <g
+       id="g29167-9"
+       transform="matrix(0.73232502,0,0,0.75477602,-4.9726112,50.689051)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-3"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-3"
+           sodipodi:role="line">2</tspan></text>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.74346578px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
+       d="m 388.20118,147.75681 0,84.2847"
+       id="path17211-7"
+       inkscape:connector-type="orthogonal"
+       inkscape:connector-curvature="0" />
+    <path
+       transform="matrix(0.73232502,0,0,0.75477602,116.5086,136.68745)"
+       sodipodi:type="arc"
+       style="fill:#539de6;fill-opacity:1;stroke:#0000ea;stroke-width:1;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="path29161-6"
+       sodipodi:cx="371"
+       sodipodi:cy="64.5"
+       sodipodi:rx="17"
+       sodipodi:ry="15.5"
+       d="m 388,64.5 a 17,15.5 0 1 1 -34,0 17,15.5 0 1 1 34,0 z" />
+    <g
+       id="g29167-46"
+       transform="matrix(0.73232502,0,0,0.75477602,116.59334,137.48829)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-1"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-5"
+           sodipodi:role="line">3</tspan></text>
+    </g>
+    <g
+       id="g29167-6"
+       transform="matrix(0.73232502,0,0,0.75477602,0.1536639,235.60918)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-17"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-2"
+           sodipodi:role="line">4</tspan></text>
+    </g>
+    <g
+       id="g29167"
+       transform="matrix(0.73232502,0,0,0.75477602,-218.07919,77.10621)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165"
+           sodipodi:role="line">6</tspan></text>
+    </g>
+    <g
+       id="g29167-4-3"
+       transform="matrix(0.73232502,0,0,0.75477602,-117.60784,50.117791)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9-6"
+         y="70"
+         x="321.30356"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:24.21093279px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="321.30356"
+           id="tspan29165-9-7"
+           sodipodi:role="line">Eventdev</tspan></text>
+    </g>
+    <g
+       id="g29167-4-3-5"
+       transform="matrix(0.73232502,0,0,0.75477602,55.34956,26.97821)">
+      <text
+         sodipodi:linespacing="100%"
+         id="text29163-9-6-3"
+         y="70"
+         x="454.74152"
+         style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="454.74152"
+           id="tspan29165-9-7-5"
+           sodipodi:role="line">A<tspan
+   style="line-height:100%"
+   id="tspan3374">tomic stage</tspan></tspan><tspan
+           style="font-size:21.52082825000000099px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:100%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="96.901031"
+           x="454.74152"
+           sodipodi:role="line"
+           id="tspan3320">+</tspan><tspan
+           style="font-size:21.52082825000000099px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:100%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="123.80207"
+           x="454.74152"
+           sodipodi:role="line"
+           id="tspan3322">enqueue to</tspan><tspan
+           style="font-size:21.52082825000000099px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:100%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="150.70311"
+           x="454.74152"
+           sodipodi:role="line"
+           id="tspan3324">cryptodev</tspan></text>
+    </g>
+    <g
+       id="g29167-2"
+       transform="matrix(0.73232502,0,0,0.75477602,-116.28602,142.01695)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-92"
+         y="70"
+         x="365"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="365"
+           id="tspan29165-8"
+           sodipodi:role="line">5</tspan></text>
+    </g>
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3376"
+       style="fill:black;stroke:none;stroke-opacity:1;stroke-width:1px;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;font-family:Sans;font-style:normal;font-weight:normal;font-size:18px;line-height:125%;letter-spacing:0px;word-spacing:0px"><flowRegion
+         id="flowRegion3378"><rect
+           id="rect3380"
+           width="100"
+           height="37"
+           x="109"
+           y="259" /></flowRegion><flowPara
+         id="flowPara3382"></flowPara></flowRoot>    <g
+       id="g29167-4-3-1"
+       transform="matrix(0.73232502,0,0,0.75477602,109.34956,231.97821)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9-6-8"
+         y="70"
+         x="321.30356"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:24.21093369px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="321.30356"
+           id="tspan29165-9-7-7"
+           sodipodi:role="line">Cryptodev</tspan></text>
+    </g>
+    <g
+       id="g29167-4-3-1-9"
+       transform="matrix(0.73232502,0,0,0.75477602,-114.48565,222.20704)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9-6-8-2"
+         y="70"
+         x="368.01718"
+         style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:24.21093369px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="70"
+           x="368.01718"
+           id="tspan29165-9-7-7-0"
+           sodipodi:role="line">Crypto</tspan><tspan
+           style="font-size:24.21093369px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Sans;-inkscape-font-specification:Sans"
+           y="100.26366"
+           x="368.01718"
+           sodipodi:role="line"
+           id="tspan3488">adapter</tspan></text>
+    </g>
+    <g
+       id="g29167-4-3-1-9-2"
+       transform="matrix(0.73232502,0,0,0.75477602,250.96804,192.62529)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text29163-9-6-8-2-3"
+         y="-169.80624"
+         x="310.42673"
+         style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         xml:space="preserve"><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="-169.80624"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3488-5">1. Events from the previous</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="-142.90521"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3543">    stage</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="-116.00417"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3519" /><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="-89.103142"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3521">2. Application in atomic stage</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="-62.202103"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3539">    dequeues events from</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="-35.301067"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3551">    eventdev.</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="-8.400032"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3523" /><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="18.501003"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3525">3. Crypto operations are</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="45.402039"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3541">    submitted to cryptodev.</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="72.30307"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3527" /><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="99.204109"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3529">4. Crypto adapter dequeues</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="126.10514"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3545">    crypto completions from</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="153.00618"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3547">    cryptodev</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="179.90721"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3531" /><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="206.80826"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3533">5. Crypto adapter enqueues</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="233.70929"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3549">    events to the eventdev</tspan><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="260.61032"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3535" /><tspan
+           style="font-size:21.52082825px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans"
+           y="287.51135"
+           x="310.42673"
+           sodipodi:role="line"
+           id="tspan3537">6. Events to the next stage</tspan></text>
+    </g>
+  </g>
+</svg>
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index 235ad02..8a38c37 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -44,6 +44,7 @@ Programmer's Guide
     eventdev
     event_ethernet_rx_adapter
     event_timer_adapter
+    event_crypto_adapter
     qos_framework
     power_man
     packet_classif_access_ctrl
diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst
index 0ae61e8..79e60d1 100644
--- a/doc/guides/rel_notes/release_18_05.rst
+++ b/doc/guides/rel_notes/release_18_05.rst
@@ -16,6 +16,12 @@ DPDK Release 18.05
 
       xdg-open build/doc/html/guides/rel_notes/release_18_05.html
 
+* **Added Event Crypto Adapter Library.**
+
+    Added the Event Crypto Adapter Library.  This library extends the
+    event-based model by introducing APIs that allow applications to
+    enqueue/dequeue crypto operations to/from cryptodev as events scheduled
+    by an event device.
 
 New Features
 ------------
-- 
1.9.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3, 3/5] eventdev: add crypto adapter implementation
  2018-05-05 18:47 ` [dpdk-dev] [v3,3/5] eventdev: add crypto adapter implementation Abhinandan Gujjar
@ 2018-05-07  4:58   ` Jerin Jacob
  2018-05-07  6:50   ` Jerin Jacob
  1 sibling, 0 replies; 23+ messages in thread
From: Jerin Jacob @ 2018-05-07  4:58 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: hemant.agrawal, akhil.goyal, dev, narender.vangati, nikhil.rao,
	gage.eads

-----Original Message-----
> Date: Sun, 6 May 2018 00:17:08 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>  akhil.goyal@nxp.com, dev@dpdk.org
> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>  nikhil.rao@intel.com, gage.eads@intel.com
> Subject: [v3,3/5] eventdev: add crypto adapter implementation
> X-Mailer: git-send-email 1.9.1
> 
> Event crypto adapter is added to the meson build system
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> Signed-off-by: Gage Eads <gage.eads@intel.com>
> ---
>  config/common_base                             |    1 +
>  lib/Makefile                                   |    3 +-
>  lib/librte_eventdev/Makefile                   |    3 +
>  lib/librte_eventdev/meson.build                |    8 +-
>  lib/librte_eventdev/rte_event_crypto_adapter.c | 1127 ++++++++++++++++++++++++
>  lib/librte_eventdev/rte_eventdev_version.map   |   12 +
>  6 files changed, 1150 insertions(+), 4 deletions(-)
>  create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.c
> 
> diff --git a/config/common_base b/config/common_base
> index 03a8688..8420d29 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -577,6 +577,7 @@ CONFIG_RTE_LIBRTE_EVENTDEV_DEBUG=n
>  CONFIG_RTE_EVENT_MAX_DEVS=16
>  CONFIG_RTE_EVENT_MAX_QUEUES_PER_DEV=64
>  CONFIG_RTE_EVENT_TIMER_ADAPTER_NUM_MAX=32
> +CONFIG_RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE=32
>  
>  #
>  # Compile PMD for skeleton event device
> diff --git a/lib/Makefile b/lib/Makefile
> index 057bf78..efddee0 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -32,7 +32,8 @@ DEPDIRS-librte_security := librte_eal librte_mempool librte_ring librte_mbuf
>  DEPDIRS-librte_security += librte_ethdev
>  DEPDIRS-librte_security += librte_cryptodev
>  DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += librte_eventdev
> -DEPDIRS-librte_eventdev := librte_eal librte_ring librte_ethdev librte_hash librte_mempool librte_timer
> +DEPDIRS-librte_eventdev := librte_eal librte_ring librte_ether librte_hash \

This creates build break with parallel build due to unwanted rename of
librte_ethdev -> librte_ether


> +                           librte_mempool librte_timer librte_cryptodev
>  SRCS-y += rte_event_ring.c
>  SRCS-y += rte_event_eth_rx_adapter.c
>  SRCS-y += rte_event_timer_adapter.c
> +SRCS-y += rte_event_crypto_adapter.c
>  
>  # export include files
> +/* Macros to check for valid adapter */
> +#define RTE_EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \

Internal function(not exposed to public header file), Could be renamed to
EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET

> +
> diff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map
> index 3ee28f7..2c674f5 100644
> --- a/lib/librte_eventdev/rte_eventdev_version.map
> +++ b/lib/librte_eventdev/rte_eventdev_version.map
> @@ -97,4 +97,16 @@ EXPERIMENTAL {
>  	rte_event_timer_arm_burst;
>  	rte_event_timer_arm_tmo_tick_burst;
>  	rte_event_timer_cancel_burst;
> +        rte_event_crypto_adapter_create_ext;

extra space.

> +	rte_event_crypto_adapter_create;
> +	rte_event_crypto_adapter_free;
> +	rte_event_crypto_adapter_queue_pair_add;
> +	rte_event_crypto_adapter_queue_pair_del;
> +	rte_event_crypto_adapter_start;
> +	rte_event_crypto_adapter_stop;
> +	rte_event_crypto_adapter_stats_get;
> +	rte_event_crypto_adapter_stats_reset;
> +	rte_event_crypto_adapter_service_id_get;
> +	rte_event_crypto_adapter_event_port_get;

Arrange in alphabetical order.

> +
>  } DPDK_18.05;
> -- 
> 1.9.1
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test
  2018-05-05 18:47 ` [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test Abhinandan Gujjar
@ 2018-05-07  5:20   ` Jerin Jacob
  2018-05-07  5:58   ` Jerin Jacob
  2018-05-07 10:08   ` Jerin Jacob
  2 siblings, 0 replies; 23+ messages in thread
From: Jerin Jacob @ 2018-05-07  5:20 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: hemant.agrawal, akhil.goyal, dev, narender.vangati, nikhil.rao,
	gage.eads

-----Original Message-----
> Date: Sun, 6 May 2018 00:17:09 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>  akhil.goyal@nxp.com, dev@dpdk.org
> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>  nikhil.rao@intel.com, gage.eads@intel.com
> Subject: [v3,4/5] test: add event crypto adapter auto-test
> X-Mailer: git-send-email 1.9.1
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> ---
>  MAINTAINERS                           |   1 +
>  test/test/Makefile                    |   1 +
>  test/test/test_event_crypto_adapter.c | 913 ++++++++++++++++++++++++++++++++++
>  3 files changed, 915 insertions(+)
>  create mode 100644 test/test/test_event_crypto_adapter.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 991b465..60ebef7 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -366,6 +366,7 @@ Eventdev Crypto Adapter API - EXPERIMENTAL
>  M: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
>  T: git://dpdk.org/next/dpdk-next-eventdev
>  F: lib/librte_eventdev/*crypto_adapter*
> +F: test/test/test_event_crypto_adapter.c

Shared(x86_64-native-linuxapp-gcc+shared) build fails due to

test_event_crypto_adapter.o: In function
`test_crypto_adapter_qp_add_del':
test_event_crypto_adapter.c:(.text+0x43): undefined reference to
`rte_event_crypto_adapter_caps_get'
test_event_crypto_adapter.o: In function
`test_crypto_adapter_conf_op_new_mode':
test_event_crypto_adapter.c:(.text+0x16c): undefined reference to
`rte_event_crypto_adapter_caps_get'
test_event_crypto_adapter.o: In function
`test_crypto_adapter_conf_op_forward_mode':
test_event_crypto_adapter.c:(.text+0x138f): undefined reference to
`rte_event_crypto_adapter_caps_get'
test_event_crypto_adapter.o: In function `test_op_new_mode':
test_event_crypto_adapter.c:(.text+0x181c): undefined reference to
`rte_event_crypto_adapter_caps_get'
test_event_crypto_adapter.o: In function
`test_sessionless_with_op_new_mode':
test_event_crypto_adapter.c:(.text+0x2111): undefined reference to
`rte_event_crypto_adapter_caps_get'
test_event_crypto_adapter.o:test_event_crypto_adapter.c:(.text+0x2261):
more undefined references to `rte_event_crypto_adapter_caps_get' follow




>  
>  Raw device API - EXPERIMENTAL
>  M: Shreyansh Jain <shreyansh.jain@nxp.com>
> diff --git a/test/test/Makefile b/test/test/Makefile
> index 2630ab4..3a45ab2 100644
> --- a/test/test/Makefile
> +++ b/test/test/Makefile
> @@ -185,6 +185,7 @@ SRCS-y += test_eventdev.c
>  SRCS-y += test_event_ring.c
>  SRCS-y += test_event_eth_rx_adapter.c
>  SRCS-y += test_event_timer_adapter.c
> +SRCS-y += test_event_crypto_adapter.c
>  endif
>  
>  ifeq ($(CONFIG_RTE_LIBRTE_RAWDEV),y)
> diff --git a/test/test/test_event_crypto_adapter.c b/test/test/test_event_crypto_adapter.c
> new file mode 100644
> index 0000000..099adcb
> --- /dev/null
> +++ b/test/test/test_event_crypto_adapter.c
> @@ -0,0 +1,913 @@
> +static void
> +test_crypto_adapter_stop(void)
> +{
> +	uint32_t evdev_service_id, adapter_service_id;
> +
> +	/* retrieve service ids */
> +	rte_event_dev_service_id_get(evdev, &evdev_service_id);
> +	rte_event_crypto_adapter_service_id_get(
> +			TEST_ADAPTER_ID, &adapter_service_id);
> +
> +	/* stop services */
> +	rte_service_runstate_set(evdev_service_id, 0);
> +	rte_service_runstate_set(adapter_service_id, 0);
> +	rte_service_lcore_stop(slcore_id);
> +	rte_service_lcore_del(slcore_id);

In HW case, These service core wont be there. Right? So I think, you can
check the return value of rte_event_dev_service_id_get() and decide to
invoke rte_service_ runtime operations.


> +	rte_event_crypto_adapter_stop(TEST_ADAPTER_ID);
> +	rte_event_dev_stop(evdev);
> +}
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2018 Intel Corporation
> + */
> +
> +#include <string.h>
> +#include <rte_common.h>
> +#include <rte_mempool.h>
> +#include <rte_mbuf.h>
> +#include <rte_cryptodev.h>
> +#include <rte_eventdev.h>
> +#include <rte_bus_vdev.h>
> +#include <rte_service.h>
> +#include <rte_event_crypto_adapter.h>
> +#include "test.h"
> +
> +#define PKT_TRACE                  0
> +#define NUM                        1
> +#define DEFAULT_NUM_XFORMS        (2)
> +#define NUM_MBUFS                 (8191)
> +#define MBUF_CACHE_SIZE           (256)
> +#define MAXIMUM_IV_LENGTH         (16)
> +#define DEFAULT_NUM_OPS_INFLIGHT  (128)
> +#define TEST_APP_PORT_ID           0
> +#define TEST_APP_EV_QUEUE_ID       0
> +#define TEST_CRYPTO_EV_QUEUE_ID    1
> +#define TEST_ADAPTER_ID            0
> +#define TEST_CDEV_ID               0
> +#define TEST_CDEV_QP_ID            0
> +#define PACKET_LENGTH              64
> +#define NB_TEST_PORTS              1
> +#define NB_TEST_QUEUES             2
> +#define CRYPTODEV_NAME_NULL_PMD    crypto_null
> +
> +#define MBUF_SIZE              (sizeof(struct rte_mbuf) + \
> +				RTE_PKTMBUF_HEADROOM + PACKET_LENGTH)
> +#define IV_OFFSET              (sizeof(struct rte_crypto_op) + \
> +				sizeof(struct rte_crypto_sym_op) + \
> +				DEFAULT_NUM_XFORMS * \
> +				sizeof(struct rte_crypto_sym_xform))
> +
> +
> +static const uint8_t text_64B[] = {
> +	0x05, 0x15, 0x77, 0x32, 0xc9, 0x66, 0x91, 0x50,
> +	0x93, 0x9f, 0xbb, 0x4e, 0x2e, 0x5a, 0x02, 0xd0,
> +	0x2d, 0x9d, 0x31, 0x5d, 0xc8, 0x9e, 0x86, 0x36,
> +	0x54, 0x5c, 0x50, 0xe8, 0x75, 0x54, 0x74, 0x5e,
> +	0xd5, 0xa2, 0x84, 0x21, 0x2d, 0xc5, 0xf8, 0x1c,
> +	0x55, 0x1a, 0xba, 0x91, 0xce, 0xb5, 0xa3, 0x1e,
> +	0x31, 0xbf, 0xe9, 0xa1, 0x97, 0x5c, 0x2b, 0xd6,
> +	0x57, 0xa5, 0x9f, 0xab, 0xbd, 0xb0, 0x9b, 0x9c
> +};
> +
> +struct event_crypto_adapter_test_params {
> +	struct rte_mempool *mbuf_pool;
> +	struct rte_mempool *op_mpool;
> +	struct rte_mempool *session_mpool;
> +	struct rte_cryptodev_config *config;
> +	uint8_t crypto_event_port_id;
> +};
> +
> +struct rte_event response_info = {
> +	.queue_id = TEST_APP_EV_QUEUE_ID,
> +	.sched_type = RTE_SCHED_TYPE_ATOMIC,
> +	.flow_id = 0xAABB,
> +	.sub_event_type = 0,
> +	.event_type = 0,
> +	.priority = 0,
> +	.impl_opaque = 0
> +};
> +
> +struct rte_event_crypto_request request_info = {
> +	.cdev_id = TEST_CDEV_ID,
> +	.queue_pair_id = TEST_CDEV_QP_ID
> +};
> +
> +static struct event_crypto_adapter_test_params params;
> +static uint8_t crypto_adapter_setup_done;
> +static uint32_t slcore_id;
> +static int evdev;
> +
> +static struct rte_mbuf *
> +alloc_fill_mbuf(struct rte_mempool *mpool, const uint8_t *data,
> +		size_t len, uint8_t blocksize)
> +{
> +	struct rte_mbuf *m = rte_pktmbuf_alloc(mpool);
> +	size_t t_len = len - (blocksize ? (len % blocksize) : 0);
> +
> +	if (m) {
> +		char *dst = rte_pktmbuf_append(m, t_len);
> +
> +		if (!dst) {
> +			rte_pktmbuf_free(m);
> +			return NULL;
> +		}
> +
> +		rte_memcpy(dst, (const void *)data, t_len);
> +	}
> +	return m;
> +}
> +
> +static int
> +send_recv_ev(struct rte_event *ev)
> +{
> +	struct rte_crypto_op *op;
> +	struct rte_event recv_ev;
> +	int ret;
> +
> +	ret = rte_event_enqueue_burst(evdev, TEST_APP_PORT_ID, ev, NUM);
> +	TEST_ASSERT_EQUAL(ret, NUM,
> +			  "Failed to send event to crypto adapter\n");
> +
> +	while (rte_event_dequeue_burst(evdev,
> +			TEST_APP_PORT_ID, &recv_ev, NUM, 0) == 0)
> +		rte_pause();
> +
> +	op = recv_ev.event_ptr;
> +#if PKT_TRACE
> +	struct rte_mbuf *m = op->sym->m_src;
> +	rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
> +#endif
> +	rte_pktmbuf_free(op->sym->m_src);
> +	rte_crypto_op_free(op);
> +
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +test_crypto_adapter_stats(void)
> +{
> +	struct rte_event_crypto_adapter_stats stats;
> +
> +	rte_event_crypto_adapter_stats_get(TEST_ADAPTER_ID, &stats);
> +	printf(" +------------------------------------------------------+\n");
> +	printf(" + Crypto adapter stats for instance %u:\n", TEST_ADAPTER_ID);
> +	printf(" + Event port poll count          %lu\n",
> +		stats.event_poll_count);
> +	printf(" + Event dequeue count            %lu\n",
> +		stats.event_deq_count);
> +	printf(" + Cryptodev enqueue count        %lu\n",
> +		stats.crypto_enq_count);
> +	printf(" + Cryptodev enqueue failed count %lu\n",
> +		stats.crypto_enq_fail);
> +	printf(" + Cryptodev dequeue count        %lu\n",
> +		stats.crypto_deq_count);
> +	printf(" + Event enqueue count            %lu\n",
> +		stats.event_enq_count);
> +	printf(" + Event enqueue retry count      %lu\n",
> +		stats.event_enq_retry_count);
> +	printf(" + Event enqueue fail count       %lu\n",
> +		stats.event_enq_fail_count);
> +	printf(" +------------------------------------------------------+\n");
> +
> +	rte_event_crypto_adapter_stats_reset(TEST_ADAPTER_ID);
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +test_op_forward_mode(uint8_t session_less)
> +{
> +	struct rte_crypto_sym_xform cipher_xform;
> +	struct rte_cryptodev_sym_session *sess;
> +	union rte_event_crypto_metadata m_data;
> +	struct rte_crypto_sym_op *sym_op;
> +	struct rte_crypto_op *op;
> +	struct rte_mbuf *m;
> +	struct rte_event ev;
> +	uint32_t cap;
> +	int ret;
> +
> +	memset(&m_data, 0, sizeof(m_data));
> +
> +	m = alloc_fill_mbuf(params.mbuf_pool, text_64B, PACKET_LENGTH, 0);
> +	TEST_ASSERT_NOT_NULL(m, "Failed to allocate mbuf!\n");
> +#if PKT_TRACE
> +	rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
> +#endif
> +	/* Setup Cipher Parameters */
> +	cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
> +	cipher_xform.next = NULL;
> +
> +	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
> +	cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
> +
> +	op = rte_crypto_op_alloc(params.op_mpool,
> +			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
> +	TEST_ASSERT_NOT_NULL(op,
> +		"Failed to allocate symmetric crypto operation struct\n");
> +
> +	sym_op = op->sym;
> +
> +	if (!session_less) {
> +		sess = rte_cryptodev_sym_session_create(params.session_mpool);
> +		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
> +
> +		/* Create Crypto session*/
> +		rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> +				&cipher_xform, params.session_mpool);
> +
> +		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> +							evdev, &cap);
> +		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
> +			/* Fill in private date information */
> +			rte_memcpy(&m_data.response_info, &response_info,
> +				sizeof(response_info));
> +			rte_memcpy(&m_data.request_info, &request_info,
> +				sizeof(request_info));
> +			rte_cryptodev_sym_session_set_private_data(sess,
> +						&m_data, sizeof(m_data));
> +		}
> +
> +		rte_crypto_op_attach_sym_session(op, sess);
> +	} else {
> +		struct rte_crypto_sym_xform *first_xform;
> +
> +		rte_crypto_op_sym_xforms_alloc(op, NUM);
> +		op->sess_type = RTE_CRYPTO_OP_SESSIONLESS;
> +		first_xform = &cipher_xform;
> +		sym_op->xform = first_xform;
> +		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH +
> +				(sizeof(struct rte_crypto_sym_xform) * 2);
> +		op->private_data_offset = len;
> +		/* Fill in private data information */
> +		rte_memcpy(&m_data.response_info, &response_info,
> +			   sizeof(response_info));
> +		rte_memcpy(&m_data.request_info, &request_info,
> +			   sizeof(request_info));
> +		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
> +	}
> +
> +	sym_op->m_src = m;
> +	sym_op->cipher.data.offset = 0;
> +	sym_op->cipher.data.length = PACKET_LENGTH;
> +
> +	/* Fill in event info and update event_ptr with rte_crypto_op */
> +	memset(&ev, 0, sizeof(ev));
> +	ev.queue_id = TEST_CRYPTO_EV_QUEUE_ID;
> +	ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
> +	ev.flow_id = 0xAABB;
> +	ev.event_ptr = op;
> +
> +	ret = send_recv_ev(&ev);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to send/receive event to "
> +				"crypto adapter\n");
> +
> +	test_crypto_adapter_stats();
> +
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +map_adapter_service_core(void)
> +{
> +	uint32_t adapter_service_id;
> +
> +	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_service_id_get(
> +			    TEST_ADAPTER_ID, &adapter_service_id),
> +			    "Failed to get event crypto adapter service id");
> +
> +	TEST_ASSERT_SUCCESS(rte_service_map_lcore_set(adapter_service_id,
> +			slcore_id, 1), "Failed to map adapter service");
> +
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +test_sessionless_with_op_forward_mode(void)
> +{
> +	uint32_t cap;
> +	int ret;
> +
> +	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
> +		map_adapter_service_core();
> +
> +	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
> +				"Failed to start event crypto adapter");
> +
> +	ret = test_op_forward_mode(1);
> +	TEST_ASSERT_SUCCESS(ret, "Sessionless - ENQ-DEQ mode test failed\n");
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +test_session_with_op_forward_mode(void)
> +{
> +	uint32_t cap;
> +	int ret;
> +
> +	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
> +		map_adapter_service_core();
> +
> +	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID
> +				), "Failed to start event crypto adapter");
> +
> +	ret = test_op_forward_mode(0);
> +	TEST_ASSERT_SUCCESS(ret, "Session based - ENQ-DEQ mode test failed\n");
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +send_op_recv_ev(struct rte_crypto_op *op)
> +{
> +	struct rte_crypto_op *recv_op;
> +	struct rte_event ev;
> +	int ret;
> +
> +	ret = rte_cryptodev_enqueue_burst(TEST_CDEV_ID, TEST_CDEV_QP_ID,
> +					  &op, NUM);
> +	TEST_ASSERT_EQUAL(ret, NUM, "Failed to enqueue to cryptodev\n");
> +	memset(&ev, 0, sizeof(ev));
> +
> +	while (rte_event_dequeue_burst(evdev,
> +		TEST_APP_PORT_ID, &ev, NUM, 0) == 0)
> +		rte_pause();
> +
> +	recv_op = ev.event_ptr;
> +#if PKT_TRACE
> +	struct rte_mbuf *m = recv_op->sym->m_src;
> +	rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
> +#endif
> +	rte_pktmbuf_free(recv_op->sym->m_src);
> +	rte_crypto_op_free(recv_op);
> +
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +test_op_new_mode(uint8_t session_less)
> +{
> +	struct rte_crypto_sym_xform cipher_xform;
> +	struct rte_cryptodev_sym_session *sess;
> +	union rte_event_crypto_metadata m_data;
> +	struct rte_crypto_sym_op *sym_op;
> +	struct rte_crypto_op *op;
> +	struct rte_mbuf *m;
> +	uint32_t cap;
> +	int ret;
> +
> +	memset(&m_data, 0, sizeof(m_data));
> +
> +	m = alloc_fill_mbuf(params.mbuf_pool, text_64B, PACKET_LENGTH, 0);
> +	TEST_ASSERT_NOT_NULL(m, "Failed to allocate mbuf!\n");
> +#if PKT_TRACE
> +	rte_pktmbuf_dump(stdout, m, rte_pktmbuf_pkt_len(m));
> +#endif
> +	/* Setup Cipher Parameters */
> +	cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
> +	cipher_xform.next = NULL;
> +
> +	cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
> +	cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
> +
> +	op = rte_crypto_op_alloc(params.op_mpool,
> +			RTE_CRYPTO_OP_TYPE_SYMMETRIC);
> +	TEST_ASSERT_NOT_NULL(op, "Failed to allocate crypto_op!\n");
> +
> +	sym_op = op->sym;
> +
> +	if (!session_less) {
> +		sess = rte_cryptodev_sym_session_create(params.session_mpool);
> +		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
> +
> +		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> +							evdev, &cap);
> +		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
> +			/* Fill in private data information */
> +			rte_memcpy(&m_data.response_info, &response_info,
> +				   sizeof(m_data));
> +			rte_cryptodev_sym_session_set_private_data(sess,
> +						&m_data, sizeof(m_data));
> +		}
> +		rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
> +				&cipher_xform, params.session_mpool);
> +		rte_crypto_op_attach_sym_session(op, sess);
> +	} else {
> +		struct rte_crypto_sym_xform *first_xform;
> +
> +		rte_crypto_op_sym_xforms_alloc(op, NUM);
> +		op->sess_type = RTE_CRYPTO_OP_SESSIONLESS;
> +		first_xform = &cipher_xform;
> +		sym_op->xform = first_xform;
> +		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH +
> +				(sizeof(struct rte_crypto_sym_xform) * 2);
> +		op->private_data_offset = len;
> +		/* Fill in private data information */
> +		rte_memcpy(&m_data.response_info, &response_info,
> +			   sizeof(m_data));
> +		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
> +	}
> +
> +	sym_op->m_src = m;
> +	sym_op->cipher.data.offset = 0;
> +	sym_op->cipher.data.length = PACKET_LENGTH;
> +
> +	ret = send_op_recv_ev(op);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to enqueue op to cryptodev\n");
> +
> +	test_crypto_adapter_stats();
> +
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +test_sessionless_with_op_new_mode(void)
> +{
> +	uint32_t cap;
> +	int ret;
> +
> +	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) ||
> +	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
> +		map_adapter_service_core();
> +
> +	/* start the event crypto adapter */
> +	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
> +				"Failed to start event crypto adapter");
> +
> +	ret = test_op_new_mode(1);
> +	TEST_ASSERT_SUCCESS(ret, "Sessionless - DEQ_ONLY test failed\n");
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +test_session_with_op_new_mode(void)
> +{
> +	uint32_t cap;
> +	int ret;
> +
> +	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) ||
> +	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
> +		map_adapter_service_core();
> +
> +	TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
> +				"Failed to start event crypto adapter");
> +
> +	ret = test_op_new_mode(0);
> +	TEST_ASSERT_SUCCESS(ret, "Session based - DEQ_ONLY test failed\n");
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +configure_cryptodev(void)
> +{
> +	struct rte_cryptodev_qp_conf qp_conf;
> +	struct rte_cryptodev_config conf;
> +	struct rte_cryptodev_info info;
> +	unsigned int session_size;
> +	uint8_t nb_devs;
> +	int ret;
> +
> +	params.mbuf_pool = rte_pktmbuf_pool_create(
> +			"CRYPTO_ADAPTER_MBUFPOOL",
> +			NUM_MBUFS, MBUF_CACHE_SIZE, 0, MBUF_SIZE,
> +			rte_socket_id());
> +	if (params.mbuf_pool == NULL) {
> +		RTE_LOG(ERR, USER1, "Can't create CRYPTO_MBUFPOOL\n");
> +		return TEST_FAILED;
> +	}
> +
> +	params.op_mpool = rte_crypto_op_pool_create(
> +			"EVENT_CRYPTO_SYM_OP_POOL",
> +			RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> +			NUM_MBUFS, MBUF_CACHE_SIZE,
> +			DEFAULT_NUM_XFORMS *
> +			sizeof(struct rte_crypto_sym_xform) +
> +			MAXIMUM_IV_LENGTH,
> +			rte_socket_id());
> +	if (params.op_mpool == NULL) {
> +		RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n");
> +		return TEST_FAILED;
> +	}
> +
> +	/* Create a NULL crypto device */
> +	nb_devs = rte_cryptodev_device_count_by_driver(
> +			rte_cryptodev_driver_id_get(
> +			RTE_STR(CRYPTODEV_NAME_NULL_PMD)));
> +	if (!nb_devs) {
> +		ret = rte_vdev_init(
> +			RTE_STR(CRYPTODEV_NAME_NULL_PMD), NULL);
> +
> +		TEST_ASSERT(ret == 0, "Failed to create pmd:%s instance\n",
> +			    RTE_STR(CRYPTODEV_NAME_NULL_PMD));
> +	}
> +
> +	nb_devs = rte_cryptodev_count();
> +	if (!nb_devs) {
> +		RTE_LOG(ERR, USER1, "No crypto devices found?\n");
> +		return TEST_FAILED;
> +	}
> +
> +	/*
> +	 * Create mempool with maximum number of sessions * 2,
> +	 * to include the session headers & private data
> +	 */
> +	session_size = rte_cryptodev_get_private_session_size(TEST_CDEV_ID);
> +	session_size += sizeof(union rte_event_crypto_metadata);
> +
> +	params.session_mpool = rte_mempool_create(
> +				"CRYPTO_ADAPTER_SESSION_MP",
> +				info.sym.max_nb_sessions * 2,
> +				session_size,
> +				0, 0, NULL, NULL, NULL,
> +				NULL, SOCKET_ID_ANY,
> +				0);
> +
> +	TEST_ASSERT_NOT_NULL(params.session_mpool,
> +			"session mempool allocation failed\n");
> +
> +	rte_cryptodev_info_get(TEST_CDEV_ID, &info);
> +	conf.nb_queue_pairs = info.max_nb_queue_pairs;
> +	conf.socket_id = SOCKET_ID_ANY;
> +
> +	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(TEST_CDEV_ID,
> +			&conf),
> +			"Failed to configure cryptodev %u with %u qps\n",
> +			TEST_CDEV_ID, conf.nb_queue_pairs);
> +
> +	qp_conf.nb_descriptors = DEFAULT_NUM_OPS_INFLIGHT;
> +
> +	TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
> +			TEST_CDEV_ID, TEST_CDEV_QP_ID, &qp_conf,
> +			rte_cryptodev_socket_id(TEST_CDEV_ID),
> +			params.session_mpool),
> +			"Failed to setup queue pair %u on cryptodev %u\n",
> +			TEST_CDEV_QP_ID, TEST_CDEV_ID);
> +
> +	return TEST_SUCCESS;
> +}
> +
> +static inline void
> +evdev_set_conf_values(struct rte_event_dev_config *dev_conf,
> +			struct rte_event_dev_info *info)
> +{
> +	memset(dev_conf, 0, sizeof(struct rte_event_dev_config));
> +	dev_conf->dequeue_timeout_ns = info->min_dequeue_timeout_ns;
> +	dev_conf->nb_event_ports = NB_TEST_PORTS;
> +	dev_conf->nb_event_queues = NB_TEST_QUEUES;
> +	dev_conf->nb_event_queue_flows = info->max_event_queue_flows;
> +	dev_conf->nb_event_port_dequeue_depth =
> +			info->max_event_port_dequeue_depth;
> +	dev_conf->nb_event_port_enqueue_depth =
> +			info->max_event_port_enqueue_depth;
> +	dev_conf->nb_event_port_enqueue_depth =
> +			info->max_event_port_enqueue_depth;
> +	dev_conf->nb_events_limit =
> +			info->max_num_events;
> +}
> +
> +static int
> +configure_eventdev(void)
> +{
> +	const char *eventdev_name = "event_sw0";
> +	struct rte_event_queue_conf queue_conf;
> +	struct rte_event_dev_config devconf;
> +	struct rte_event_dev_info info;
> +	uint32_t queue_count;
> +	uint32_t port_count;
> +	int ret;
> +	uint8_t qid;
> +
> +	evdev = rte_event_dev_get_dev_id(eventdev_name);
> +	if (evdev < 0) {
> +		if (rte_vdev_init(eventdev_name, NULL) < 0) {
> +			RTE_LOG(DEBUG, USER1, "Error creating eventdev\n");
> +			return TEST_FAILED;
> +		}
> +		evdev = rte_event_dev_get_dev_id(eventdev_name);
> +		if (evdev < 0) {
> +			RTE_LOG(DEBUG, USER1, "Error finding eventdev!\n");
> +			return TEST_FAILED;
> +		}
> +	}
> +
> +	ret = rte_event_dev_info_get(evdev, &info);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info\n");
> +
> +	evdev_set_conf_values(&devconf, &info);
> +
> +	ret = rte_event_dev_configure(evdev, &devconf);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev\n");
> +
> +	/* Set up event queue */
> +	ret = rte_event_dev_attr_get(evdev, RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
> +					&queue_count);
> +	TEST_ASSERT_SUCCESS(ret, "Queue count get failed\n");
> +	TEST_ASSERT_EQUAL(queue_count, 2, "Unexpected queue count\n");
> +
> +	qid = TEST_APP_EV_QUEUE_ID;
> +	ret = rte_event_queue_setup(evdev, qid, NULL);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to setup queue=%d\n", qid);
> +
> +	queue_conf.nb_atomic_flows = info.max_event_queue_flows;
> +	queue_conf.nb_atomic_order_sequences = 32;
> +	queue_conf.schedule_type = RTE_SCHED_TYPE_ATOMIC;
> +	queue_conf.priority = RTE_EVENT_DEV_PRIORITY_HIGHEST;
> +	queue_conf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_SINGLE_LINK;
> +
> +	qid = TEST_CRYPTO_EV_QUEUE_ID;
> +	ret = rte_event_queue_setup(evdev, qid, &queue_conf);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to setup queue=%u\n", qid);
> +
> +	/* Set up event port */
> +	ret = rte_event_dev_attr_get(evdev, RTE_EVENT_DEV_ATTR_PORT_COUNT,
> +					&port_count);
> +	TEST_ASSERT_SUCCESS(ret, "Port count get failed\n");
> +	TEST_ASSERT_EQUAL(port_count, 1, "Unexpected port count\n");
> +
> +	ret = rte_event_port_setup(evdev, TEST_APP_PORT_ID, NULL);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to setup port=%d\n",
> +			    TEST_APP_PORT_ID);
> +
> +	qid = TEST_APP_EV_QUEUE_ID;
> +	ret = rte_event_port_link(evdev, TEST_APP_PORT_ID, &qid, NULL, 1);
> +	TEST_ASSERT(ret >= 0, "Failed to link queue port=%d\n",
> +		    TEST_APP_PORT_ID);
> +
> +	return TEST_SUCCESS;
> +}
> +
> +static void
> +test_crypto_adapter_free(void)
> +{
> +	rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
> +}
> +
> +static int
> +test_crypto_adapter_create(void)
> +{
> +	struct rte_event_port_conf conf = {
> +		.dequeue_depth = 8,
> +		.enqueue_depth = 8,
> +		.new_event_threshold = 1200,
> +	};
> +	int ret;
> +
> +	/* Create adapter with default port creation callback */
> +	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> +					      TEST_CDEV_ID,
> +					      &conf, 0);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
> +
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +test_crypto_adapter_qp_add_del(void)
> +{
> +	uint32_t cap;
> +	int ret;
> +
> +	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +	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);
> +	} else
> +		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> +					TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL);
> +
> +	TEST_ASSERT_SUCCESS(ret, "Failed to create add queue pair\n");
> +
> +	ret = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
> +					TEST_CDEV_ID, TEST_CDEV_QP_ID);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to delete add queue pair\n");
> +
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
> +{
> +	struct rte_event_port_conf conf = {
> +		.dequeue_depth = 8,
> +		.enqueue_depth = 8,
> +		.new_event_threshold = 1200,
> +	};
> +
> +	uint32_t cap;
> +	int ret;
> +
> +	/* Create adapter with default port creation callback */
> +	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> +					      TEST_CDEV_ID,
> +					      &conf, mode);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
> +
> +	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +	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);
> +	} else
> +		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> +				TEST_CDEV_ID, TEST_CDEV_QP_ID, NULL);
> +
> +	TEST_ASSERT_SUCCESS(ret, "Failed to add queue pair\n");
> +
> +	ret = rte_event_crypto_adapter_event_port_get(TEST_ADAPTER_ID,
> +				&params.crypto_event_port_id);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get event port\n");
> +
> +	return TEST_SUCCESS;
> +}
> +
> +

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test
  2018-05-05 18:47 ` [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test Abhinandan Gujjar
  2018-05-07  5:20   ` Jerin Jacob
@ 2018-05-07  5:58   ` Jerin Jacob
  2018-05-07 10:08   ` Jerin Jacob
  2 siblings, 0 replies; 23+ messages in thread
From: Jerin Jacob @ 2018-05-07  5:58 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: hemant.agrawal, akhil.goyal, dev, narender.vangati, nikhil.rao,
	gage.eads

-----Original Message-----
> Date: Sun, 6 May 2018 00:17:09 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>  akhil.goyal@nxp.com, dev@dpdk.org
> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>  nikhil.rao@intel.com, gage.eads@intel.com
> Subject: [v3,4/5] test: add event crypto adapter auto-test
> X-Mailer: git-send-email 1.9.1
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> ---
>  MAINTAINERS                           |   1 +
>  test/test/Makefile                    |   1 +
>  test/test/test_event_crypto_adapter.c | 913 ++++++++++++++++++++++++++++++++++
>  3 files changed, 915 insertions(+)
>  create mode 100644 test/test/test_event_crypto_adapter.c
>

32bit target failing (T=i686-native-linuxapp-gcc)

/export/dpdk.org/test/test/test_event_crypto_adapter.c: In function
‘test_crypto_adapter_stats’:
/export/dpdk.org/test/test/test_event_crypto_adapter.c:135:46: error:
format ‘%lu’ expects argument of type ‘long unsigned int’, but argument
2 has type ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
  printf(" + Event port poll count          %lu\n",
                                            ~~^
                                            %llu
   stats.event_poll_count);
   ~~~~~~~~~~~~~~~~~~~~~~
/export/dpdk.org/test/test/test_event_crypto_adapter.c:137:46: error:
format ‘%lu’ expects argument of type ‘long unsigned int’, but argument
2 has type ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
  printf(" + Event dequeue count            %lu\n",
                                            ~~^
                                            %llu
   stats.event_deq_count);
   ~~~~~~~~~~~~~~~~~~~~~
/export/dpdk.org/test/test/test_event_crypto_adapter.c:139:46: error:
format ‘%lu’ expects argument of type ‘long unsigned int’, but argument
2 has type ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
  printf(" + Cryptodev enqueue count        %lu\n",

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3, 3/5] eventdev: add crypto adapter implementation
  2018-05-05 18:47 ` [dpdk-dev] [v3,3/5] eventdev: add crypto adapter implementation Abhinandan Gujjar
  2018-05-07  4:58   ` [dpdk-dev] [v3, 3/5] " Jerin Jacob
@ 2018-05-07  6:50   ` Jerin Jacob
  1 sibling, 0 replies; 23+ messages in thread
From: Jerin Jacob @ 2018-05-07  6:50 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: hemant.agrawal, akhil.goyal, dev, narender.vangati, nikhil.rao,
	gage.eads

-----Original Message-----
> Date: Sun, 6 May 2018 00:17:08 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>  akhil.goyal@nxp.com, dev@dpdk.org
> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>  nikhil.rao@intel.com, gage.eads@intel.com
> Subject: [v3,3/5] eventdev: add crypto adapter implementation
> X-Mailer: git-send-email 1.9.1
> 
> Event crypto adapter is added to the meson build system
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> Signed-off-by: Gage Eads <gage.eads@intel.com>
> ---
>  config/common_base                             |    1 +
>  lib/Makefile                                   |    3 +-
>  lib/librte_eventdev/Makefile                   |    3 +
>  lib/librte_eventdev/meson.build                |    8 +-
>  lib/librte_eventdev/rte_event_crypto_adapter.c | 1127 ++++++++++++++++++++++++
>  lib/librte_eventdev/rte_eventdev_version.map   |   12 +
>  6 files changed, 1150 insertions(+), 4 deletions(-)
>  create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.c
> 
> diff --git a/config/common_base b/config/common_base
> index 03a8688..8420d29 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -577,6 +577,7 @@ CONFIG_RTE_LIBRTE_EVENTDEV_DEBUG=n
>  CONFIG_RTE_EVENT_MAX_DEVS=16
>  CONFIG_RTE_EVENT_MAX_QUEUES_PER_DEV=64
>  CONFIG_RTE_EVENT_TIMER_ADAPTER_NUM_MAX=32
> +CONFIG_RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE=32

add EVENT_CRYPTO_ADAPTER_MAX_INSTANCE=32 in config/rte_config.h,
otherwise meson build will fail. Check the meson build in next revision.

FAILED:
lib/rte_eventdev@sta/librte_eventdev_rte_event_crypto_adapter.c.o
ccache gcc  -Ilib/rte_eventdev@sta -Ilib -I../lib -Ilib/librte_eventdev
-I../lib/librte_eventdev -Iconfig -I../config -I. -I../
-Ilib/librte_eal/common/include/arch/x86
-I../lib/librte_eal/common/include/arch/x86
-Ilib/librte_eal/common/include -I../lib/librte_eal/common/include
-Ilib/librte_eal/common -I../lib/librte_eal/common
-Ilib/librte_eal/linuxapp/eal/../../../librte_compat
-I../lib/librte_eal/linuxapp/eal/../../../librte_compat
-I../lib/librte_eal/linuxapp/eal/include -Ilib/librte_eal
-I../lib/librte_eal -Ilib/librte_compat -I../lib/librte_compat
-Ilib/librte_ring -I../lib/librte_ring -Ilib/librte_ethdev
-I../lib/librte_ethdev -Ilib/librte_net -I../lib/librte_net
-Ilib/librte_mbuf -I../lib/librte_mbuf -Ilib/librte_mempool
-I../lib/librte_mempool -Ilib/librte_kvargs -I../lib/librte_kvargs
-Ilib/librte_hash -I../lib/librte_hash -Ilib/librte_timer
-I../lib/librte_timer -Ilib/librte_cryptodev -I../lib/librte_cryptodev
-fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -O3 -include rte_config.h -Wsign-compare -Wcast-qual
-Wno-address-of-packed-member -Wno-format-truncation -fPIC -march=native
-DALLOW_EXPERIMENTAL_API -MD -MQ
'lib/rte_eventdev@sta/librte_eventdev_rte_event_crypto_adapter.c.o' -MF
'lib/rte_eventdev@sta/librte_eventdev_rte_event_crypto_adapter.c.o.d' -o
'lib/rte_eventdev@sta/librte_eventdev_rte_event_crypto_adapter.c.o' -c
../lib/librte_eventdev/rte_event_crypto_adapter.c
../lib/librte_eventdev/rte_event_crypto_adapter.c: In function
‘eca_valid_id’:
../lib/librte_eventdev/rte_event_crypto_adapter.c:113:14: error:
‘RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE’ undeclared (first use in this
function); did you mean ‘RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD’?
  return id < RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE;
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD
../lib/librte_eventdev/rte_event_crypto_adapter.c:113:14: note: each
undeclared identifier is reported only once for each function it appears
in
../lib/librte_eventdev/rte_event_crypto_adapter.c: In function
‘eca_init’:
../lib/librte_eventdev/rte_event_crypto_adapter.c:124:6: error:
‘RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE’ undeclared (first use in this
function); did you mean ‘RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD’?
      RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE;
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD
../lib/librte_eventdev/rte_event_crypto_adapter.c: In function
‘eca_valid_id’:
../lib/librte_eventdev/rte_event_crypto_adapter.c:114:1: warning:
control reaches end of non-void function [-Wreturn-type]
 }
 ^

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
  2018-05-05 18:47 ` [dpdk-dev] [v3,1/5] eventdev: introduce event " Abhinandan Gujjar
@ 2018-05-07  9:35   ` Jerin Jacob
  2018-05-07 12:32     ` Akhil Goyal
  0 siblings, 1 reply; 23+ messages in thread
From: Jerin Jacob @ 2018-05-07  9:35 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: hemant.agrawal, akhil.goyal, dev, narender.vangati, nikhil.rao,
	gage.eads

-----Original Message-----
> Date: Sun, 6 May 2018 00:17:06 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>  akhil.goyal@nxp.com, dev@dpdk.org
> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>  nikhil.rao@intel.com, gage.eads@intel.com
> Subject: [v3,1/5] eventdev: introduce event crypto adapter
> X-Mailer: git-send-email 1.9.1
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> Signed-off-by: Gage Eads <gage.eads@intel.com>
> ---
>  MAINTAINERS                                    |   5 +
>  lib/librte_eventdev/rte_event_crypto_adapter.h | 554 +++++++++++++++++++++++++
>  2 files changed, 559 insertions(+)
>  create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.h
>

Overall it looks good.

#1)

Please fix the following ./devtools/checkpatches.sh warning. 
➜ [master]laptop [dpdk.org] $ ./devtools/checkpatches.sh 

### eventdev: add crypto adapter implementation

WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
tag in line 1
#106: FILE: lib/librte_eventdev/rte_event_crypto_adapter.c:1:
+/* SPDX-License-Identifier: BSD-3-Clause

### test: add event crypto adapter auto-test

WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
tag in line 1
#38: FILE: test/test/test_event_crypto_adapter.c:1:
+/* SPDX-License-Identifier: BSD-3-Clause

total: 0 errors, 1 warnings, 927 lines checked

### doc: add event crypto adapter documentation

WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
tag in line 1
#41: FILE: doc/guides/prog_guide/event_crypto_adapter.rst:1:
+..  SPDX-License-Identifier: BSD-3-Clause

 * In the RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode, if HW supports 
 * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability the
 * application 
 * can directly submit the crypto operations to the cryptodev.
 * If not, 


#2) I have added minor changes in description, Wherever it makes sense
to you then please pull it for next revision. Else we can discuss more.

a) I have uploaded the diff at https://ufile.io/247t9 for
you convince.
b) Please update the similar change in programmers guide too.


diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.h b/lib/librte_eventdev/rte_event_crypto_adapter.h
index 2c1f54f76..55fbdc55e 100644
--- a/lib/librte_eventdev/rte_event_crypto_adapter.h
+++ b/lib/librte_eventdev/rte_event_crypto_adapter.h
@@ -23,14 +23,17 @@
  * between the crypto device and the event device.
  *
  * The application can choose to submit a crypto operation directly to
- * crypto device or send it to the crypto adapter via eventdev, the crypto
- * adapter then submits the crypto operation to the crypto device.
- * The first mode is known as the event new (OP_NEW) mode and the
- * second as the event forward (OP_FORWARD) mode. The choice of mode can
- * be specified while creating the adapter.
+ * crypto device or send it to the crypto adapter via eventdev based on
+ * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability.
+ * The first mode is known as the event new(RTE_EVENT_CRYPTO_ADAPTER_OP_NEW)
+ * mode and the second as the event forward(RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD)
+ * mode. The choice of mode can be specified while creating the adapter.
+ * In the former mode, it is an application responsibility to enable ingress packet
+ * ordering. In the latter mode, it is the adapter responsibility to enable
+ * the ingress packet ordering.
  *
  *
- * Working model of OP_NEW mode:
+ * Working model of RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode:
  *
  *                +--------------+         +--------------+
  *        --[1]-->|              |         | Crypto stage |
@@ -47,25 +50,27 @@
  *                |              |         |              |
  *                +--------------+         +--------------+
  *
- *         [1] Events from the previous stage.
+ *         [1] Events from the previous stage and enqueue to crypto/atomic stage
  *         [2] Application in atomic stage dequeues events from eventdev.
- *         [3] Crypto operations are submitted to cryptodev.
+ *         [3] Crypto operations are submitted to cryptodev by application.
  *         [4] Crypto adapter dequeues crypto completions from cryptodev.
  *         [5] Crypto adapter enqueues events to the eventdev.
  *         [6] Events to the next stage.
  *
- * In the OP_NEW mode, application submits crypto operations directly to
- * crypto device. The adapter then dequeues crypto completions from crypto
+ * In the RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode, application submits crypto
+ * operations directly to crypto device.
+ * The adapter then dequeues crypto completions from crypto
  * device and enqueue events to the event device.
- * This mode does not ensure ingress ordering. The application is expected
- * to be in atomic stage. Events dequeued from the adapter will be treated
- * as new events.
+ * This mode does not ensure ingress ordering if the application directly
+ * enqueues to cryptodev without going through crypto/atomic stage. i.e removing
+ * item [1] and [2].
+ * Events dequeued from the adapter will be treated as new events.
  * In this mode, application needs to specify event information (response
  * information) which is needed to enqueue an event after the crypto operation
  * is completed.
  *
  *
- * Working model of OP_FORWARD mode:
+ * Working model of RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode:
  *
  *                +--------------+         +--------------+
  *        --[1]-->|              |---[2]-->|              |
@@ -93,8 +98,9 @@
  *         [7] Crypto adapter enqueues events to the eventdev
  *         [8] Events to the next stage
  *
- * In the OP_FORWARD mode, if HW supports *_OP_FORWARD capability the
- * application can directly submit the crypto operations to the cryptodev.
+ * In the RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode, if HW supports
+ * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability the application
+ * can directly submit the crypto operations to the cryptodev.
  * If not, application retrieves crypto adapter's event port using
  * rte_event_crypto_adapter_event_port_get() API. Then, links its event
  * queue to this port and starts enqueuing crypto operations as events
@@ -121,7 +127,7 @@
  *  - rte_event_crypto_adapter_stop()
  *  - rte_event_crypto_adapter_stats_get()
  *  - rte_event_crypto_adapter_stats_reset()
-
+ *
  * The application creates an instance using rte_event_crypto_adapter_create()
  * or rte_event_crypto_adapter_create_ext().
  *
@@ -173,8 +179,10 @@ enum rte_event_crypto_adapter_mode {
 	/**< Start the crypto adapter in event forward mode.
 	 * @see RTE_EVENT_OP_FORWARD.
 	 * Application submits crypto requests as events to the crypto
-	 * adapter. Adapter submits crypto requests to the cryptodev
-	 * and crypto completions are enqueued back to the eventdev.
+	 * adapter or crypto device based on
+	 * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability.
+	 * crypto completions are enqueued back to the eventdev by
+	 * crypto adapter.
 	 */
 };
 
@@ -215,11 +223,12 @@ struct rte_event_crypto_request {
 union rte_event_crypto_metadata {
 	struct rte_event_crypto_request request_info;
 	/**< Request information to be filled in by application
-	 * for OP_FORWARD mode.
+	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode.
 	 */
 	struct rte_event response_info;
 	/**< Response information to be filled in by application
-	 * for OP_NEW and OP_FORWARD mode.
+	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
+	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
 	 */
 };
 
@@ -234,7 +243,8 @@ union rte_event_crypto_metadata {
 struct rte_event_crypto_adapter_conf {
 	uint8_t event_port_id;
 	/**< Event port identifier, the adapter enqueues events to this
-	 * port and dequeues crypto request events in OP_FORWARD mode.
+	 * port and dequeues crypto request events in 
+	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
 	 */
 	uint32_t max_nb;
 	/**< The adapter can return early if it has processed at least

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for crypto adapter
  2018-05-05 18:47 ` [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for " Abhinandan Gujjar
@ 2018-05-07  9:52   ` Jerin Jacob
  2018-05-08  8:39     ` Gujjar, Abhinandan S
  2018-05-07 15:28   ` Akhil Goyal
  1 sibling, 1 reply; 23+ messages in thread
From: Jerin Jacob @ 2018-05-07  9:52 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: hemant.agrawal, akhil.goyal, dev, narender.vangati, nikhil.rao,
	gage.eads

-----Original Message-----
> Date: Sun, 6 May 2018 00:17:07 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>  akhil.goyal@nxp.com, dev@dpdk.org
> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>  nikhil.rao@intel.com, gage.eads@intel.com
> Subject: [v3,2/5] eventdev: add APIs and PMD callbacks for crypto adapter
> X-Mailer: git-send-email 1.9.1
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> ---
>  drivers/event/sw/sw_evdev.c            |  13 +++
>  lib/librte_eventdev/rte_eventdev.c     |  25 +++++
>  lib/librte_eventdev/rte_eventdev.h     |  54 ++++++++++
>  lib/librte_eventdev/rte_eventdev_pmd.h | 187 +++++++++++++++++++++++++++++++++
>  4 files changed, 279 insertions(+)
> 
> --- a/lib/librte_eventdev/rte_eventdev.h
> +++ b/lib/librte_eventdev/rte_eventdev.h
> @@ -8,6 +8,8 @@
>  #ifndef _RTE_EVENTDEV_H_
>  #define _RTE_EVENTDEV_H_
>  
> +#include <rte_compat.h>

Why rte_compat.h ? Is it by mistake? I could compile without this change.

> +
>  /**
>   * @file
>   *
> @@ -1135,6 +1137,58 @@ struct rte_event {
>  int __rte_experimental
>  rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps);
>  
> @@ -70,6 +70,9 @@
>  		((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \
>  			(RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ))
>  
> +#define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \
> +		RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA

I thought, SW driver has support for RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND.
If not, please ignore this comment.


With above changes:
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test
  2018-05-05 18:47 ` [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test Abhinandan Gujjar
  2018-05-07  5:20   ` Jerin Jacob
  2018-05-07  5:58   ` Jerin Jacob
@ 2018-05-07 10:08   ` Jerin Jacob
  2018-05-08  8:27     ` Gujjar, Abhinandan S
  2 siblings, 1 reply; 23+ messages in thread
From: Jerin Jacob @ 2018-05-07 10:08 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: hemant.agrawal, akhil.goyal, dev, narender.vangati, nikhil.rao,
	gage.eads

-----Original Message-----
> Date: Sun, 6 May 2018 00:17:09 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>  akhil.goyal@nxp.com, dev@dpdk.org
> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>  nikhil.rao@intel.com, gage.eads@intel.com
> Subject: [v3,4/5] test: add event crypto adapter auto-test
> X-Mailer: git-send-email 1.9.1
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> ---
> +struct event_crypto_adapter_test_params {
> +	struct rte_mempool *mbuf_pool;
> +	struct rte_mempool *op_mpool;
> +	struct rte_mempool *session_mpool;
> +	struct rte_cryptodev_config *config;
> +	uint8_t crypto_event_port_id;
> +};
> +
> +struct rte_event response_info = {
> +	.queue_id = TEST_APP_EV_QUEUE_ID,
> +	.sched_type = RTE_SCHED_TYPE_ATOMIC,
> +	.flow_id = 0xAABB,
> +	.sub_event_type = 0,
> +	.event_type = 0,
> +	.priority = 0,
> +	.impl_opaque = 0
> +};

This may break old compiler.
see http://dpdk.org/dev/patchwork/patch/39398/

> +
> +struct rte_event_crypto_request request_info = {
> +	.cdev_id = TEST_CDEV_ID,
> +	.queue_pair_id = TEST_CDEV_QP_ID
> +};
> +
> +static int
> +test_crypto_adapter_stats(void)
> +{
> +	struct rte_event_crypto_adapter_stats stats;
> +
> +	rte_event_crypto_adapter_stats_get(TEST_ADAPTER_ID, &stats);
> +	printf(" +------------------------------------------------------+\n");
> +	printf(" + Crypto adapter stats for instance %u:\n", TEST_ADAPTER_ID);
> +	printf(" + Event port poll count          %lu\n",
> +		stats.event_poll_count);
> +	printf(" + Event dequeue count            %lu\n",
> +		stats.event_deq_count);
> +	printf(" + Cryptodev enqueue count        %lu\n",
> +		stats.crypto_enq_count);
> +	printf(" + Cryptodev enqueue failed count %lu\n",
> +		stats.crypto_enq_fail);
> +	printf(" + Cryptodev dequeue count        %lu\n",
> +		stats.crypto_deq_count);
> +	printf(" + Event enqueue count            %lu\n",
> +		stats.event_enq_count);
> +	printf(" + Event enqueue retry count      %lu\n",
> +		stats.event_enq_retry_count);
> +	printf(" + Event enqueue fail count       %lu\n",

Use PRIx64 to fix issue with 32b build target.

> +		stats.event_enq_fail_count);
> +	printf(" +------------------------------------------------------+\n");
> +
> +	rte_event_crypto_adapter_stats_reset(TEST_ADAPTER_ID);
> +	return TEST_SUCCESS;
> +}
> +
> +static int
> +configure_eventdev(void)
> +{
> +	const char *eventdev_name = "event_sw0";
> +	struct rte_event_queue_conf queue_conf;
> +	struct rte_event_dev_config devconf;
> +	struct rte_event_dev_info info;
> +	uint32_t queue_count;
> +	uint32_t port_count;
> +	int ret;
> +	uint8_t qid;
> +
> +	evdev = rte_event_dev_get_dev_id(eventdev_name);

No need to assume it is "event_sw0" driver. You can select 0th event
device for testing. If none of the event device is available then you can 
create "event_sw0" with vdev.

> +	if (evdev < 0) {
> +		if (rte_vdev_init(eventdev_name, NULL) < 0) {
> +			RTE_LOG(DEBUG, USER1, "Error creating eventdev\n");
> +			return TEST_FAILED;
> +		}
> +		evdev = rte_event_dev_get_dev_id(eventdev_name);
> +		if (evdev < 0) {
> +			RTE_LOG(DEBUG, USER1, "Error finding eventdev!\n");
> +			return TEST_FAILED;
> +		}
> +	}
> +
> +	ret = rte_event_dev_info_get(evdev, &info);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info\n");
> +
> +static struct unit_test_suite service_tests  = {

It is not "service_tests". Choose an appropriate name.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3, 5/5] doc: add event crypto adapter documentation
  2018-05-05 18:47 ` [dpdk-dev] [v3,5/5] doc: add event crypto adapter documentation Abhinandan Gujjar
@ 2018-05-07 12:27   ` Jerin Jacob
  0 siblings, 0 replies; 23+ messages in thread
From: Jerin Jacob @ 2018-05-07 12:27 UTC (permalink / raw)
  To: Abhinandan Gujjar
  Cc: hemant.agrawal, akhil.goyal, dev, narender.vangati, nikhil.rao,
	gage.eads, marko.kovacevic, john.mcnamara

-----Original Message-----
> Date: Sun, 6 May 2018 00:17:10 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>  akhil.goyal@nxp.com, dev@dpdk.org
> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>  nikhil.rao@intel.com, gage.eads@intel.com
> Subject: [v3,5/5] doc: add event crypto adapter documentation
> X-Mailer: git-send-email 1.9.1
> 
> Add entries in the programmer's guide, API index, maintainer's file
> and release notes for the event crypto adapter.
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

Adding documentation maintainers for review.
+ john.mcnamara@intel.com
+ marko.kovacevic@intel.com

> ---
>  MAINTAINERS                                        |    1 +
>  doc/api/doxy-api-index.md                          |    1 +
>  doc/guides/prog_guide/event_crypto_adapter.rst     |  244 +++++
>  .../img/event_crypto_adapter_op_forward.svg        | 1073 ++++++++++++++++++++
>  .../prog_guide/img/event_crypto_adapter_op_new.svg |  968 ++++++++++++++++++
>  doc/guides/prog_guide/index.rst                    |    1 +
>  doc/guides/rel_notes/release_18_05.rst             |    6 +
>  7 files changed, 2294 insertions(+)
>  create mode 100644 doc/guides/prog_guide/event_crypto_adapter.rst
>  create mode 100644 doc/guides/prog_guide/img/event_crypto_adapter_op_forward.svg
>  create mode 100644 doc/guides/prog_guide/img/event_crypto_adapter_op_new.svg
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 60ebef7..ea5dc40 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -367,6 +367,7 @@ M: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
>  T: git://dpdk.org/next/dpdk-next-eventdev
>  F: lib/librte_eventdev/*crypto_adapter*
>  F: test/test/test_event_crypto_adapter.c
> +F: doc/guides/prog_guide/event_crypto_adapter.rst
>  
>  Raw device API - EXPERIMENTAL
>  M: Shreyansh Jain <shreyansh.jain@nxp.com>
> diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
> index 26ce7b4..0162bb7 100644
> --- a/doc/api/doxy-api-index.md
> +++ b/doc/api/doxy-api-index.md
> @@ -21,6 +21,7 @@ The public API headers are grouped by topics:
>    [eventdev]           (@ref rte_eventdev.h),
>    [event_eth_rx_adapter]   (@ref rte_event_eth_rx_adapter.h),
>    [event_timer_adapter]    (@ref rte_event_timer_adapter.h),
> +  [event_crypto_adapter]   (@ref rte_event_crypto_adapter.h),
>    [rawdev]             (@ref rte_rawdev.h),
>    [metrics]            (@ref rte_metrics.h),
>    [bitrate]            (@ref rte_bitrate.h),
> diff --git a/doc/guides/prog_guide/event_crypto_adapter.rst b/doc/guides/prog_guide/event_crypto_adapter.rst
> new file mode 100644
> index 0000000..899f393
> --- /dev/null
> +++ b/doc/guides/prog_guide/event_crypto_adapter.rst
> @@ -0,0 +1,244 @@
> +..  SPDX-License-Identifier: BSD-3-Clause
> +    Copyright(c) 2018 Intel Corporation.
> +
> +Event Crypto Adapter Library
> +============================
> +
> +The DPDK Event device library :doc:`<eventdev>`provides event driven
> +programming model with features to schedule events. The cryptodev
> +library :doc:`<cryptodev_lib>` provides interface to crypto poll mode
> +drivers which supports different crypto operations. The Event Crypto
> +Adapter is one of the event adapter which is intended to bridge between
> +event devices and crypto device.
> +
> +The packet flow from crypto device to the event device can be accomplished
> +using both SW and HW based transfer mechanisms.
> +The Adapter queries an eventdev PMD to determine which mechanism to be used.
> +The adapter uses an EAL service core function for SW based packet transfer
> +and uses the eventdev PMD functions to configure HW based packet transfer
> +between the crypto device and the event device.
> +
> +Crypto adapter uses a new event type called ``RTE_EVENT_TYPE_CRYPTODEV``
> +to indicate the event source.
> +
> +API Overview
> +------------
> +
> +This section has a brief introduction to the event crypto adapter APIs.
> +The application is expected to create an adapter which is associated with
> +a single eventdev, then add cryptodev and queue pair to the adapter instance.
> +
> +Adapter can be started in ``RTE_EVENT_CRYPTO_ADAPTER_OP_NEW`` or
> +``RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD`` mode.

---

> +In the first mode, application submits crypto operations directly to the crypto device.
> +Adapter only dequeues crypto completions and enqueues them as events to the event device.

This portion you can update from header file comments.

---

> +
> +.. figure:: img/event_crypto_adapter_op_new.*
> +
> +In the second mode, application enqueues crypto operations as events to the event device.
> +The crypto adapter dequeues events and submits crypto operations to the crypto device.

We need talk about OP_FORWARD capability here. This portion you can update
from header file comments.

> +After the crypto completions, adapter enqueues them as events to the event device.
> +
> +.. figure:: img/event_crypto_adapter_op_forward.*

Diagram text you can update from from header file comments.

> +
> +Create an adapter instance
> +--------------------------
> +
> +An adapter instance is created using ``rte_event_crypto_adapter_create()``. This
> +function is called with event device to be associated with the adapter and port
> +configuration for the adapter to setup an event port(if the adapter needs to use
> +a service function).
> +
> +.. code-block:: c
> +
> +        int err;
> +        uint8_t dev_id, id;
> +        struct rte_event_dev_info dev_info;
> +        struct rte_event_port_conf conf;
> +        enum rte_event_crypto_adapter_mode mode;
> +
> +        err = rte_event_dev_info_get(id, &dev_info);
> +
> +        conf.new_event_threshold = dev_info.max_num_events;
> +        conf.dequeue_depth = dev_info.max_event_port_dequeue_depth;
> +        conf.enqueue_depth = dev_info.max_event_port_enqueue_depth;
> +	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
> +        err = rte_event_crypto_adapter_create(id, dev_id, &conf, mode);
> +
> +If the application desires to have finer control of eventdev port allocation
> +and setup, it can use the ``rte_event_crypto_adapter_create_ext()`` function.
> +The ``rte_event_crypto_adapter_create_ext()`` function is passed as a callback
> +function. The callback function is invoked if the adapter needs to use a
> +service function and needs to create an event port for it. The callback is
> +expected to fill the ``struct rte_event_crypto_adapter_conf`` structure
> +passed to it.
> +
> +For OP_FORWARD mode, the event port created by adapter can be retrieved using

s/OP_FORWARD/RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD/

> +``rte_event_crypto_adapter_event_port_get()`` API.
> +Application can use this event port to link with event queue on which it
> +enqueues events towards the crypto adapter.

Here you can describe if the PMD has RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD capability then
what could be the difference in application.

> +
> +.. code-block:: c
> +
> +        uint8_t id, evdev, crypto_ev_port_id, app_qid;
> +        struct rte_event ev;
> +        int ret;
> +
> +        ret = rte_event_crypto_adapter_event_port_get(id, &crypto_ev_port_id);
> +        ret = rte_event_queue_setup(evdev, app_qid, NULL);
> +        ret = rte_event_port_link(evdev, crypto_ev_port_id, &app_qid, NULL, 1);
> +
> +        /* Fill in event info and update event_ptr with rte_crypto_op */
> +        memset(&ev, 0, sizeof(ev));
> +        ev.queue_id = app_qid;
> +        .
> +        .
> +        ev.event_ptr = op;
> +        ret = rte_event_enqueue_burst(evdev, app_ev_port_id, ev, nb_events);
> +
> +
> +Adding queue pair to the adapter instance
> +-----------------------------------------
> +
> +Cryptodev device id and queue pair are created using cryptodev APIs.
> +For more information see :doc:`here  <cryptodev_lib>`.

IMO, we need to talk about EV_BIND capability here before using queue_pair_add()

> +
> +.. code-block:: c
> +
> +        struct rte_cryptodev_config conf;
> +        struct rte_cryptodev_qp_conf qp_conf;
> +        uint8_t cdev_id = 0;
> +        uint16_t qp_id = 0;
> +
> +        rte_cryptodev_configure(cdev_id, &conf);
> +        rte_cryptodev_queue_pair_setup(cdev_id, qp_id, &qp_conf);
> +
> +These cryptodev id and queue pair are added to the instance using the
> +``rte_event_crypto_adapter_queue_pair_add()`` function.
> +The same is removed using ``rte_event_crypto_adapter_queue_pair_del()``.

With above comments:
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

NOTE:

Wednesday morning the last deadline for RC3 pull request, If we can
address the comments from all parties(including NXP) before that then
we can push that in RC3.

/Jerin

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
  2018-05-07  9:35   ` Jerin Jacob
@ 2018-05-07 12:32     ` Akhil Goyal
  2018-05-07 13:07       ` Jerin Jacob
  2018-05-08  7:34       ` Gujjar, Abhinandan S
  0 siblings, 2 replies; 23+ messages in thread
From: Akhil Goyal @ 2018-05-07 12:32 UTC (permalink / raw)
  To: Jerin Jacob, Abhinandan Gujjar
  Cc: hemant.agrawal, akhil.goyal, dev, narender.vangati, nikhil.rao,
	gage.eads

Hi Jerin, Abhinandan,
Overall the patch looks good.
But one comment on block diagram for OP_NEW mode functioning.
The comment was also made on previous version but it looks the intent 
was misunderstood.


On 5/7/2018 3:05 PM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Sun, 6 May 2018 00:17:06 +0530
>> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
>> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>>  akhil.goyal@nxp.com, dev@dpdk.org
>> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>>  nikhil.rao@intel.com, gage.eads@intel.com
>> Subject: [v3,1/5] eventdev: introduce event crypto adapter
>> X-Mailer: git-send-email 1.9.1
>>
>> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
>> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
>> Signed-off-by: Gage Eads <gage.eads@intel.com>
>> ---
>>  MAINTAINERS                                    |   5 +
>>  lib/librte_eventdev/rte_event_crypto_adapter.h | 554 +++++++++++++++++++++++++
>>  2 files changed, 559 insertions(+)
>>  create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.h
>>
>
> Overall it looks good.
>
> #1)
>
> Please fix the following ./devtools/checkpatches.sh warning.
> ➜ [master]laptop [dpdk.org] $ ./devtools/checkpatches.sh
>
> ### eventdev: add crypto adapter implementation
>
> WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
> tag in line 1
> #106: FILE: lib/librte_eventdev/rte_event_crypto_adapter.c:1:
> +/* SPDX-License-Identifier: BSD-3-Clause
>
> ### test: add event crypto adapter auto-test
>
> WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
> tag in line 1
> #38: FILE: test/test/test_event_crypto_adapter.c:1:
> +/* SPDX-License-Identifier: BSD-3-Clause
>
> total: 0 errors, 1 warnings, 927 lines checked
>
> ### doc: add event crypto adapter documentation
>
> WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
> tag in line 1
> #41: FILE: doc/guides/prog_guide/event_crypto_adapter.rst:1:
> +..  SPDX-License-Identifier: BSD-3-Clause
>
>  * In the RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode, if HW supports
>  * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability the
>  * application
>  * can directly submit the crypto operations to the cryptodev.
>  * If not,
>
>
> #2) I have added minor changes in description, Wherever it makes sense
> to you then please pull it for next revision. Else we can discuss more.
>
> a) I have uploaded the diff at https://ufile.io/247t9 for
> you convince.
> b) Please update the similar change in programmers guide too.
>
>
> diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.h b/lib/librte_eventdev/rte_event_crypto_adapter.h
> index 2c1f54f76..55fbdc55e 100644
> --- a/lib/librte_eventdev/rte_event_crypto_adapter.h
> +++ b/lib/librte_eventdev/rte_event_crypto_adapter.h
> @@ -23,14 +23,17 @@
>   * between the crypto device and the event device.
>   *
>   * The application can choose to submit a crypto operation directly to
> - * crypto device or send it to the crypto adapter via eventdev, the crypto
> - * adapter then submits the crypto operation to the crypto device.
> - * The first mode is known as the event new (OP_NEW) mode and the
> - * second as the event forward (OP_FORWARD) mode. The choice of mode can
> - * be specified while creating the adapter.
> + * crypto device or send it to the crypto adapter via eventdev based on
> + * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability.
> + * The first mode is known as the event new(RTE_EVENT_CRYPTO_ADAPTER_OP_NEW)
> + * mode and the second as the event forward(RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD)
> + * mode. The choice of mode can be specified while creating the adapter.
> + * In the former mode, it is an application responsibility to enable ingress packet
> + * ordering. In the latter mode, it is the adapter responsibility to enable
> + * the ingress packet ordering.
>   *
>   *
> - * Working model of OP_NEW mode:
> + * Working model of RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode:
>   *
>   *                +--------------+         +--------------+
>   *        --[1]-->|              |         | Crypto stage |
> @@ -47,25 +50,27 @@
>   *                |              |         |              |
>   *                +--------------+         +--------------+
>   *
> - *         [1] Events from the previous stage.
> + *         [1] Events from the previous stage and enqueue to crypto/atomic stage
>   *         [2] Application in atomic stage dequeues events from eventdev.
> - *         [3] Crypto operations are submitted to cryptodev.
> + *         [3] Crypto operations are submitted to cryptodev by application.
>   *         [4] Crypto adapter dequeues crypto completions from cryptodev.
>   *         [5] Crypto adapter enqueues events to the eventdev.
>   *         [6] Events to the next stage.

I think the sequence should be as follows:
[1] Application dequeues from the previous stage.
[2] Application prepare for enqueue to cryptodev
[3] Application enqueues to cryptodev
[4] Crypto adapter dequeues crypto completions from cryptodev.
[5] Crypto adapter enqueues events to the eventdev.
[6] Application dequeues from eventdev and prepare for further processing.

So the Block diagram should be something like

+ *                +--------------+         +--------------+
+ *                |              |         | Crypto stage |
+ *                | Application  |---[2]-->| + enqueue to |
+ *                |              |         |   cryptodev  |
+ *                +--------------+         +--------------+
+ *                    ^   ^                       |
+ *                    |   |                      [3]
+ *                   [6] [1]                      |
+ *                    |   |                       |
+ *                +--------------+                |
+ *                |              |                |
+ *                | Event device |                |
+ *                |              |                |
+ *                +--------------+                |
+ *                       ^                        |
+ *                       |                        |
+ *                      [5]                       |
+ *                       |                        v
+ *                +--------------+         +--------------+
+ *                |              |         |              |
+ *                |Crypto adapter|<--[4]---|  Cryptodev   |
+ *                |              |         |              |
+ *                +--------------+         +--------------+
Please let me know if my understanding is not correct.


>   *
> - * In the OP_NEW mode, application submits crypto operations directly to
> - * crypto device. The adapter then dequeues crypto completions from crypto
> + * In the RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode, application submits crypto
> + * operations directly to crypto device.
> + * The adapter then dequeues crypto completions from crypto
>   * device and enqueue events to the event device.
> - * This mode does not ensure ingress ordering. The application is expected
> - * to be in atomic stage. Events dequeued from the adapter will be treated
> - * as new events.
> + * This mode does not ensure ingress ordering if the application directly
> + * enqueues to cryptodev without going through crypto/atomic stage. i.e removing
> + * item [1] and [2].
> + * Events dequeued from the adapter will be treated as new events.
>   * In this mode, application needs to specify event information (response
>   * information) which is needed to enqueue an event after the crypto operation
>   * is completed.
>   *
>   *
> - * Working model of OP_FORWARD mode:
> + * Working model of RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode:
>   *
>   *                +--------------+         +--------------+
>   *        --[1]-->|              |---[2]-->|              |
> @@ -93,8 +98,9 @@
>   *         [7] Crypto adapter enqueues events to the eventdev
>   *         [8] Events to the next stage
>   *
> - * In the OP_FORWARD mode, if HW supports *_OP_FORWARD capability the
> - * application can directly submit the crypto operations to the cryptodev.
> + * In the RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode, if HW supports
> + * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability the application
> + * can directly submit the crypto operations to the cryptodev.
>   * If not, application retrieves crypto adapter's event port using
>   * rte_event_crypto_adapter_event_port_get() API. Then, links its event
>   * queue to this port and starts enqueuing crypto operations as events
> @@ -121,7 +127,7 @@
>   *  - rte_event_crypto_adapter_stop()
>   *  - rte_event_crypto_adapter_stats_get()
>   *  - rte_event_crypto_adapter_stats_reset()
> -
> + *
>   * The application creates an instance using rte_event_crypto_adapter_create()
>   * or rte_event_crypto_adapter_create_ext().
>   *
> @@ -173,8 +179,10 @@ enum rte_event_crypto_adapter_mode {
>  	/**< Start the crypto adapter in event forward mode.
>  	 * @see RTE_EVENT_OP_FORWARD.
>  	 * Application submits crypto requests as events to the crypto
> -	 * adapter. Adapter submits crypto requests to the cryptodev
> -	 * and crypto completions are enqueued back to the eventdev.
> +	 * adapter or crypto device based on
> +	 * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability.
> +	 * crypto completions are enqueued back to the eventdev by
> +	 * crypto adapter.
>  	 */
>  };
>
> @@ -215,11 +223,12 @@ struct rte_event_crypto_request {
>  union rte_event_crypto_metadata {
>  	struct rte_event_crypto_request request_info;
>  	/**< Request information to be filled in by application
> -	 * for OP_FORWARD mode.
> +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode.
>  	 */
>  	struct rte_event response_info;
>  	/**< Response information to be filled in by application
> -	 * for OP_NEW and OP_FORWARD mode.
> +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
> +	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>  	 */
>  };
>
> @@ -234,7 +243,8 @@ union rte_event_crypto_metadata {
>  struct rte_event_crypto_adapter_conf {
>  	uint8_t event_port_id;
>  	/**< Event port identifier, the adapter enqueues events to this
> -	 * port and dequeues crypto request events in OP_FORWARD mode.
> +	 * port and dequeues crypto request events in
> +	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
>  	 */
>  	uint32_t max_nb;
>  	/**< The adapter can return early if it has processed at least
>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
  2018-05-07 12:32     ` Akhil Goyal
@ 2018-05-07 13:07       ` Jerin Jacob
  2018-05-08  7:34       ` Gujjar, Abhinandan S
  1 sibling, 0 replies; 23+ messages in thread
From: Jerin Jacob @ 2018-05-07 13:07 UTC (permalink / raw)
  To: Akhil Goyal
  Cc: Abhinandan Gujjar, hemant.agrawal, dev, narender.vangati,
	nikhil.rao, gage.eads

-----Original Message-----
> Date: Mon, 7 May 2018 18:02:04 +0530
> From: Akhil Goyal <akhil.goyal@nxp.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Abhinandan Gujjar
>  <abhinandan.gujjar@intel.com>
> CC: hemant.agrawal@nxp.com, akhil.goyal@nxp.com, dev@dpdk.org,
>  narender.vangati@intel.com, nikhil.rao@intel.com, gage.eads@intel.com
> Subject: Re: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101
>  Thunderbird/45.8.0
> 
> Hi Jerin, Abhinandan,
> Overall the patch looks good.
> But one comment on block diagram for OP_NEW mode functioning.
> The comment was also made on previous version but it looks the intent was
> misunderstood.
> 
> 
> On 5/7/2018 3:05 PM, Jerin Jacob wrote:
> > -----Original Message-----
> > > Date: Sun, 6 May 2018 00:17:06 +0530
> > > From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> > > To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
> > >  akhil.goyal@nxp.com, dev@dpdk.org
> > > CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
> > >  nikhil.rao@intel.com, gage.eads@intel.com
> > > Subject: [v3,1/5] eventdev: introduce event crypto adapter
> > > X-Mailer: git-send-email 1.9.1
> > > 
> > > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> > > Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> > > Signed-off-by: Gage Eads <gage.eads@intel.com>
> > > ---
> > >  MAINTAINERS                                    |   5 +
> > >  lib/librte_eventdev/rte_event_crypto_adapter.h | 554 +++++++++++++++++++++++++
> > >  2 files changed, 559 insertions(+)
> > >  create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.h
> > > 
> > 
> > Overall it looks good.
> > 
> > #1)
> > 
> > Please fix the following ./devtools/checkpatches.sh warning.
> > ➜ [master]laptop [dpdk.org] $ ./devtools/checkpatches.sh
> > 
> > ### eventdev: add crypto adapter implementation
> > 
> > WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
> > tag in line 1
> > #106: FILE: lib/librte_eventdev/rte_event_crypto_adapter.c:1:
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > 
> > ### test: add event crypto adapter auto-test
> > 
> > WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
> > tag in line 1
> > #38: FILE: test/test/test_event_crypto_adapter.c:1:
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > 
> > total: 0 errors, 1 warnings, 927 lines checked
> > 
> > ### doc: add event crypto adapter documentation
> > 
> > WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
> > tag in line 1
> > #41: FILE: doc/guides/prog_guide/event_crypto_adapter.rst:1:
> > +..  SPDX-License-Identifier: BSD-3-Clause
> > 
> >  * In the RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode, if HW supports
> >  * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability the
> >  * application
> >  * can directly submit the crypto operations to the cryptodev.
> >  * If not,
> > 
> > 
> > #2) I have added minor changes in description, Wherever it makes sense
> > to you then please pull it for next revision. Else we can discuss more.
> > 
> > a) I have uploaded the diff at https://ufile.io/247t9 for
> > you convince.
> > b) Please update the similar change in programmers guide too.
> > 
> > 
> > diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.h b/lib/librte_eventdev/rte_event_crypto_adapter.h
> > index 2c1f54f76..55fbdc55e 100644
> > --- a/lib/librte_eventdev/rte_event_crypto_adapter.h
> > +++ b/lib/librte_eventdev/rte_event_crypto_adapter.h
> > @@ -23,14 +23,17 @@
> >   * between the crypto device and the event device.
> >   *
> >   * The application can choose to submit a crypto operation directly to
> > - * crypto device or send it to the crypto adapter via eventdev, the crypto
> > - * adapter then submits the crypto operation to the crypto device.
> > - * The first mode is known as the event new (OP_NEW) mode and the
> > - * second as the event forward (OP_FORWARD) mode. The choice of mode can
> > - * be specified while creating the adapter.
> > + * crypto device or send it to the crypto adapter via eventdev based on
> > + * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability.
> > + * The first mode is known as the event new(RTE_EVENT_CRYPTO_ADAPTER_OP_NEW)
> > + * mode and the second as the event forward(RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD)
> > + * mode. The choice of mode can be specified while creating the adapter.
> > + * In the former mode, it is an application responsibility to enable ingress packet
> > + * ordering. In the latter mode, it is the adapter responsibility to enable
> > + * the ingress packet ordering.
> >   *
> >   *
> > - * Working model of OP_NEW mode:
> > + * Working model of RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode:
> >   *
> >   *                +--------------+         +--------------+
> >   *        --[1]-->|              |         | Crypto stage |
> > @@ -47,25 +50,27 @@
> >   *                |              |         |              |
> >   *                +--------------+         +--------------+
> >   *
> > - *         [1] Events from the previous stage.
> > + *         [1] Events from the previous stage and enqueue to crypto/atomic stage
> >   *         [2] Application in atomic stage dequeues events from eventdev.
> > - *         [3] Crypto operations are submitted to cryptodev.
> > + *         [3] Crypto operations are submitted to cryptodev by application.
> >   *         [4] Crypto adapter dequeues crypto completions from cryptodev.
> >   *         [5] Crypto adapter enqueues events to the eventdev.
> >   *         [6] Events to the next stage.
> 
> I think the sequence should be as follows:
> [1] Application dequeues from the previous stage.
> [2] Application prepare for enqueue to cryptodev
> [3] Application enqueues to cryptodev
> [4] Crypto adapter dequeues crypto completions from cryptodev.
> [5] Crypto adapter enqueues events to the eventdev.
> [6] Application dequeues from eventdev and prepare for further processing.
> 
> So the Block diagram should be something like
> 
> + *                +--------------+         +--------------+
> + *                |              |         | Crypto stage |
> + *                | Application  |---[2]-->| + enqueue to |
> + *                |              |         |   cryptodev  |
> + *                +--------------+         +--------------+
> + *                    ^   ^                       |
> + *                    |   |                      [3]
> + *                   [6] [1]                      |
> + *                    |   |                       |
> + *                +--------------+                |
> + *                |              |                |
> + *                | Event device |                |
> + *                |              |                |
> + *                +--------------+                |
> + *                       ^                        |
> + *                       |                        |
> + *                      [5]                       |
> + *                       |                        v
> + *                +--------------+         +--------------+
> + *                |              |         |              |
> + *                |Crypto adapter|<--[4]---|  Cryptodev   |
> + *                |              |         |              |
> + *                +--------------+         +--------------+
> Please let me know if my understanding is not correct.

Looks good to me.

/Jerin

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for crypto adapter
  2018-05-05 18:47 ` [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for " Abhinandan Gujjar
  2018-05-07  9:52   ` Jerin Jacob
@ 2018-05-07 15:28   ` Akhil Goyal
  2018-05-08  8:46     ` Gujjar, Abhinandan S
  1 sibling, 1 reply; 23+ messages in thread
From: Akhil Goyal @ 2018-05-07 15:28 UTC (permalink / raw)
  To: Abhinandan Gujjar, jerin.jacob, hemant.agrawal, akhil.goyal, dev
  Cc: narender.vangati, nikhil.rao, gage.eads

On 5/6/2018 12:17 AM, Abhinandan Gujjar wrote:
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> ---
>  drivers/event/sw/sw_evdev.c            |  13 +++
>  lib/librte_eventdev/rte_eventdev.c     |  25 +++++
>  lib/librte_eventdev/rte_eventdev.h     |  54 ++++++++++
>  lib/librte_eventdev/rte_eventdev_pmd.h | 187 +++++++++++++++++++++++++++++++++
>  4 files changed, 279 insertions(+)
>
...
> +
> +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD   0x2
> +/**< Flag indicates HW is capable of generating events in
> + * RTE_EVENT_OP_FWD enqueue operation. Cryptodev will send
The name is RTE_EVENT_OP_FORWARD

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
  2018-05-07 12:32     ` Akhil Goyal
  2018-05-07 13:07       ` Jerin Jacob
@ 2018-05-08  7:34       ` Gujjar, Abhinandan S
  2018-05-08 12:49         ` Jerin Jacob
  1 sibling, 1 reply; 23+ messages in thread
From: Gujjar, Abhinandan S @ 2018-05-08  7:34 UTC (permalink / raw)
  To: Akhil Goyal, Jerin Jacob
  Cc: hemant.agrawal, dev, Vangati, Narender, Rao, Nikhil, Eads, Gage

Hi Akhil,

Thanks for the feedback on the diagram. My thoughts are also in line with diagram.
In fact, my diagram also depicts same. The only difference is that, you have shown application in a separate block.
The "crypto stage + enqueue to cryptodev" block itself is part of an application.
So, for more clarity, I will add "application" as additional text to the block.
With the limited time, changing diagram needs change in SVG file as well.
In case, if you still feel there a change required we can take it up later.

Thanks
Abhinandan

> -----Original Message-----
> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]
> Sent: Monday, May 7, 2018 6:02 PM
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>
> Cc: hemant.agrawal@nxp.com; akhil.goyal@nxp.com; dev@dpdk.org; Vangati,
> Narender <narender.vangati@intel.com>; Rao, Nikhil <nikhil.rao@intel.com>;
> Eads, Gage <gage.eads@intel.com>
> Subject: Re: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
> 
> Hi Jerin, Abhinandan,
> Overall the patch looks good.
> But one comment on block diagram for OP_NEW mode functioning.
> The comment was also made on previous version but it looks the intent was
> misunderstood.
> 
> 
> On 5/7/2018 3:05 PM, Jerin Jacob wrote:
> > -----Original Message-----
> >> Date: Sun, 6 May 2018 00:17:06 +0530
> >> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> >> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
> >>  akhil.goyal@nxp.com, dev@dpdk.org
> >> CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
> >>  nikhil.rao@intel.com, gage.eads@intel.com
> >> Subject: [v3,1/5] eventdev: introduce event crypto adapter
> >> X-Mailer: git-send-email 1.9.1
> >>
> >> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> >> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> >> Signed-off-by: Gage Eads <gage.eads@intel.com>
> >> ---
> >>  MAINTAINERS                                    |   5 +
> >>  lib/librte_eventdev/rte_event_crypto_adapter.h | 554
> +++++++++++++++++++++++++
> >>  2 files changed, 559 insertions(+)
> >>  create mode 100644 lib/librte_eventdev/rte_event_crypto_adapter.h
> >>
> >
> > Overall it looks good.
> >
> > #1)
> >
> > Please fix the following ./devtools/checkpatches.sh warning.
> > ➜ [master]laptop [dpdk.org] $ ./devtools/checkpatches.sh
> >
> > ### eventdev: add crypto adapter implementation
> >
> > WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
> > tag in line 1
> > #106: FILE: lib/librte_eventdev/rte_event_crypto_adapter.c:1:
> > +/* SPDX-License-Identifier: BSD-3-Clause
> >
> > ### test: add event crypto adapter auto-test
> >
> > WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
> > tag in line 1
> > #38: FILE: test/test/test_event_crypto_adapter.c:1:
> > +/* SPDX-License-Identifier: BSD-3-Clause
> >
> > total: 0 errors, 1 warnings, 927 lines checked
> >
> > ### doc: add event crypto adapter documentation
> >
> > WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier
> > tag in line 1
> > #41: FILE: doc/guides/prog_guide/event_crypto_adapter.rst:1:
> > +..  SPDX-License-Identifier: BSD-3-Clause
> >
> >  * In the RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode, if HW supports
> >  * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD capability
> the
> >  * application
> >  * can directly submit the crypto operations to the cryptodev.
> >  * If not,
> >
> >
> > #2) I have added minor changes in description, Wherever it makes sense
> > to you then please pull it for next revision. Else we can discuss more.
> >
> > a) I have uploaded the diff at https://ufile.io/247t9 for
> > you convince.
> > b) Please update the similar change in programmers guide too.
> >
> >
> > diff --git a/lib/librte_eventdev/rte_event_crypto_adapter.h
> b/lib/librte_eventdev/rte_event_crypto_adapter.h
> > index 2c1f54f76..55fbdc55e 100644
> > --- a/lib/librte_eventdev/rte_event_crypto_adapter.h
> > +++ b/lib/librte_eventdev/rte_event_crypto_adapter.h
> > @@ -23,14 +23,17 @@
> >   * between the crypto device and the event device.
> >   *
> >   * The application can choose to submit a crypto operation directly to
> > - * crypto device or send it to the crypto adapter via eventdev, the crypto
> > - * adapter then submits the crypto operation to the crypto device.
> > - * The first mode is known as the event new (OP_NEW) mode and the
> > - * second as the event forward (OP_FORWARD) mode. The choice of mode
> can
> > - * be specified while creating the adapter.
> > + * crypto device or send it to the crypto adapter via eventdev based on
> > + * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD
> capability.
> > + * The first mode is known as the event
> new(RTE_EVENT_CRYPTO_ADAPTER_OP_NEW)
> > + * mode and the second as the event
> forward(RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD)
> > + * mode. The choice of mode can be specified while creating the adapter.
> > + * In the former mode, it is an application responsibility to enable ingress
> packet
> > + * ordering. In the latter mode, it is the adapter responsibility to enable
> > + * the ingress packet ordering.
> >   *
> >   *
> > - * Working model of OP_NEW mode:
> > + * Working model of RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode:
> >   *
> >   *                +--------------+         +--------------+
> >   *        --[1]-->|              |         | Crypto stage |
> > @@ -47,25 +50,27 @@
> >   *                |              |         |              |
> >   *                +--------------+         +--------------+
> >   *
> > - *         [1] Events from the previous stage.
> > + *         [1] Events from the previous stage and enqueue to crypto/atomic
> stage
> >   *         [2] Application in atomic stage dequeues events from eventdev.
> > - *         [3] Crypto operations are submitted to cryptodev.
> > + *         [3] Crypto operations are submitted to cryptodev by application.
> >   *         [4] Crypto adapter dequeues crypto completions from cryptodev.
> >   *         [5] Crypto adapter enqueues events to the eventdev.
> >   *         [6] Events to the next stage.
> 
> I think the sequence should be as follows:
> [1] Application dequeues from the previous stage.
> [2] Application prepare for enqueue to cryptodev
> [3] Application enqueues to cryptodev
> [4] Crypto adapter dequeues crypto completions from cryptodev.
> [5] Crypto adapter enqueues events to the eventdev.
> [6] Application dequeues from eventdev and prepare for further processing.
> 
> So the Block diagram should be something like
> 
> + *                +--------------+         +--------------+
> + *                |              |         | Crypto stage |
> + *                | Application  |---[2]-->| + enqueue to |
> + *                |              |         |   cryptodev  |
> + *                +--------------+         +--------------+
> + *                    ^   ^                       |
> + *                    |   |                      [3]
> + *                   [6] [1]                      |
> + *                    |   |                       |
> + *                +--------------+                |
> + *                |              |                |
> + *                | Event device |                |
> + *                |              |                |
> + *                +--------------+                |
> + *                       ^                        |
> + *                       |                        |
> + *                      [5]                       |
> + *                       |                        v
> + *                +--------------+         +--------------+
> + *                |              |         |              |
> + *                |Crypto adapter|<--[4]---|  Cryptodev   |
> + *                |              |         |              |
> + *                +--------------+         +--------------+
> Please let me know if my understanding is not correct.
> 
> 
> >   *
> > - * In the OP_NEW mode, application submits crypto operations directly to
> > - * crypto device. The adapter then dequeues crypto completions from crypto
> > + * In the RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode, application submits
> crypto
> > + * operations directly to crypto device.
> > + * The adapter then dequeues crypto completions from crypto
> >   * device and enqueue events to the event device.
> > - * This mode does not ensure ingress ordering. The application is expected
> > - * to be in atomic stage. Events dequeued from the adapter will be treated
> > - * as new events.
> > + * This mode does not ensure ingress ordering if the application directly
> > + * enqueues to cryptodev without going through crypto/atomic stage. i.e
> removing
> > + * item [1] and [2].
> > + * Events dequeued from the adapter will be treated as new events.
> >   * In this mode, application needs to specify event information (response
> >   * information) which is needed to enqueue an event after the crypto
> operation
> >   * is completed.
> >   *
> >   *
> > - * Working model of OP_FORWARD mode:
> > + * Working model of RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode:
> >   *
> >   *                +--------------+         +--------------+
> >   *        --[1]-->|              |---[2]-->|              |
> > @@ -93,8 +98,9 @@
> >   *         [7] Crypto adapter enqueues events to the eventdev
> >   *         [8] Events to the next stage
> >   *
> > - * In the OP_FORWARD mode, if HW supports *_OP_FORWARD capability the
> > - * application can directly submit the crypto operations to the cryptodev.
> > + * In the RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode, if HW
> supports
> > + * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD
> capability the application
> > + * can directly submit the crypto operations to the cryptodev.
> >   * If not, application retrieves crypto adapter's event port using
> >   * rte_event_crypto_adapter_event_port_get() API. Then, links its event
> >   * queue to this port and starts enqueuing crypto operations as events
> > @@ -121,7 +127,7 @@
> >   *  - rte_event_crypto_adapter_stop()
> >   *  - rte_event_crypto_adapter_stats_get()
> >   *  - rte_event_crypto_adapter_stats_reset()
> > -
> > + *
> >   * The application creates an instance using
> rte_event_crypto_adapter_create()
> >   * or rte_event_crypto_adapter_create_ext().
> >   *
> > @@ -173,8 +179,10 @@ enum rte_event_crypto_adapter_mode {
> >  	/**< Start the crypto adapter in event forward mode.
> >  	 * @see RTE_EVENT_OP_FORWARD.
> >  	 * Application submits crypto requests as events to the crypto
> > -	 * adapter. Adapter submits crypto requests to the cryptodev
> > -	 * and crypto completions are enqueued back to the eventdev.
> > +	 * adapter or crypto device based on
> > +	 * RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD
> capability.
> > +	 * crypto completions are enqueued back to the eventdev by
> > +	 * crypto adapter.
> >  	 */
> >  };
> >
> > @@ -215,11 +223,12 @@ struct rte_event_crypto_request {
> >  union rte_event_crypto_metadata {
> >  	struct rte_event_crypto_request request_info;
> >  	/**< Request information to be filled in by application
> > -	 * for OP_FORWARD mode.
> > +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW mode.
> >  	 */
> >  	struct rte_event response_info;
> >  	/**< Response information to be filled in by application
> > -	 * for OP_NEW and OP_FORWARD mode.
> > +	 * for RTE_EVENT_CRYPTO_ADAPTER_OP_NEW and
> > +	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >  	 */
> >  };
> >
> > @@ -234,7 +243,8 @@ union rte_event_crypto_metadata {
> >  struct rte_event_crypto_adapter_conf {
> >  	uint8_t event_port_id;
> >  	/**< Event port identifier, the adapter enqueues events to this
> > -	 * port and dequeues crypto request events in OP_FORWARD mode.
> > +	 * port and dequeues crypto request events in
> > +	 * RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD mode.
> >  	 */
> >  	uint32_t max_nb;
> >  	/**< The adapter can return early if it has processed at least
> >


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test
  2018-05-07 10:08   ` Jerin Jacob
@ 2018-05-08  8:27     ` Gujjar, Abhinandan S
  0 siblings, 0 replies; 23+ messages in thread
From: Gujjar, Abhinandan S @ 2018-05-08  8:27 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: hemant.agrawal, akhil.goyal, dev, Vangati, Narender, Rao, Nikhil,
	Eads, Gage



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Monday, May 7, 2018 3:39 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> Cc: hemant.agrawal@nxp.com; akhil.goyal@nxp.com; dev@dpdk.org; Vangati,
> Narender <narender.vangati@intel.com>; Rao, Nikhil <nikhil.rao@intel.com>;
> Eads, Gage <gage.eads@intel.com>
> Subject: Re: [v3,4/5] test: add event crypto adapter auto-test
> 
> -----Original Message-----
> > Date: Sun, 6 May 2018 00:17:09 +0530
> > From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> > To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
> > akhil.goyal@nxp.com, dev@dpdk.org
> > CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
> > nikhil.rao@intel.com, gage.eads@intel.com
> > Subject: [v3,4/5] test: add event crypto adapter auto-test
> > X-Mailer: git-send-email 1.9.1
> >
> > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> > ---
> > +struct event_crypto_adapter_test_params {
> > +	struct rte_mempool *mbuf_pool;
> > +	struct rte_mempool *op_mpool;
> > +	struct rte_mempool *session_mpool;
> > +	struct rte_cryptodev_config *config;
> > +	uint8_t crypto_event_port_id;
> > +};
> > +
> > +struct rte_event response_info = {
> > +	.queue_id = TEST_APP_EV_QUEUE_ID,
> > +	.sched_type = RTE_SCHED_TYPE_ATOMIC,
> > +	.flow_id = 0xAABB,
> > +	.sub_event_type = 0,
> > +	.event_type = 0,
> > +	.priority = 0,
> > +	.impl_opaque = 0
> > +};
> 
> This may break old compiler.
> see http://dpdk.org/dev/patchwork/patch/39398/
This change was done as Akhil had suggested.
My compiler was not throwing any warning on this.
Anyway, I will revert the change now.
> 
> > +
> > +struct rte_event_crypto_request request_info = {
> > +	.cdev_id = TEST_CDEV_ID,
> > +	.queue_pair_id = TEST_CDEV_QP_ID
> > +};
> > +
> > +static int
> > +test_crypto_adapter_stats(void)
> > +{
> > +	struct rte_event_crypto_adapter_stats stats;
> > +
> > +	rte_event_crypto_adapter_stats_get(TEST_ADAPTER_ID, &stats);
> > +	printf(" +------------------------------------------------------+\n");
> > +	printf(" + Crypto adapter stats for instance %u:\n", TEST_ADAPTER_ID);
> > +	printf(" + Event port poll count          %lu\n",
> > +		stats.event_poll_count);
> > +	printf(" + Event dequeue count            %lu\n",
> > +		stats.event_deq_count);
> > +	printf(" + Cryptodev enqueue count        %lu\n",
> > +		stats.crypto_enq_count);
> > +	printf(" + Cryptodev enqueue failed count %lu\n",
> > +		stats.crypto_enq_fail);
> > +	printf(" + Cryptodev dequeue count        %lu\n",
> > +		stats.crypto_deq_count);
> > +	printf(" + Event enqueue count            %lu\n",
> > +		stats.event_enq_count);
> > +	printf(" + Event enqueue retry count      %lu\n",
> > +		stats.event_enq_retry_count);
> > +	printf(" + Event enqueue fail count       %lu\n",
> 
> Use PRIx64 to fix issue with 32b build target.
Ok
> 
> > +		stats.event_enq_fail_count);
> > +	printf("
> > ++------------------------------------------------------+\n");
> > +
> > +	rte_event_crypto_adapter_stats_reset(TEST_ADAPTER_ID);
> > +	return TEST_SUCCESS;
> > +}
> > +
> > +static int
> > +configure_eventdev(void)
> > +{
> > +	const char *eventdev_name = "event_sw0";
> > +	struct rte_event_queue_conf queue_conf;
> > +	struct rte_event_dev_config devconf;
> > +	struct rte_event_dev_info info;
> > +	uint32_t queue_count;
> > +	uint32_t port_count;
> > +	int ret;
> > +	uint8_t qid;
> > +
> > +	evdev = rte_event_dev_get_dev_id(eventdev_name);
> 
> No need to assume it is "event_sw0" driver. You can select 0th event device for
> testing. If none of the event device is available then you can create "event_sw0"
> with vdev.
Ok
> 
> > +	if (evdev < 0) {
> > +		if (rte_vdev_init(eventdev_name, NULL) < 0) {
> > +			RTE_LOG(DEBUG, USER1, "Error creating eventdev\n");
> > +			return TEST_FAILED;
> > +		}
> > +		evdev = rte_event_dev_get_dev_id(eventdev_name);
> > +		if (evdev < 0) {
> > +			RTE_LOG(DEBUG, USER1, "Error finding eventdev!\n");
> > +			return TEST_FAILED;
> > +		}
> > +	}
> > +
> > +	ret = rte_event_dev_info_get(evdev, &info);
> > +	TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info\n");
> > +
> > +static struct unit_test_suite service_tests  = {
> 
> It is not "service_tests". Choose an appropriate name.
Ok

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for crypto adapter
  2018-05-07  9:52   ` Jerin Jacob
@ 2018-05-08  8:39     ` Gujjar, Abhinandan S
  0 siblings, 0 replies; 23+ messages in thread
From: Gujjar, Abhinandan S @ 2018-05-08  8:39 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: hemant.agrawal, akhil.goyal, dev, Vangati, Narender, Rao, Nikhil,
	Eads, Gage



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Monday, May 7, 2018 3:23 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> Cc: hemant.agrawal@nxp.com; akhil.goyal@nxp.com; dev@dpdk.org; Vangati,
> Narender <narender.vangati@intel.com>; Rao, Nikhil <nikhil.rao@intel.com>;
> Eads, Gage <gage.eads@intel.com>
> Subject: Re: [v3,2/5] eventdev: add APIs and PMD callbacks for crypto adapter
> 
> -----Original Message-----
> > Date: Sun, 6 May 2018 00:17:07 +0530
> > From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> > To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
> > akhil.goyal@nxp.com, dev@dpdk.org
> > CC: narender.vangati@intel.com, abhinandan.gujjar@intel.com,
> > nikhil.rao@intel.com, gage.eads@intel.com
> > Subject: [v3,2/5] eventdev: add APIs and PMD callbacks for crypto
> > adapter
> > X-Mailer: git-send-email 1.9.1
> >
> > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> > ---
> >  drivers/event/sw/sw_evdev.c            |  13 +++
> >  lib/librte_eventdev/rte_eventdev.c     |  25 +++++
> >  lib/librte_eventdev/rte_eventdev.h     |  54 ++++++++++
> >  lib/librte_eventdev/rte_eventdev_pmd.h | 187
> > +++++++++++++++++++++++++++++++++
> >  4 files changed, 279 insertions(+)
> >
> > --- a/lib/librte_eventdev/rte_eventdev.h
> > +++ b/lib/librte_eventdev/rte_eventdev.h
> > @@ -8,6 +8,8 @@
> >  #ifndef _RTE_EVENTDEV_H_
> >  #define _RTE_EVENTDEV_H_
> >
> > +#include <rte_compat.h>
> 
> Why rte_compat.h ? Is it by mistake? I could compile without this change.
Just notice that, I too got a successful compilation without this file.
Initially, I got an error when APIs were marked as rte_experimental. Then, I had to include this file!
May be this file is included somewhere else. Anyway, I will remove it.
> 
> > +
> >  /**
> >   * @file
> >   *
> > @@ -1135,6 +1137,58 @@ struct rte_event {  int __rte_experimental
> > rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps);
> >
> > @@ -70,6 +70,9 @@
> >  		((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \
> >
> 	(RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ))
> >
> > +#define RTE_EVENT_CRYPTO_ADAPTER_SW_CAP \
> > +		RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA
> 
> I thought, SW driver has support for
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND.
> If not, please ignore this comment.
> 
> 
> With above changes:
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for crypto adapter
  2018-05-07 15:28   ` Akhil Goyal
@ 2018-05-08  8:46     ` Gujjar, Abhinandan S
  0 siblings, 0 replies; 23+ messages in thread
From: Gujjar, Abhinandan S @ 2018-05-08  8:46 UTC (permalink / raw)
  To: Akhil Goyal, jerin.jacob, hemant.agrawal, dev
  Cc: Vangati, Narender, Rao, Nikhil, Eads, Gage



> -----Original Message-----
> From: Akhil Goyal [mailto:akhil.goyal@nxp.com]
> Sent: Monday, May 7, 2018 8:59 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com;
> akhil.goyal@nxp.com; dev@dpdk.org
> Cc: Vangati, Narender <narender.vangati@intel.com>; Rao, Nikhil
> <nikhil.rao@intel.com>; Eads, Gage <gage.eads@intel.com>
> Subject: Re: [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for
> crypto adapter
> 
> On 5/6/2018 12:17 AM, Abhinandan Gujjar wrote:
> > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> > ---
> >  drivers/event/sw/sw_evdev.c            |  13 +++
> >  lib/librte_eventdev/rte_eventdev.c     |  25 +++++
> >  lib/librte_eventdev/rte_eventdev.h     |  54 ++++++++++
> >  lib/librte_eventdev/rte_eventdev_pmd.h | 187
> +++++++++++++++++++++++++++++++++
> >  4 files changed, 279 insertions(+)
> >
> ...
> > +
> > +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD
> 0x2
> > +/**< Flag indicates HW is capable of generating events in
> > + * RTE_EVENT_OP_FWD enqueue operation. Cryptodev will send
> The name is RTE_EVENT_OP_FORWARD
Sure. I will update in the next patch.
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
  2018-05-08  7:34       ` Gujjar, Abhinandan S
@ 2018-05-08 12:49         ` Jerin Jacob
  2018-05-08 12:52           ` Gujjar, Abhinandan S
  0 siblings, 1 reply; 23+ messages in thread
From: Jerin Jacob @ 2018-05-08 12:49 UTC (permalink / raw)
  To: Gujjar, Abhinandan S
  Cc: Akhil Goyal, hemant.agrawal, dev, Vangati, Narender, Rao, Nikhil,
	Eads, Gage

-----Original Message-----
> Date: Tue, 8 May 2018 07:34:52 +0000
> From: "Gujjar, Abhinandan S" <abhinandan.gujjar@intel.com>
> To: Akhil Goyal <akhil.goyal@nxp.com>, Jerin Jacob
>  <jerin.jacob@caviumnetworks.com>
> CC: "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>, "dev@dpdk.org"
>  <dev@dpdk.org>, "Vangati, Narender" <narender.vangati@intel.com>, "Rao,
>  Nikhil" <nikhil.rao@intel.com>, "Eads, Gage" <gage.eads@intel.com>
> Subject: RE: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
>
> Hi Akhil,
>
> Thanks for the feedback on the diagram. My thoughts are also in line with diagram.
> In fact, my diagram also depicts same. The only difference is that, you have shown application in a separate block.
> The "crypto stage + enqueue to cryptodev" block itself is part of an application.
> So, for more clarity, I will add "application" as additional text to the block.
> With the limited time, changing diagram needs change in SVG file as well.
> In case, if you still feel there a change required we can take it up later.

IMO, At least in the header file you can copy the proposed and agreed
diagram. if you don't have time then documentation patch we can fix it
just after the initial patch and worst case apply the documentation
patch after RC3.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
  2018-05-08 12:49         ` Jerin Jacob
@ 2018-05-08 12:52           ` Gujjar, Abhinandan S
  0 siblings, 0 replies; 23+ messages in thread
From: Gujjar, Abhinandan S @ 2018-05-08 12:52 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Akhil Goyal, hemant.agrawal, dev, Vangati, Narender, Rao, Nikhil,
	Eads, Gage


> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Tuesday, May 8, 2018 6:19 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> Cc: Akhil Goyal <akhil.goyal@nxp.com>; hemant.agrawal@nxp.com;
> dev@dpdk.org; Vangati, Narender <narender.vangati@intel.com>; Rao, Nikhil
> <nikhil.rao@intel.com>; Eads, Gage <gage.eads@intel.com>
> Subject: Re: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto adapter
> 
> -----Original Message-----
> > Date: Tue, 8 May 2018 07:34:52 +0000
> > From: "Gujjar, Abhinandan S" <abhinandan.gujjar@intel.com>
> > To: Akhil Goyal <akhil.goyal@nxp.com>, Jerin Jacob
> > <jerin.jacob@caviumnetworks.com>
> > CC: "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
> "dev@dpdk.org"
> >  <dev@dpdk.org>, "Vangati, Narender" <narender.vangati@intel.com>,
> > "Rao,  Nikhil" <nikhil.rao@intel.com>, "Eads, Gage"
> > <gage.eads@intel.com>
> > Subject: RE: [dpdk-dev] [v3,1/5] eventdev: introduce event crypto
> > adapter
> >
> > Hi Akhil,
> >
> > Thanks for the feedback on the diagram. My thoughts are also in line with
> diagram.
> > In fact, my diagram also depicts same. The only difference is that, you have
> shown application in a separate block.
> > The "crypto stage + enqueue to cryptodev" block itself is part of an
> application.
> > So, for more clarity, I will add "application" as additional text to the block.
> > With the limited time, changing diagram needs change in SVG file as well.
> > In case, if you still feel there a change required we can take it up later.
> 
> IMO, At least in the header file you can copy the proposed and agreed diagram.
> if you don't have time then documentation patch we can fix it just after the
> initial patch and worst case apply the documentation patch after RC3.
Sure Jerin.

Regards
Abhinandan

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-05-08 12:53 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-05 18:47 [dpdk-dev] [v3,0/5] eventdev: cover letter - crypto adapter Abhinandan Gujjar
2018-05-05 18:47 ` [dpdk-dev] [v3,1/5] eventdev: introduce event " Abhinandan Gujjar
2018-05-07  9:35   ` Jerin Jacob
2018-05-07 12:32     ` Akhil Goyal
2018-05-07 13:07       ` Jerin Jacob
2018-05-08  7:34       ` Gujjar, Abhinandan S
2018-05-08 12:49         ` Jerin Jacob
2018-05-08 12:52           ` Gujjar, Abhinandan S
2018-05-05 18:47 ` [dpdk-dev] [v3, 2/5] eventdev: add APIs and PMD callbacks for " Abhinandan Gujjar
2018-05-07  9:52   ` Jerin Jacob
2018-05-08  8:39     ` Gujjar, Abhinandan S
2018-05-07 15:28   ` Akhil Goyal
2018-05-08  8:46     ` Gujjar, Abhinandan S
2018-05-05 18:47 ` [dpdk-dev] [v3,3/5] eventdev: add crypto adapter implementation Abhinandan Gujjar
2018-05-07  4:58   ` [dpdk-dev] [v3, 3/5] " Jerin Jacob
2018-05-07  6:50   ` Jerin Jacob
2018-05-05 18:47 ` [dpdk-dev] [v3,4/5] test: add event crypto adapter auto-test Abhinandan Gujjar
2018-05-07  5:20   ` Jerin Jacob
2018-05-07  5:58   ` Jerin Jacob
2018-05-07 10:08   ` Jerin Jacob
2018-05-08  8:27     ` Gujjar, Abhinandan S
2018-05-05 18:47 ` [dpdk-dev] [v3,5/5] doc: add event crypto adapter documentation Abhinandan Gujjar
2018-05-07 12:27   ` [dpdk-dev] [v3, 5/5] " Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).