src/dpdk/drivers/crypto/caam_jr/caam_jr.c
static int
caam_jr_dev_uninit(struct rte_cryptodev *dev)
{
	struct sec_job_ring_t *internals;

	PMD_INIT_FUNC_TRACE();
	if (dev == NULL)
		return -ENODEV;

	internals = dev->data->dev_private;
	rte_free(dev->security_ctx);

	/* If any descriptors in flight , poll and wait
	 * until all descriptors are received and silently discarded.
	 */
	if (internals) {
		shutdown_job_ring(internals);
		close_job_ring(internals);
		rte_mempool_free(internals->ctx_pool);
	}

	CAAM_JR_INFO("Closing crypto device %s", dev->data->name);

	/* last caam jr instance) */
	if (g_job_rings_no == 0)
		g_driver_state = SEC_DRIVER_STATE_IDLE;

	return SEC_SUCCESS;
}
/*
 * @brief Release the resources used by the SEC user space driver.
 *
 * Reset and release SEC's job rings indicated by the User Application at
 * init_job_ring() and free any memory allocated internally.
 * Call once during application tear down.
 *
 * @note In case there are any descriptors in-flight (descriptors received by
 * SEC driver for processing and for which no response was yet provided to UA),
 * the descriptors are discarded without any notifications to User Application.
 *
 * @retval ::0			is returned for a successful execution
 * @retval ::-1		is returned if SEC driver release is in progress
 */
@brief Release the resources used by the SEC user space driver.
Reset and release SEC's job rings indicated by the User Application at
init_job_ring() and free any memory allocated internally.
Call once during application tear down.

@note In case there are any descriptors in-flight (descriptors received by
SEC driver for processing and for which no response was yet provided to UA),
the descriptors are discarded without any notifications to User Application.

@retval ::0                  is returned for a successful execution
@retval ::-1         is returned if SEC driver release is in progress
@brief Release the resources used by the SEC user space driver . Reset and release SEC ' s job rings indicated by the User Application at init_job_ring () and free any memory allocated internally . Call once during application tear down . @note In case there are any descriptors in - flight ( descriptors received by SEC driver for processing and for which no response was yet provided to UA ) the descriptors are discarded without any notifications to User Application . @retval :: 0 is returned for a successful execution @retval :: - 1 is returned if SEC driver release is in progress
static int
caam_jr_dev_uninit(struct rte_cryptodev *dev)
{
	struct sec_job_ring_t *internals;
	PMD_INIT_FUNC_TRACE();
	if (dev == NULL)
		return -ENODEV;
	internals = dev->data->dev_private;
	rte_free(dev->security_ctx);
	if (internals) {
		shutdown_job_ring(internals);
		close_job_ring(internals);
		rte_mempool_free(internals->ctx_pool);
	}
	CAAM_JR_INFO("Closing crypto device %s", dev->data->name);
	if (g_job_rings_no == 0)
		g_driver_state = SEC_DRIVER_STATE_IDLE;
	return SEC_SUCCESS;
}
static int caam_jr_dev_uninit ( struct rte_cryptodev * dev ) { struct sec_job_ring_t * internals ; PMD_INIT_FUNC_TRACE ( ) ; if ( dev == NULL ) return - ENODEV ; internals = dev -> data -> dev_private ; rte_free ( dev -> security_ctx ) ; if ( internals ) { shutdown_job_ring ( internals ) ; close_job_ring ( internals ) ; rte_mempool_free ( internals -> ctx_pool ) ; } CAAM_JR_INFO ( " " , dev -> data -> name ) ; if ( g_job_rings_no == 0 ) g_driver_state = SEC_DRIVER_STATE_IDLE ; return SEC_SUCCESS ; }
@brief Release the resources used by the SEC user space driver.
@brief Release the resources used by the SEC user space driver .
/* If any descriptors in flight , poll and wait
	 * until all descriptors are received and silently discarded.
	 */ /* last caam jr instance) */