conststructrte_cryptodev_symmetric_capability*rte_cryptodev_sym_capability_get(uint8_tdev_id,conststructrte_cryptodev_sym_capability_idx*idx)
Provide capabilities available for defined device and algorithm
Parametersdev_id The identifier of the device.
idx Description of crypto algorithms.
Returns
• Return description of the symmetric crypto capability if exist.
• Return NULL if the capability not exist.
conststructrte_cryptodev_asymmetric_xform_capability*rte_cryptodev_asym_capability_get(uint8_tdev_id,conststructrte_cryptodev_asym_capability_idx*idx)
Provide capabilities available for defined device and xform
Parametersdev_id The identifier of the device.
idx Description of asym crypto xform.
Returns
• Return description of the asymmetric crypto capability if exist.
• Return NULL if the capability not exist.
intrte_cryptodev_sym_capability_check_cipher(conststructrte_cryptodev_symmetric_capability*capability,uint16_tkey_size,uint16_tiv_size)
Check if key size and initial vector are supported in crypto cipher capability
Parameterscapability Description of the symmetric crypto capability.
key_size Cipher key size.
iv_size Cipher initial vector size.
Returns
• Return 0 if the parameters are in range of the capability.
• Return -1 if the parameters are out of range of the capability.
intrte_cryptodev_sym_capability_check_auth(conststructrte_cryptodev_symmetric_capability*capability,uint16_tkey_size,uint16_tdigest_size,uint16_tiv_size)
Check if key size and initial vector are supported in crypto auth capability
Parameterscapability Description of the symmetric crypto capability.
key_size Auth key size.
digest_size Auth digest size.
iv_size Auth initial vector size.
Returns
• Return 0 if the parameters are in range of the capability.
• Return -1 if the parameters are out of range of the capability.
intrte_cryptodev_sym_capability_check_aead(conststructrte_cryptodev_symmetric_capability*capability,uint16_tkey_size,uint16_tdigest_size,uint16_taad_size,uint16_tiv_size)
Check if key, digest, AAD and initial vector sizes are supported in crypto AEAD capability
Parameterscapability Description of the symmetric crypto capability.
key_size AEAD key size.
digest_size AEAD digest size.
aad_size AEAD AAD size.
iv_size AEAD IV size.
Returns
• Return 0 if the parameters are in range of the capability.
• Return -1 if the parameters are out of range of the capability.
intrte_cryptodev_asym_xform_capability_check_optype(conststructrte_cryptodev_asymmetric_xform_capability*capability,enumrte_crypto_asym_op_typeop_type)
Check if op type is supported
Parameterscapability Description of the asymmetric crypto capability.
op_type op type
Returns
• Return 1 if the op type is supported
• Return 0 if unsupported
intrte_cryptodev_asym_xform_capability_check_modlen(conststructrte_cryptodev_asymmetric_xform_capability*capability,uint16_tmodlen)
Check if modulus length is in supported range
Parameterscapability Description of the asymmetric crypto capability.
modlen modulus length.
Returns
• Return 0 if the parameters are in range of the capability.
• Return -1 if the parameters are out of range of the capability.
boolrte_cryptodev_asym_xform_capability_check_hash(conststructrte_cryptodev_asymmetric_xform_capability*capability,enumrte_crypto_auth_algorithmhash)
Check if hash algorithm is supported.
Parameterscapability Asymmetric crypto capability.
hash Hash algorithm.
Returns
• Return true if the hash algorithm is supported.
• Return false if the hash algorithm is not supported.
__rte_experimentalintrte_cryptodev_asym_xform_capability_check_opcap(conststructrte_cryptodev_asymmetric_xform_capability*capability,enumrte_crypto_asym_op_typeop_type,uint8_tcap)WarningEXPERIMENTAL: this API may change without prior notice.
Check if op capability is supported
Parameterscapability Description of the asymmetric crypto capability.
op_type op type
cap op capability
Returns
• Return 1 if the op capability is supported
• Return 0 if unsupported
intrte_cryptodev_get_cipher_algo_enum(enumrte_crypto_cipher_algorithm*algo_enum,constchar*algo_string)
Provide the cipher algorithm enum, given an algorithm string
Parametersalgo_enum A pointer to the cipher algorithm enum to be filled
algo_string Authentication algo string
Returns
• Return -1 if string is not valid
• Return 0 is the string is valid
intrte_cryptodev_get_auth_algo_enum(enumrte_crypto_auth_algorithm*algo_enum,constchar*algo_string)
Provide the authentication algorithm enum, given an algorithm string
Parametersalgo_enum A pointer to the authentication algorithm enum to be filled
algo_string Authentication algo string
Returns
• Return -1 if string is not valid
• Return 0 is the string is valid
intrte_cryptodev_get_aead_algo_enum(enumrte_crypto_aead_algorithm*algo_enum,constchar*algo_string)
Provide the AEAD algorithm enum, given an algorithm string
Parametersalgo_enum A pointer to the AEAD algorithm enum to be filled
algo_string AEAD algorithm string
Returns
• Return -1 if string is not valid
• Return 0 is the string is valid
intrte_cryptodev_asym_get_xform_enum(enumrte_crypto_asym_xform_type*xform_enum,constchar*xform_string)
Provide the Asymmetric xform enum, given an xform string
Parametersxform_enum A pointer to the xform type enum to be filled
xform_string xform string
Returns
• Return -1 if string is not valid
• Return 0 if the string is valid
__rte_experimentalconstchar*rte_cryptodev_get_cipher_algo_string(enumrte_crypto_cipher_algorithmalgo_enum)
Provide the cipher algorithm string, given an algorithm enum.
Parametersalgo_enum cipher algorithm enum
Returns
• Return NULL if enum is not valid
• Return algo_string corresponding to enum
__rte_experimentalconstchar*rte_cryptodev_get_auth_algo_string(enumrte_crypto_auth_algorithmalgo_enum)
Provide the authentication algorithm string, given an algorithm enum.
Parametersalgo_enum auth algorithm enum
Returns
• Return NULL if enum is not valid
• Return algo_string corresponding to enum
__rte_experimentalconstchar*rte_cryptodev_get_aead_algo_string(enumrte_crypto_aead_algorithmalgo_enum)
Provide the AEAD algorithm string, given an algorithm enum.
Parametersalgo_enum AEAD algorithm enum
Returns
• Return NULL if enum is not valid
• Return algo_string corresponding to enum
__rte_experimentalconstchar*rte_cryptodev_asym_get_xform_string(enumrte_crypto_asym_xform_typexform_enum)
Provide the Asymmetric xform string, given an xform enum.
Parametersxform_enum xform type enum
Returns
• Return NULL, if enum is not valid.
• Return xform string, for valid enum.
constchar*rte_cryptodev_get_feature_name(uint64_tflag)
Get the name of a crypto device feature flag
Parametersflag The mask describing the flag.
Returns
The name of this flag, or NULL if it's not a valid feature flag.
intrte_cryptodev_get_dev_id(constchar*name)
Get the device identifier for the named crypto device.
Parametersname device name to select the device structure.
Returns
• Returns crypto device identifier on success.
• Return -1 on failure to find named crypto device.
constchar*rte_cryptodev_name_get(uint8_tdev_id)
Get the crypto device name given a device identifier.
Parametersdev_id The identifier of the device
Returns
• Returns crypto device name.
• Returns NULL if crypto device is not present.
uint8_trte_cryptodev_count(void)
Get the total number of crypto devices that have been successfully initialised.
Returns
• The total number of usable crypto devices.
uint8_trte_cryptodev_device_count_by_driver(uint8_tdriver_id)
Get number of crypto device defined type.
Parametersdriver_id driver identifier.
Returns
Returns number of crypto device.
uint8_trte_cryptodev_devices_get(constchar*driver_name,uint8_t*devices,uint8_tnb_devices)
Get number and identifiers of attached crypto devices that use the same crypto driver.
Parametersdriver_name driver name.
devices output devices identifiers.
nb_devices maximal number of devices.
Returns
Returns number of attached crypto device.
intrte_cryptodev_configure(uint8_tdev_id,structrte_cryptodev_config*config)
Configure a device.
This function must be invoked first before any other function in the API. This function can also be re-
invoked when a device is in the stopped state.
Parametersdev_id The identifier of the device to configure.
config The crypto device configuration structure.
Returns
• 0: Success, device configured.
• <0: Error code returned by the driver configuration function.
intrte_cryptodev_start(uint8_tdev_id)
Start an device.
The device start step is the last one and consists of setting the configured offload features and in
starting the transmit and the receive units of the device. On success, all basic functions exported by
the API (link status, receive/transmit, and so on) can be invoked.
Parametersdev_id The identifier of the device.
Returns
• 0: Success, device started.
• <0: Error code of the driver device start function.
voidrte_cryptodev_stop(uint8_tdev_id)
Stop an device. The device can be restarted with a call to rte_cryptodev_start()Parametersdev_id The identifier of the device.
intrte_cryptodev_close(uint8_tdev_id)
Close an device. The device cannot be restarted!
Parametersdev_id The identifier of the device.
Returns
• 0 on successfully closing device
• <0 on failure to close device
intrte_cryptodev_queue_pair_setup(uint8_tdev_id,uint16_tqueue_pair_id,conststructrte_cryptodev_qp_conf*qp_conf,intsocket_id)
Allocate and set up a receive queue pair for a device.
Parametersdev_id The identifier of the device.
queue_pair_id The index of the queue pairs to set up. The value must be in the range [0,
nb_queue_pair
• 1] previously supplied to rte_cryptodev_configure().
qp_conf The pointer to the configuration data to be used for the queue pair.
socket_id The socket_id argument is the socket identifier in case of NUMA. The value can be
SOCKET_ID_ANY if there is no NUMA constraint for the DMA memory allocated for the receive queue pair.
Returns
• 0: Success, queue pair correctly set up.
• <0: Queue pair configuration failed
__rte_experimentalintrte_cryptodev_queue_pair_reset(uint8_tdev_id,uint16_tqueue_pair_id,conststructrte_cryptodev_qp_conf*qp_conf,intsocket_id)WarningEXPERIMENTAL: this API may change without prior notice.
Reset a queue pair for a device. The caller of this API must ensure that, there are no enqueues to the
queue and there are no pending/inflight packets in the queue when the API is called. The API can
reconfigure the queue pair when the queue pair configuration data is provided.
Parametersdev_id The identifier of the device.
queue_pair_id The index of the queue pairs to set up. The value must be in the range [0,
nb_queue_pair - 1] previously supplied to rte_cryptodev_configure().
qp_conf The pointer to configuration data to be used for the queue pair. It should be NULL, if the
API is called from an interrupt context.
socket_id The socket_id argument is the socket identifier in case of NUMA. The value can be
SOCKET_ID_ANY if there is no NUMA constraint for the DMA memory allocated for the queue pair.
Returns
• 0: Queue pair is reset successfully.
• ENOTSUP: If the operation is not supported by the PMD.
• <0: Queue pair reset failed
intrte_cryptodev_get_qp_status(uint8_tdev_id,uint16_tqueue_pair_id)
Get the status of queue pairs setup on a specific crypto device
Parametersdev_id Crypto device identifier.
queue_pair_id The index of the queue pairs to set up. The value must be in the range [0,
nb_queue_pair
• 1] previously supplied to rte_cryptodev_configure().
Returns
• 0: qp was not configured
• 1: qp was configured
• -EINVAL: device was not configured
uint16_trte_cryptodev_queue_pair_count(uint8_tdev_id)
Get the number of queue pairs on a specific crypto device
Parametersdev_id Crypto device identifier.
Returns
• The number of configured queue pairs.
intrte_cryptodev_stats_get(uint8_tdev_id,structrte_cryptodev_stats*stats)
Retrieve the general I/O statistics of a device.
Parametersdev_id The identifier of the device.
stats A pointer to a structure of type rte_cryptodev_statstobefilledwiththevaluesofdevicecounters.Returns
• Zero if successful.
• Non-zero otherwise.
voidrte_cryptodev_stats_reset(uint8_tdev_id)
Reset the general I/O statistics of a device.
Parametersdev_id The identifier of the device.
voidrte_cryptodev_info_get(uint8_tdev_id,structrte_cryptodev_info*dev_info)
Retrieve the contextual information of a device.
Parametersdev_id The identifier of the device.
dev_info A pointer to a structure of type rte_cryptodev_infotobefilledwiththecontextualinformationofthedevice.Note
The capabilities field of dev_info is set to point to the first element of an array of struct
rte_cryptodev_capabilities. The element after the last valid element has it's op field set to
RTE_CRYPTO_OP_TYPE_UNDEFINED.
intrte_cryptodev_callback_register(uint8_tdev_id,enumrte_cryptodev_event_typeevent,rte_cryptodev_cb_fncb_fn,void*cb_arg)
Register a callback function for specific device id.
Parametersdev_id Device id.
event Event interested.
cb_fn User supplied callback function to be called.
cb_arg Pointer to the parameters for the registered callback.
Returns
• On success, zero.
• On failure, a negative value.
intrte_cryptodev_callback_unregister(uint8_tdev_id,enumrte_cryptodev_event_typeevent,rte_cryptodev_cb_fncb_fn,void*cb_arg)
Unregister a callback function for specific device id.
Parametersdev_id The device identifier.
event Event interested.
cb_fn User supplied callback function to be called.
cb_arg Pointer to the parameters for the registered callback.
Returns
• On success, zero.
• On failure, a negative value.
__rte_experimentalintrte_cryptodev_queue_pair_event_error_query(uint8_tdev_id,uint16_tqp_id)WarningEXPERIMENTAL: this API may change without prior notice.
Query a cryptodev queue pair if there are pending RTE_CRYPTODEV_EVENT_ERROR events.
Parametersdev_id The device identifier.
qp_id Queue pair index to be queried.
Returns
• 1 if requested queue has a pending event.
• 0 if no pending event is found.
• a negative value on failure
RTE_TAILQ_HEAD(rte_cryptodev_cb_list,rte_cryptodev_callback)
Structure to keep track of registered callbacks
void*rte_cryptodev_get_sec_ctx(uint8_tdev_id)
Get the security context for the cryptodev.
Parametersdev_id The device identifier.
Returns
• NULL on error.
• Pointer to security context on success.
structrte_mempool*rte_cryptodev_sym_session_pool_create(constchar*name,uint32_tnb_elts,uint32_telt_size,uint32_tcache_size,uint16_tpriv_size,intsocket_id)
Create a symmetric session mempool.
Parametersname The unique mempool name.
nb_elts The number of elements in the mempool.
elt_size The size of the element. This should be the size of the cryptodev PMD session private data
obtained through rte_cryptodev_sym_get_private_session_size() function call. For the user who wants
to use the same mempool for heterogeneous PMDs this value should be the maximum value of their
private session sizes. Please note the created mempool will have bigger elt size than this value as
necessary session header and the possible padding are filled into each elt.
cache_size The number of per-lcore cache elements
priv_size The private data size of each session.
socket_id The socket_id argument is the socket identifier in the case of NUMA. The value can be
SOCKET_ID_ANY if there is no NUMA constraint for the reserved zone.
Returns
• On success returns the created session mempool pointer
• On failure returns NULL
structrte_mempool*rte_cryptodev_asym_session_pool_create(constchar*name,uint32_tnb_elts,uint32_tcache_size,uint16_tuser_data_size,intsocket_id)
Create an asymmetric session mempool.
Parametersname The unique mempool name.
nb_elts The number of elements in the mempool.
cache_size The number of per-lcore cache elements
user_data_size The size of user data to be placed after session private data.
socket_id The socket_id argument is the socket identifier in the case of NUMA. The value can be
SOCKET_ID_ANY if there is no NUMA constraint for the reserved zone.
Returns
• On success return mempool
• On failure returns NULL
void*rte_cryptodev_sym_session_create(uint8_tdev_id,structrte_crypto_sym_xform*xforms,structrte_mempool*mp)
Create symmetric crypto session and fill out private data for the device id, based on its device type.
Parametersdev_id ID of device that we want the session to be used on
xforms Symmetric crypto transform operations to apply on flow processed with this session
mp Mempool to allocate symmetric session objects from
Returns
• On success return pointer to sym-session.
• On failure returns NULL and rte_errno is set to the error code:
• EINVAL on invalid arguments.
• ENOMEM on memory error for session allocation.
• ENOTSUP if device doesn't support session configuration.
intrte_cryptodev_asym_session_create(uint8_tdev_id,structrte_crypto_asym_xform*xforms,structrte_mempool*mp,void**session)
Create and initialise an asymmetric crypto session structure. Calls the PMD to configure the private
session data.
Parametersdev_id ID of device that we want the session to be used on
xforms Asymmetric crypto transform operations to apply on flow processed with this session
mp mempool to allocate asymmetric session objects from
session void ** for session to be used
Returns
• 0 on success.
• -EINVAL on invalid arguments.
• -ENOMEM on memory error for session allocation.
• -ENOTSUP if device doesn't support session configuration.
intrte_cryptodev_sym_session_free(uint8_tdev_id,void*sess)
Frees session for the device id and returning it to its mempool. It is the application's responsibility
to ensure that the session is not still in-flight operations using it.
Parametersdev_id ID of device that uses the session.
sess Session header to be freed.
Returns
• 0 if successful.
• -EINVAL if session is NULL or the mismatched device ids.
intrte_cryptodev_asym_session_free(uint8_tdev_id,void*sess)
Clears and frees asymmetric crypto session header and private data, returning it to its original mempool.
Parametersdev_id ID of device that uses the asymmetric session.
sess Session header to be freed.
Returns
• 0 if successful.
• -EINVAL if device is invalid or session is NULL.
unsignedintrte_cryptodev_asym_get_header_session_size(void)
Get the size of the asymmetric session header.
Returns
Size of the asymmetric header session.
unsignedintrte_cryptodev_sym_get_private_session_size(uint8_tdev_id)
Get the size of the private symmetric session data for a device.
Parametersdev_id The device identifier.
Returns
• Size of the private data, if successful
• 0 if device is invalid or does not have private symmetric session
unsignedintrte_cryptodev_asym_get_private_session_size(uint8_tdev_id)
Get the size of the private data for asymmetric session on device
Parametersdev_id The device identifier.
Returns
• Size of the asymmetric private data, if successful
• 0 if device is invalid or does not have private session
unsignedintrte_cryptodev_is_valid_dev(uint8_tdev_id)
Validate if the crypto device index is valid attached crypto device.
Parametersdev_id Crypto device index.
Returns
• If the device index is valid (1) or not (0).
intrte_cryptodev_driver_id_get(constchar*name)
Provide driver identifier.
Parametersname The pointer to a driver name.
Returns
The driver type identifier or -1 if no driver found
constchar*rte_cryptodev_driver_name_get(uint8_tdriver_id)
Provide driver name.
Parametersdriver_id The driver identifier.
Returns
The driver name or null if no driver found
intrte_cryptodev_sym_session_set_user_data(void*sess,void*data,uint16_tsize)
Store user data in a session.
Parameterssess Session pointer allocated by rte_cryptodev_sym_session_create.
data Pointer to the user data.
size Size of the user data.
Returns
• On success, zero.
• On failure, a negative value.
staticuint64_trte_cryptodev_sym_session_opaque_data_get(void*sess)[inline],[static]
Get opaque data from session handle
Definition at line 1299 of file rte_cryptodev.h.
staticvoidrte_cryptodev_sym_session_opaque_data_set(void*sess,uint64_topaque)[inline],[static]
Set opaque data in session handle
Definition at line 1308 of file rte_cryptodev.h.
void*rte_cryptodev_sym_session_get_user_data(void*sess)
Get user data stored in a session.
Parameterssess Session pointer allocated by rte_cryptodev_sym_session_create.
Returns
• On success return pointer to user data.
• On failure returns NULL.
intrte_cryptodev_asym_session_set_user_data(void*sess,void*data,uint16_tsize)
Store user data in an asymmetric session.
Parameterssess Session pointer allocated by rte_cryptodev_asym_session_create.
data Pointer to the user data.
size Size of the user data.
Returns
• On success, zero.
• -EINVAL if the session pointer is invalid.
• -ENOMEM if the available user data size is smaller than the size parameter.
void*rte_cryptodev_asym_session_get_user_data(void*sess)
Get user data stored in an asymmetric session.
Parameterssess Session pointer allocated by rte_cryptodev_asym_session_create.
Returns
• On success return pointer to user data.
• On failure returns NULL.
uint32_trte_cryptodev_sym_cpu_crypto_process(uint8_tdev_id,void*sess,unionrte_crypto_sym_ofsofs,structrte_crypto_sym_vec*vec)
Perform actual crypto processing (encrypt/digest or auth/decrypt) on user provided data.
Parametersdev_id The device identifier.
sess Cryptodev session structure
ofs Start and stop offsets for auth and cipher operations
vec Vectorized operation descriptor
Returns
• Returns number of successfully processed packets.
intrte_cryptodev_get_raw_dp_ctx_size(uint8_tdev_id)
Get the size of the raw data-path context buffer.
Parametersdev_id The device identifier.
Returns
• If the device supports raw data-path APIs, return the context size.
• If the device does not support the APIs, return -1.
intrte_cryptodev_session_event_mdata_set(uint8_tdev_id,void*sess,enumrte_crypto_op_typeop_type,enumrte_crypto_op_sess_typesess_type,void*ev_mdata,uint16_tsize)
Set session event meta data
Parametersdev_id The device identifier.
sess Crypto or security session.
op_type Operation type.
sess_type Session type.
ev_mdata Pointer to the event crypto meta data (aka unionrte_event_crypto_metadata)sizeSizeofev_mdata.Returns
• On success, zero.
• On failure, a negative value.
intrte_cryptodev_configure_raw_dp_ctx(uint8_tdev_id,uint16_tqp_id,structrte_crypto_raw_dp_ctx*ctx,enumrte_crypto_op_sess_typesess_type,unionrte_cryptodev_session_ctxsession_ctx,uint8_tis_update)
Configure raw data-path context data.
Parametersdev_id The device identifier.
qp_id The index of the queue pair from which to retrieve processed packets. The value must be in the
range [0, nb_queue_pair - 1] previously supplied to rte_cryptodev_configure().
ctx The raw data-path context data.
sess_type Session type.
session_ctx Session context data.
is_update Set 0 if it is to initialize the ctx. Set 1 if ctx is initialized and only to update
session context data.
Returns
• On success return 0.
• On failure return negative integer.
• -EINVAL if input parameters are invalid.
• -ENOTSUP if crypto device does not support raw DP operations with the provided session.
uint32_trte_cryptodev_raw_enqueue_burst(structrte_crypto_raw_dp_ctx*ctx,structrte_crypto_sym_vec*vec,unionrte_crypto_sym_ofsofs,void**user_data,int*enqueue_status)
Enqueue a vectorized operation descriptor into the device queue but the driver may or may not start
processing until rte_cryptodev_raw_enqueue_done() is called.
Parametersctx The initialized raw data-path context data.
vec Vectorized operation descriptor.
ofs Start and stop offsets for auth and cipher operations.
user_data The array of user data for dequeue later.
enqueue_status Driver written value to specify the enqueue status. Possible values:
• 1: The number of operations returned are enqueued successfully.
• 0: The number of operations returned are cached into the queue but are not processed until
rte_cryptodev_raw_enqueue_done() is called.
• negative integer: Error occurred.
Returns
• The number of operations in the descriptor successfully enqueued or cached into the queue but not
enqueued yet, depends on the 'enqueue_status' value.
static__rte_experimental__rte_always_inlineintrte_cryptodev_raw_enqueue(structrte_crypto_raw_dp_ctx*ctx,structrte_crypto_vec*data_vec,uint16_tn_data_vecs,unionrte_crypto_sym_ofsofs,structrte_crypto_va_iova_ptr*iv,structrte_crypto_va_iova_ptr*digest,structrte_crypto_va_iova_ptr*aad_or_auth_iv,void*user_data)[static]
Enqueue single raw data vector into the device queue but the driver may or may not start processing until
rte_cryptodev_raw_enqueue_done() is called.
Parametersctx The initialized raw data-path context data.
data_vec The buffer data vector.
n_data_vecs Number of buffer data vectors.
ofs Start and stop offsets for auth and cipher operations.
iv IV virtual and IOVA addresses
digest digest virtual and IOVA addresses
aad_or_auth_iv AAD or auth IV virtual and IOVA addresses, depends on the algorithm used.
user_data The user data.
Returns
• 1: The data vector is enqueued successfully.
• 0: The data vector is cached into the queue but is not processed until
rte_cryptodev_raw_enqueue_done() is called.
• negative integer: failure.
Definition at line 1684 of file rte_cryptodev.h.
intrte_cryptodev_raw_enqueue_done(structrte_crypto_raw_dp_ctx*ctx,uint32_tn)
Start processing all enqueued operations from last rte_cryptodev_configure_raw_dp_ctx() call.
Parametersctx The initialized raw data-path context data.
n The number of operations cached.
Returns
• On success return 0.
• On failure return negative integer.
uint32_trte_cryptodev_raw_dequeue_burst(structrte_crypto_raw_dp_ctx*ctx,rte_cryptodev_raw_get_dequeue_count_tget_dequeue_count,uint32_tmax_nb_to_dequeue,rte_cryptodev_raw_post_dequeue_tpost_dequeue,void**out_user_data,uint8_tis_user_data_array,uint32_t*n_success,int*dequeue_status)
Dequeue a burst of symmetric crypto processing.
Parametersctx The initialized raw data-path context data.
get_dequeue_count User provided callback function to obtain dequeue operation count.
max_nb_to_dequeue When get_dequeue_count is NULL this value is used to pass the maximum number of
operations to be dequeued.
post_dequeue User provided callback function to post-process a dequeued operation.
out_user_data User data pointer array to be retrieve from device queue. In case of is_user_data_array
is set there should be enough room to store all user data.
is_user_data_array Set 1 if every dequeued user data will be written into out_user_data array. Set 0
if only the first user data will be written into out_user_data array.
n_success Driver written value to specific the total successful operations count.
dequeue_status Driver written value to specify the dequeue status. Possible values:
• 1: Successfully dequeued the number of operations returned. The user data previously set during
enqueue is stored in the 'out_user_data'.
• 0: The number of operations returned are completed and the user data is stored in the
'out_user_data', but they are not freed from the queue until rte_cryptodev_raw_dequeue_done() is
called.
• negative integer: Error occurred.
Returns
• The number of operations dequeued or completed but not freed from the queue, depends on
'dequeue_status' value.
static__rte_experimental__rte_always_inlinevoid*rte_cryptodev_raw_dequeue(structrte_crypto_raw_dp_ctx*ctx,int*dequeue_status,enumrte_crypto_op_status*op_status)[static]
Dequeue a symmetric crypto processing.
Parametersctx The initialized raw data-path context data.
dequeue_status Driver written value to specify the dequeue status. Possible values:
• 1: Successfully dequeued a operation. The user data is returned.
• 0: The first operation in the queue is completed and the user data previously set during enqueue is
returned, but it is not freed from the queue until rte_cryptodev_raw_dequeue_done() is called.
• negative integer: Error occurred.
op_status Driver written value to specify operation status.
Returns
• The user data pointer retrieved from device queue or NULL if no operation is ready for dequeue.
Definition at line 1784 of file rte_cryptodev.h.
intrte_cryptodev_raw_dequeue_done(structrte_crypto_raw_dp_ctx*ctx,uint32_tn)
Inform the queue pair dequeue operations is finished.
Parametersctx The initialized raw data-path context data.
n The number of operations.
Returns
• On success return 0.
• On failure return negative integer.
structrte_cryptodev_cb*rte_cryptodev_add_enq_callback(uint8_tdev_id,uint16_tqp_id,rte_cryptodev_callback_fncb_fn,void*cb_arg)
Add a user callback for a given crypto device and queue pair which will be called on crypto ops enqueue.
This API configures a function to be called for each burst of crypto ops received on a given crypto
device queue pair. The return value is a pointer that can be used later to remove the callback using
rte_cryptodev_remove_enq_callback().
Callbacks registered by application would not survive rte_cryptodev_configure() as it reinitializes the
callback list. It is user responsibility to remove all installed callbacks before calling
rte_cryptodev_configure() to avoid possible memory leakage. Application is expected to call add API after
rte_cryptodev_configure().
Multiple functions can be registered per queue pair & they are called in the order they were added. The
API does not restrict on maximum number of callbacks.
Parametersdev_id The identifier of the device.
qp_id The index of the queue pair on which ops are to be enqueued for processing. The value must be
in the range [0, nb_queue_pairs - 1] previously supplied to rte_cryptodev_configure.
cb_fn The callback function
cb_arg A generic pointer parameter which will be passed to each invocation of the callback function
on this crypto device and queue pair.
Returns
• NULL on error & rte_errno will contain the error code.
• On success, a pointer value which can later be used to remove the callback.
intrte_cryptodev_remove_enq_callback(uint8_tdev_id,uint16_tqp_id,structrte_cryptodev_cb*cb)
Remove a user callback function for given crypto device and queue pair.
This function is used to remove enqueue callbacks that were added to a crypto device queue pair using
rte_cryptodev_add_enq_callback().
Parametersdev_id The identifier of the device.
qp_id The index of the queue pair on which ops are to be enqueued. The value must be in the range [0,
nb_queue_pairs - 1] previously supplied to rte_cryptodev_configure.
cb Pointer to user supplied callback created via rte_cryptodev_add_enq_callback().
Returns
• 0: Success. Callback was removed.
• <0: The dev_id or the qp_id is out of range, or the callback is NULL or not found for the crypto
device queue pair.
structrte_cryptodev_cb*rte_cryptodev_add_deq_callback(uint8_tdev_id,uint16_tqp_id,rte_cryptodev_callback_fncb_fn,void*cb_arg)
Add a user callback for a given crypto device and queue pair which will be called on crypto ops dequeue.
This API configures a function to be called for each burst of crypto ops received on a given crypto
device queue pair. The return value is a pointer that can be used later to remove the callback using
rte_cryptodev_remove_deq_callback().
Callbacks registered by application would not survive rte_cryptodev_configure() as it reinitializes the
callback list. It is user responsibility to remove all installed callbacks before calling
rte_cryptodev_configure() to avoid possible memory leakage. Application is expected to call add API after
rte_cryptodev_configure().
Multiple functions can be registered per queue pair & they are called in the order they were added. The
API does not restrict on maximum number of callbacks.
Parametersdev_id The identifier of the device.
qp_id The index of the queue pair on which ops are to be dequeued. The value must be in the range [0,
nb_queue_pairs - 1] previously supplied to rte_cryptodev_configure.
cb_fn The callback function
cb_arg A generic pointer parameter which will be passed to each invocation of the callback function
on this crypto device and queue pair.
Returns
• NULL on error & rte_errno will contain the error code.
• On success, a pointer value which can later be used to remove the callback.
intrte_cryptodev_remove_deq_callback(uint8_tdev_id,uint16_tqp_id,structrte_cryptodev_cb*cb)
Remove a user callback function for given crypto device and queue pair.
This function is used to remove dequeue callbacks that were added to a crypto device queue pair using
rte_cryptodev_add_deq_callback().
Parametersdev_id The identifier of the device.
qp_id The index of the queue pair on which ops are to be dequeued. The value must be in the range [0,
nb_queue_pairs - 1] previously supplied to rte_cryptodev_configure.
cb Pointer to user supplied callback created via rte_cryptodev_add_deq_callback().
Returns
• 0: Success. Callback was removed.
• <0: The dev_id or the qp_id is out of range, or the callback is NULL or not found for the crypto
device queue pair.
staticuint16_trte_cryptodev_dequeue_burst(uint8_tdev_id,uint16_tqp_id,structrte_crypto_op**ops,uint16_tnb_ops)[inline],[static]
Dequeue a burst of processed crypto operations from a queue on the crypto device. The dequeued operation
are stored in rte_crypto_opstructureswhosepointersaresuppliedintheopsarray.
The rte_cryptodev_dequeue_burst() function returns the number of ops actually dequeued, which is the
number of rte_crypto_opdatastructureseffectivelysuppliedintotheopsarray.
A return value equal to nb_ops indicates that the queue contained at least nb_ops operations, and this is
likely to signify that other processed operations remain in the devices output queue. Applications
implementing a 'retrieve as many processed operations as possible' policy can check this specific case
and keep invoking the rte_cryptodev_dequeue_burst() function until a value less than nb_ops is returned.
The rte_cryptodev_dequeue_burst() function does not provide any error notification to avoid the
corresponding overhead.
Parametersdev_id The symmetric crypto device identifier
qp_id The index of the queue pair from which to retrieve processed packets. The value must be in the
range [0, nb_queue_pair - 1] previously supplied to rte_cryptodev_configure().
ops The address of an array of pointers to rte_crypto_opstructuresthatmustbelargeenoughtostorenb_opspointersinit.nb_opsThemaximumnumberofoperationstodequeue.Returns
• The number of operations actually dequeued, which is the number of pointers to rte_crypto_opstructureseffectivelysuppliedtotheopsarray.
Definition at line 1982 of file rte_cryptodev.h.
staticuint16_trte_cryptodev_enqueue_burst(uint8_tdev_id,uint16_tqp_id,structrte_crypto_op**ops,uint16_tnb_ops)[inline],[static]
Enqueue a burst of operations for processing on a crypto device.
The rte_cryptodev_enqueue_burst() function is invoked to place crypto operations on the queue qp_id of
the device designated by its dev_id.
The nb_ops parameter is the number of operations to process which are supplied in the ops array of
rte_crypto_opstructures.
The rte_cryptodev_enqueue_burst() function returns the number of operations it actually enqueued for
processing. A return value equal to nb_ops means that all packets have been enqueued.
Parametersdev_id The identifier of the device.
qp_id The index of the queue pair which packets are to be enqueued for processing. The value must be
in the range [0, nb_queue_pairs - 1] previously supplied to rte_cryptodev_configure.
ops The address of an array of nb_ops pointers to rte_crypto_opstructureswhichcontainthecryptooperationstobeprocessed.nb_opsThenumberofoperationstoprocess.Returns
The number of operations actually enqueued on the crypto device. The return value can be less than
the value of the nb_ops parameter when the crypto devices queue is full or if invalid parameters are
specified in a rte_crypto_op.
Definition at line 2054 of file rte_cryptodev.h.
static__rte_experimentalintrte_cryptodev_qp_depth_used(uint8_tdev_id,uint16_tqp_id)[inline],[static]WarningEXPERIMENTAL: this API may change, or be removed, without prior notice
Get the number of used descriptors or depth of a cryptodev queue pair.
This function retrieves the number of used descriptors in a crypto queue. Applications can use this API
in the fast path to inspect QP occupancy and take appropriate action.
Since it is a fast-path function, no check is performed on dev_id and qp_id. Caller must therefore ensure
that the device is enabled and queue pair is setup.
Parametersdev_id The identifier of the device.
qp_id The index of the queue pair for which used descriptor count is to be retrieved. The value must
be in the range [0, nb_queue_pairs - 1] previously supplied to rte_cryptodev_configure.
Returns
The number of used descriptors on the specified queue pair, or:
• (-ENOTSUP) if the device does not support this function.
Definition at line 2117 of file rte_cryptodev.h.