src/dpdk/drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
static int
snow3g_pmd_sym_session_configure(struct rte_cryptodev *dev,
		struct rte_crypto_sym_xform *xform,
		struct rte_cryptodev_sym_session *sess,
		struct rte_mempool *mempool)
{
	void *sess_private_data;
	int ret;
	struct snow3g_private *internals = dev->data->dev_private;

	if (unlikely(sess == NULL)) {
		SNOW3G_LOG(ERR, "invalid session struct");
		return -EINVAL;
	}

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

	ret = snow3g_set_session_parameters(internals->mgr,
					sess_private_data, xform);
	if (ret != 0) {
		SNOW3G_LOG(ERR, "failed configure session parameters");

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

	set_sym_session_private_data(sess, dev->driver_id,
		sess_private_data);

	return 0;
}
/** Configure a SNOW 3G session from a crypto xform chain */
Configure a SNOW 3G session from a crypto xform chain
Configure a SNOW 3G session from a crypto xform chain
static int
snow3g_pmd_sym_session_configure(struct rte_cryptodev *dev,
		struct rte_crypto_sym_xform *xform,
		struct rte_cryptodev_sym_session *sess,
		struct rte_mempool *mempool)
{
	void *sess_private_data;
	int ret;
	struct snow3g_private *internals = dev->data->dev_private;
	if (unlikely(sess == NULL)) {
		SNOW3G_LOG(ERR, "invalid session struct");
		return -EINVAL;
	}
	if (rte_mempool_get(mempool, &sess_private_data)) {
		SNOW3G_LOG(ERR,
			"Couldn't get object from session mempool");
		return -ENOMEM;
	}
	ret = snow3g_set_session_parameters(internals->mgr,
					sess_private_data, xform);
	if (ret != 0) {
		SNOW3G_LOG(ERR, "failed configure session parameters");
		rte_mempool_put(mempool, sess_private_data);
		return ret;
	}
	set_sym_session_private_data(sess, dev->driver_id,
		sess_private_data);
	return 0;
}
static int snow3g_pmd_sym_session_configure ( struct rte_cryptodev * dev , struct rte_crypto_sym_xform * xform , struct rte_cryptodev_sym_session * sess , struct rte_mempool * mempool ) { void * sess_private_data ; int ret ; struct snow3g_private * internals = dev -> data -> dev_private ; if ( unlikely ( sess == NULL ) ) { SNOW3G_LOG ( ERR , " " ) ; return - EINVAL ; } if ( rte_mempool_get ( mempool , & sess_private_data ) ) { SNOW3G_LOG ( ERR , " " ) ; return - ENOMEM ; } ret = snow3g_set_session_parameters ( internals -> mgr , sess_private_data , xform ) ; if ( ret != 0 ) { SNOW3G_LOG ( ERR , " " ) ; rte_mempool_put ( mempool , sess_private_data ) ; return ret ; } set_sym_session_private_data ( sess , dev -> driver_id , sess_private_data ) ; return 0 ; }
Configure a SNOW 3G session from a crypto xform chain
Configure a SNOW 3G session from a crypto xform chain
/* Return session to mempool */