src/dpdk/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
static int
aesni_mb_pmd_sec_sess_create(void *dev, struct rte_security_session_conf *conf,
		struct rte_security_session *sess,
		struct rte_mempool *mempool)
{
	void *sess_private_data;
	struct rte_cryptodev *cdev = (struct rte_cryptodev *)dev;
	int ret;

	if (conf->action_type != RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL ||
			conf->protocol != RTE_SECURITY_PROTOCOL_DOCSIS) {
		AESNI_MB_LOG(ERR, "Invalid security protocol");
		return -EINVAL;
	}

	if (rte_mempool_get(mempool, &sess_private_data)) {
		AESNI_MB_LOG(ERR, "Couldn't get object from session mempool");
		return -ENOMEM;
	}

	ret = aesni_mb_set_docsis_sec_session_parameters(cdev, conf,
			sess_private_data);

	if (ret != 0) {
		AESNI_MB_LOG(ERR, "Failed to configure session parameters");

		/* Return session to mempool */
		rte_mempool_put(mempool, sess_private_data);
		return ret;
	}

	set_sec_session_private_data(sess, sess_private_data);

	return ret;
}
/**
 * Configure a aesni multi-buffer session from a security session
 * configuration
 */
Configure a aesni multi-buffer session from a security session
configuration
Configure a aesni multi - buffer session from a security session configuration
static int
aesni_mb_pmd_sec_sess_create(void *dev, struct rte_security_session_conf *conf,
		struct rte_security_session *sess,
		struct rte_mempool *mempool)
{
	void *sess_private_data;
	struct rte_cryptodev *cdev = (struct rte_cryptodev *)dev;
	int ret;
	if (conf->action_type != RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL ||
			conf->protocol != RTE_SECURITY_PROTOCOL_DOCSIS) {
		AESNI_MB_LOG(ERR, "Invalid security protocol");
		return -EINVAL;
	}
	if (rte_mempool_get(mempool, &sess_private_data)) {
		AESNI_MB_LOG(ERR, "Couldn't get object from session mempool");
		return -ENOMEM;
	}
	ret = aesni_mb_set_docsis_sec_session_parameters(cdev, conf,
			sess_private_data);
	if (ret != 0) {
		AESNI_MB_LOG(ERR, "Failed to configure session parameters");
		rte_mempool_put(mempool, sess_private_data);
		return ret;
	}
	set_sec_session_private_data(sess, sess_private_data);
	return ret;
}
static int aesni_mb_pmd_sec_sess_create ( void * dev , struct rte_security_session_conf * conf , struct rte_security_session * sess , struct rte_mempool * mempool ) { void * sess_private_data ; struct rte_cryptodev * cdev = ( struct rte_cryptodev * ) dev ; int ret ; if ( conf -> action_type != RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL || conf -> protocol != RTE_SECURITY_PROTOCOL_DOCSIS ) { AESNI_MB_LOG ( ERR , " " ) ; return - EINVAL ; } if ( rte_mempool_get ( mempool , & sess_private_data ) ) { AESNI_MB_LOG ( ERR , " " ) ; return - ENOMEM ; } ret = aesni_mb_set_docsis_sec_session_parameters ( cdev , conf , sess_private_data ) ; if ( ret != 0 ) { AESNI_MB_LOG ( ERR , " " ) ; rte_mempool_put ( mempool , sess_private_data ) ; return ret ; } set_sec_session_private_data ( sess , sess_private_data ) ; return ret ; }
Configure a aesni multi-buffer session from a security session
 configuration
Configure a aesni multi - buffer session from a security session configuration
/* Return session to mempool */