[dpdk-dev] [PATCH 8/8] cryptodev: move device specific structures
Akhil Goyal
gakhil at marvell.com
Sun Aug 29 14:51:39 CEST 2021
The device specific structures - rte_cryptodev
and rte_cryptodev_data are moved to cryptodev_pmd.h
to hide it from the applications.
Signed-off-by: Akhil Goyal <gakhil at marvell.com>
---
lib/cryptodev/cryptodev_pmd.h | 62 ++++++++++++++++++++++++
lib/cryptodev/rte_cryptodev_core.h | 76 ------------------------------
2 files changed, 62 insertions(+), 76 deletions(-)
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index d40e5cee94..00c159c2db 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -56,6 +56,68 @@ struct rte_cryptodev_pmd_init_params {
unsigned int max_nb_queue_pairs;
};
+/**
+ * @internal
+ * The data part, with no function pointers, associated with each device.
+ *
+ * This structure is safe to place in shared memory to be common among
+ * different processes in a multi-process configuration.
+ */
+struct rte_cryptodev_data {
+ uint8_t dev_id;
+ /**< Device ID for this instance */
+ uint8_t socket_id;
+ /**< Socket ID where memory is allocated */
+ char name[RTE_CRYPTODEV_NAME_MAX_LEN];
+ /**< Unique identifier name */
+
+ __extension__
+ uint8_t dev_started : 1;
+ /**< Device state: STARTED(1)/STOPPED(0) */
+
+ struct rte_mempool *session_pool;
+ /**< Session memory pool */
+ void **queue_pairs;
+ /**< Array of pointers to queue pairs. */
+ uint16_t nb_queue_pairs;
+ /**< Number of device queue pairs. */
+
+ void *dev_private;
+ /**< PMD-specific private data */
+} __rte_cache_aligned;
+
+
+/** @internal The data structure associated with each crypto device. */
+struct rte_cryptodev {
+ struct rte_cryptodev_data *data;
+ /**< Pointer to device data */
+ struct rte_cryptodev_ops *dev_ops;
+ /**< Functions exported by PMD */
+ uint64_t feature_flags;
+ /**< Feature flags exposes HW/SW features for the given device */
+ struct rte_device *device;
+ /**< Backing device */
+
+ uint8_t driver_id;
+ /**< Crypto driver identifier*/
+
+ struct rte_cryptodev_cb_list link_intr_cbs;
+ /**< User application callback for interrupts if present */
+
+ void *security_ctx;
+ /**< Context for security ops */
+
+ __extension__
+ uint8_t attached : 1;
+ /**< Flag indicating the device is attached */
+
+ struct rte_cryptodev_cb_rcu *enq_cbs;
+ /**< User application callback for pre enqueue processing */
+
+ struct rte_cryptodev_cb_rcu *deq_cbs;
+ /**< User application callback for post dequeue processing */
+} __rte_cache_aligned;
+
/** Global structure used for maintaining state of allocated crypto devices */
struct rte_cryptodev_global {
struct rte_cryptodev *devs; /**< Device information array */
diff --git a/lib/cryptodev/rte_cryptodev_core.h b/lib/cryptodev/rte_cryptodev_core.h
index ec38f70e0c..88506e8a7b 100644
--- a/lib/cryptodev/rte_cryptodev_core.h
+++ b/lib/cryptodev/rte_cryptodev_core.h
@@ -16,15 +16,6 @@
* Applications should not use these directly.
*
*/
-
-typedef uint16_t (*dequeue_pkt_burst_t)(void *qp,
- struct rte_crypto_op **ops, uint16_t nb_ops);
-/**< Dequeue processed packets from queue pair of a device. */
-
-typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,
- struct rte_crypto_op **ops, uint16_t nb_ops);
-/**< Enqueue packets for processing on queue pair of a device. */
-
typedef uint16_t (*rte_crypto_dequeue_burst_t)(uint8_t dev_id, uint8_t qp_id,
struct rte_crypto_op **ops,
uint16_t nb_ops);
@@ -44,73 +35,6 @@ struct rte_cryptodev_api {
extern struct rte_cryptodev_api *rte_cryptodev_api;
-/**
- * @internal
- * The data part, with no function pointers, associated with each device.
- *
- * This structure is safe to place in shared memory to be common among
- * different processes in a multi-process configuration.
- */
-struct rte_cryptodev_data {
- uint8_t dev_id;
- /**< Device ID for this instance */
- uint8_t socket_id;
- /**< Socket ID where memory is allocated */
- char name[RTE_CRYPTODEV_NAME_MAX_LEN];
- /**< Unique identifier name */
-
- __extension__
- uint8_t dev_started : 1;
- /**< Device state: STARTED(1)/STOPPED(0) */
-
- struct rte_mempool *session_pool;
- /**< Session memory pool */
- void **queue_pairs;
- /**< Array of pointers to queue pairs. */
- uint16_t nb_queue_pairs;
- /**< Number of device queue pairs. */
-
- void *dev_private;
- /**< PMD-specific private data */
-} __rte_cache_aligned;
-
-
-/** @internal The data structure associated with each crypto device. */
-struct rte_cryptodev {
- dequeue_pkt_burst_t dequeue_burst;
- /**< Pointer to PMD receive function. */
- enqueue_pkt_burst_t enqueue_burst;
- /**< Pointer to PMD transmit function. */
-
- struct rte_cryptodev_data *data;
- /**< Pointer to device data */
- struct rte_cryptodev_ops *dev_ops;
- /**< Functions exported by PMD */
- uint64_t feature_flags;
- /**< Feature flags exposes HW/SW features for the given device */
- struct rte_device *device;
- /**< Backing device */
-
- uint8_t driver_id;
- /**< Crypto driver identifier*/
-
- struct rte_cryptodev_cb_list link_intr_cbs;
- /**< User application callback for interrupts if present */
-
- void *security_ctx;
- /**< Context for security ops */
-
- __extension__
- uint8_t attached : 1;
- /**< Flag indicating the device is attached */
-
- struct rte_cryptodev_cb_rcu *enq_cbs;
- /**< User application callback for pre enqueue processing */
-
- struct rte_cryptodev_cb_rcu *deq_cbs;
- /**< User application callback for post dequeue processing */
-} __rte_cache_aligned;
-
/**
* The pool of rte_cryptodev structures.
*/
--
2.25.1
More information about the dev
mailing list