|
DPDK
2.2.0
|
#include <string.h>#include <rte_dev.h>#include <rte_pci.h>#include <rte_malloc.h>#include <rte_mbuf.h>#include <rte_mempool.h>#include <rte_log.h>#include "rte_crypto.h"#include "rte_cryptodev.h"Go to the source code of this file.
Data Structures | |
| struct | rte_cryptodev_driver |
| struct | rte_cryptodev_global |
| struct | rte_cryptodev_ops |
Typedefs | |
| typedef int(* | cryptodev_init_t )(struct rte_cryptodev_driver *drv, struct rte_cryptodev *dev) |
| typedef int(* | cryptodev_uninit_t )(const struct rte_cryptodev_driver *drv, struct rte_cryptodev *dev) |
| typedef int(* | cryptodev_configure_t )(struct rte_cryptodev *dev) |
| typedef int(* | cryptodev_start_t )(struct rte_cryptodev *dev) |
| typedef void(* | cryptodev_stop_t )(struct rte_cryptodev *dev) |
| typedef int(* | cryptodev_close_t )(struct rte_cryptodev *dev) |
| typedef void(* | cryptodev_stats_get_t )(struct rte_cryptodev *dev, struct rte_cryptodev_stats *stats) |
| typedef void(* | cryptodev_stats_reset_t )(struct rte_cryptodev *dev) |
| typedef void(* | cryptodev_info_get_t )(struct rte_cryptodev *dev, struct rte_cryptodev_info *dev_info) |
| typedef int(* | cryptodev_queue_pair_start_t )(struct rte_cryptodev *dev, uint16_t qp_id) |
| typedef int(* | cryptodev_queue_pair_stop_t )(struct rte_cryptodev *dev, uint16_t qp_id) |
| typedef int(* | cryptodev_queue_pair_setup_t )(struct rte_cryptodev *dev, uint16_t qp_id, const struct rte_cryptodev_qp_conf *qp_conf, int socket_id) |
| typedef int(* | cryptodev_queue_pair_release_t )(struct rte_cryptodev *dev, uint16_t qp_id) |
| typedef uint32_t(* | cryptodev_queue_pair_count_t )(struct rte_cryptodev *dev) |
| typedef int(* | cryptodev_create_session_pool_t )(struct rte_cryptodev *dev, unsigned nb_objs, unsigned obj_cache_size, int socket_id) |
| typedef unsigned(* | cryptodev_get_session_private_size_t )(struct rte_cryptodev *dev) |
| typedef void(* | cryptodev_initialize_session_t )(struct rte_mempool *mempool, void *session_private) |
| typedef void *(* | cryptodev_configure_session_t )(struct rte_cryptodev *dev, struct rte_crypto_xform *xform, void *session_private) |
| typedef void(* | cryptodev_free_session_t )(struct rte_cryptodev *dev, void *session_private) |
Functions | |
| static struct rte_cryptodev * | rte_cryptodev_pmd_get_dev (uint8_t dev_id) |
| static struct rte_cryptodev * | rte_cryptodev_pmd_get_named_dev (const char *name) |
| static unsigned | rte_cryptodev_pmd_is_valid_dev (uint8_t dev_id) |
| struct rte_cryptodev * | rte_cryptodev_pmd_allocate (const char *name, enum pmd_type type, int socket_id) |
| struct rte_cryptodev * | rte_cryptodev_pmd_virtual_dev_init (const char *name, size_t dev_private_size, int socket_id) |
| int | rte_cryptodev_pmd_release_device (struct rte_cryptodev *cryptodev) |
| int | rte_cryptodev_pmd_driver_register (struct rte_cryptodev_driver *crypto_drv, enum pmd_type type) |
| void | rte_cryptodev_pmd_callback_process (struct rte_cryptodev *dev, enum rte_cryptodev_event_type event) |
Variables | |
| struct rte_cryptodev_global * | rte_cryptodev_globals |
| struct rte_cryptodev * | rte_cryptodevs |
RTE Crypto PMD APIs
Definition in file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_init_t)(struct rte_cryptodev_driver *drv, struct rte_cryptodev *dev) |
Initialisation function of a crypto driver invoked for each matching crypto PCI device detected during the PCI probing phase.
| drv | The pointer to the [matching] crypto driver structure supplied by the PMD when it registered itself. |
| dev | The dev pointer is the address of the rte_cryptodev structure associated with the matching device and which has been [automatically] allocated in the rte_crypto_devices array. |
Definition at line 102 of file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_uninit_t)(const struct rte_cryptodev_driver *drv, struct rte_cryptodev *dev) |
Finalisation function of a driver invoked for each matching PCI device detected during the PCI closing phase.
| drv | The pointer to the [matching] driver structure supplied by the PMD when it registered itself. |
| dev | The dev pointer is the address of the rte_cryptodev structure associated with the matching device and which has been [automatically] allocated in the rte_crypto_devices array. |
Definition at line 122 of file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_configure_t)(struct rte_cryptodev *dev) |
Definitions of all functions exported by a driver through the the generic structure of type crypto_dev_ops supplied in the rte_cryptodev structure associated with a device. Function used to configure device.
| dev | Crypto device pointer |
Definition at line 242 of file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_start_t)(struct rte_cryptodev *dev) |
Function used to start a configured device.
| dev | Crypto device pointer |
Definition at line 251 of file rte_cryptodev_pmd.h.
| typedef void(* cryptodev_stop_t)(struct rte_cryptodev *dev) |
Function used to stop a configured device.
| dev | Crypto device pointer |
Definition at line 258 of file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_close_t)(struct rte_cryptodev *dev) |
Function used to close a configured device.
| dev | Crypto device pointer |
Definition at line 268 of file rte_cryptodev_pmd.h.
| typedef void(* cryptodev_stats_get_t)(struct rte_cryptodev *dev, struct rte_cryptodev_stats *stats) |
Function used to get statistics of a device.
| dev | Crypto device pointer |
| stats | Pointer to crypto device stats structure to populate |
Definition at line 277 of file rte_cryptodev_pmd.h.
| typedef void(* cryptodev_stats_reset_t)(struct rte_cryptodev *dev) |
Function used to reset statistics of a device.
| dev | Crypto device pointer |
Definition at line 286 of file rte_cryptodev_pmd.h.
| typedef void(* cryptodev_info_get_t)(struct rte_cryptodev *dev, struct rte_cryptodev_info *dev_info) |
Function used to get specific information of a device.
| dev | Crypto device pointer |
Definition at line 294 of file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_queue_pair_start_t)(struct rte_cryptodev *dev, uint16_t qp_id) |
Start queue pair of a device.
| dev | Crypto device pointer |
| qp_id | Queue Pair Index |
Definition at line 305 of file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_queue_pair_stop_t)(struct rte_cryptodev *dev, uint16_t qp_id) |
Stop queue pair of a device.
| dev | Crypto device pointer |
| qp_id | Queue Pair Index |
Definition at line 316 of file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_queue_pair_setup_t)(struct rte_cryptodev *dev, uint16_t qp_id, const struct rte_cryptodev_qp_conf *qp_conf, int socket_id) |
Setup a queue pair for a device.
| dev | Crypto device pointer |
| qp_id | Queue Pair Index |
| qp_conf | Queue configuration structure |
| socket_id | Socket Index |
Definition at line 329 of file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_queue_pair_release_t)(struct rte_cryptodev *dev, uint16_t qp_id) |
Release memory resources allocated by given queue pair.
| dev | Crypto device pointer |
| qp_id | Queue Pair Index |
Definition at line 343 of file rte_cryptodev_pmd.h.
| typedef uint32_t(* cryptodev_queue_pair_count_t)(struct rte_cryptodev *dev) |
Get number of available queue pairs of a device.
| dev | Crypto device pointer |
Definition at line 353 of file rte_cryptodev_pmd.h.
| typedef int(* cryptodev_create_session_pool_t)(struct rte_cryptodev *dev, unsigned nb_objs, unsigned obj_cache_size, int socket_id) |
Create a session mempool to allocate sessions from
| dev | Crypto device pointer |
| nb_objs | number of sessions objects in mempool |
| obj_cache | l-core object cache size, see rte_ring_create |
| socket_id | Socket Id to allocate mempool on. |
Definition at line 367 of file rte_cryptodev_pmd.h.
| typedef unsigned(* cryptodev_get_session_private_size_t)(struct rte_cryptodev *dev) |
Get the size of a cryptodev session
| dev | Crypto device pointer |
Definition at line 381 of file rte_cryptodev_pmd.h.
| typedef void(* cryptodev_initialize_session_t)(struct rte_mempool *mempool, void *session_private) |
Initialize a Crypto session on a device.
| dev | Crypto device pointer |
| xform | Single or chain of crypto xforms |
| priv_sess | Pointer to cryptodev's private session structure |
Definition at line 395 of file rte_cryptodev_pmd.h.
| typedef void*(* cryptodev_configure_session_t)(struct rte_cryptodev *dev, struct rte_crypto_xform *xform, void *session_private) |
Configure a Crypto session on a device.
| dev | Crypto device pointer |
| xform | Single or chain of crypto xforms |
| priv_sess | Pointer to cryptodev's private session structure |
Definition at line 409 of file rte_cryptodev_pmd.h.
| typedef void(* cryptodev_free_session_t)(struct rte_cryptodev *dev, void *session_private) |
Free Crypto session.
| session | Cryptodev session structure to free |
Definition at line 416 of file rte_cryptodev_pmd.h.
|
staticread |
Get the rte_cryptodev structure device pointer for the device. Assumes a valid device index.
| dev_id | Device ID value to select the device structure. |
Definition at line 168 of file rte_cryptodev_pmd.h.
|
staticread |
Get the rte_cryptodev structure device pointer for the named device.
| name | device name to select the device structure. |
Definition at line 182 of file rte_cryptodev_pmd.h.
|
inlinestatic |
Validate if the crypto device index is valid attached crypto device.
| dev_id | Crypto device index. |
Definition at line 209 of file rte_cryptodev_pmd.h.
|
read |
Function for internal use by dummy drivers primarily, e.g. ring-based driver. Allocates a new cryptodev slot for an crypto device and returns the pointer to that slot for the driver to use.
| name | Unique identifier name for each device |
| type | Device type of this Crypto device |
| socket_id | Socket to allocate resources on. |
|
read |
Creates a new virtual crypto device and returns the pointer to that device.
| name | PMD type name |
| dev_private_size | Size of crypto PMDs private data |
| socket_id | Socket to allocate resources on. |
| int rte_cryptodev_pmd_release_device | ( | struct rte_cryptodev * | cryptodev | ) |
Function for internal use by dummy drivers primarily, e.g. ring-based driver. Release the specified cryptodev device.
| cryptodev | The cryptodev pointer is the address of the rte_cryptodev structure. |
| int rte_cryptodev_pmd_driver_register | ( | struct rte_cryptodev_driver * | crypto_drv, |
| enum pmd_type | type | ||
| ) |
Register a Crypto [Poll Mode] driver.
Function invoked by the initialization function of a Crypto driver to simultaneously register itself as Crypto Poll Mode Driver and to either:
a - register itself as PCI driver if the crypto device is a physical
device, by invoking the rte_eal_pci_register() function to
register the *pci_drv* structure embedded in the *crypto_drv*
structure, after having stored the address of the
rte_cryptodev_init() function in the *devinit* field of the
*pci_drv* structure.
During the PCI probing phase, the rte_cryptodev_init()
function is invoked for each PCI [device] matching the
embedded PCI identifiers provided by the driver.
b, complete the initialization sequence if the device is a virtual
device by calling the rte_cryptodev_init() directly passing a
NULL parameter for the rte_pci_device structure.
| crypto_drv | crypto_driver structure associated with the crypto driver. |
| type | pmd type |
| void rte_cryptodev_pmd_callback_process | ( | struct rte_cryptodev * | dev, |
| enum rte_cryptodev_event_type | event | ||
| ) |
Executes all the user application registered callbacks for the specific device.
| dev | Pointer to cryptodev struct |
| event | Crypto device interrupt event type. |
| struct rte_cryptodev_global* rte_cryptodev_globals |
pointer to global crypto devices data structure.
| struct rte_cryptodev* rte_cryptodevs |
The pool of rte_cryptodev structures.
1.8.1.2