1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
5 #ifndef _RTE_CRYPTODEV_CORE_H_
6 #define _RTE_CRYPTODEV_CORE_H_
11 * RTE Crypto Device internal header.
13 * This header contains internal data types. But they are still part of the
14 * public API because they are used by inline functions in the published API.
16 * Applications should not use these directly.
20 typedef uint16_t (*dequeue_pkt_burst_t)(void *qp,
21 struct rte_crypto_op **ops, uint16_t nb_ops);
22 /**< Dequeue processed packets from queue pair of a device. */
24 typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,
25 struct rte_crypto_op **ops, uint16_t nb_ops);
26 /**< Enqueue packets for processing on queue pair of a device. */
30 * The data part, with no function pointers, associated with each device.
32 * This structure is safe to place in shared memory to be common among
33 * different processes in a multi-process configuration.
35 struct rte_cryptodev_data {
37 /**< Device ID for this instance */
39 /**< Socket ID where memory is allocated */
40 char name[RTE_CRYPTODEV_NAME_MAX_LEN];
41 /**< Unique identifier name */
44 uint8_t dev_started : 1;
45 /**< Device state: STARTED(1)/STOPPED(0) */
47 struct rte_mempool *session_pool;
48 /**< Session memory pool */
50 /**< Array of pointers to queue pairs. */
51 uint16_t nb_queue_pairs;
52 /**< Number of device queue pairs. */
55 /**< PMD-specific private data */
56 } __rte_cache_aligned;
59 /** @internal The data structure associated with each crypto device. */
60 struct rte_cryptodev {
61 dequeue_pkt_burst_t dequeue_burst;
62 /**< Pointer to PMD receive function. */
63 enqueue_pkt_burst_t enqueue_burst;
64 /**< Pointer to PMD transmit function. */
66 struct rte_cryptodev_data *data;
67 /**< Pointer to device data */
68 struct rte_cryptodev_ops *dev_ops;
69 /**< Functions exported by PMD */
70 uint64_t feature_flags;
71 /**< Feature flags exposes HW/SW features for the given device */
72 struct rte_device *device;
73 /**< Backing device */
76 /**< Crypto driver identifier*/
78 struct rte_cryptodev_cb_list link_intr_cbs;
79 /**< User application callback for interrupts if present */
82 /**< Context for security ops */
86 /**< Flag indicating the device is attached */
88 struct rte_cryptodev_cb_rcu *enq_cbs;
89 /**< User application callback for pre enqueue processing */
91 struct rte_cryptodev_cb_rcu *deq_cbs;
92 /**< User application callback for post dequeue processing */
93 } __rte_cache_aligned;
96 * The pool of rte_cryptodev structures.
98 extern struct rte_cryptodev *rte_cryptodevs;
100 #endif /* _RTE_CRYPTODEV_CORE_H_ */