src/dpdk/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
static void
mrvl_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev,
		struct rte_cryptodev_sym_session *sess)
{

	uint8_t index = dev->driver_id;
	void *sess_priv = get_sym_session_private_data(sess, index);

	/* Zero out the whole structure */
	if (sess_priv) {
		struct mrvl_crypto_session *mrvl_sess =
			(struct mrvl_crypto_session *)sess_priv;

		if (mrvl_sess->sam_sess &&
		    sam_session_destroy(mrvl_sess->sam_sess) < 0) {
			MRVL_LOG(ERR, "Error while destroying session!");
		}

		memset(sess, 0, sizeof(struct mrvl_crypto_session));
		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
		set_sym_session_private_data(sess, index, NULL);
		rte_mempool_put(sess_mp, sess_priv);
	}
}
/**
 * Clear the memory of session so it doesn't leave key material behind.
 *
 * @param dev Pointer to the device structure.
 * @returns 0. Always.
 */
Clear the memory of session so it doesn't leave key material behind.
@param dev Pointer to the device structure.
@returns 0. Always.
Clear the memory of session so it doesn ' t leave key material behind . @param dev Pointer to the device structure . @returns 0 . Always .
static void
mrvl_crypto_pmd_sym_session_clear(struct rte_cryptodev *dev,
		struct rte_cryptodev_sym_session *sess)
{
	uint8_t index = dev->driver_id;
	void *sess_priv = get_sym_session_private_data(sess, index);
	if (sess_priv) {
		struct mrvl_crypto_session *mrvl_sess =
			(struct mrvl_crypto_session *)sess_priv;
		if (mrvl_sess->sam_sess &&
		    sam_session_destroy(mrvl_sess->sam_sess) < 0) {
			MRVL_LOG(ERR, "Error while destroying session!");
		}
		memset(sess, 0, sizeof(struct mrvl_crypto_session));
		struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
		set_sym_session_private_data(sess, index, NULL);
		rte_mempool_put(sess_mp, sess_priv);
	}
}
static void mrvl_crypto_pmd_sym_session_clear ( struct rte_cryptodev * dev , struct rte_cryptodev_sym_session * sess ) { uint8_t index = dev -> driver_id ; void * sess_priv = get_sym_session_private_data ( sess , index ) ; if ( sess_priv ) { struct mrvl_crypto_session * mrvl_sess = ( struct mrvl_crypto_session * ) sess_priv ; if ( mrvl_sess -> sam_sess && sam_session_destroy ( mrvl_sess -> sam_sess ) < 0 ) { MRVL_LOG ( ERR , " " ) ; } memset ( sess , 0 , sizeof ( struct mrvl_crypto_session ) ) ; struct rte_mempool * sess_mp = rte_mempool_from_obj ( sess_priv ) ; set_sym_session_private_data ( sess , index , NULL ) ; rte_mempool_put ( sess_mp , sess_priv ) ; } }
Clear the memory of session so it doesn't leave key material behind.
Clear the memory of session so it doesn ' t leave key material behind .
/* Zero out the whole structure */