src/dpdk/drivers/crypto/bcmfs/bcmfs_sym_session.c
static enum bcmfs_sym_chain_order
crypto_get_chain_order(const struct rte_crypto_sym_xform *xform)
{
	enum bcmfs_sym_chain_order res = BCMFS_SYM_CHAIN_NOT_SUPPORTED;

	if (xform != NULL) {
		if (xform->type == RTE_CRYPTO_SYM_XFORM_AEAD)
			res = BCMFS_SYM_CHAIN_AEAD;

		if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) {
			if (xform->next == NULL)
				res =  BCMFS_SYM_CHAIN_ONLY_AUTH;
			else if (xform->next->type ==
					RTE_CRYPTO_SYM_XFORM_CIPHER)
				res = BCMFS_SYM_CHAIN_AUTH_CIPHER;
		}
		if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) {
			if (xform->next == NULL)
				res =  BCMFS_SYM_CHAIN_ONLY_CIPHER;
			else if (xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH)
				res =  BCMFS_SYM_CHAIN_CIPHER_AUTH;
		}
	}

	return res;
}
/** Configure the session from a crypto xform chain */
Configure the session from a crypto xform chain
Configure the session from a crypto xform chain
static enum bcmfs_sym_chain_order
crypto_get_chain_order(const struct rte_crypto_sym_xform *xform)
{
	enum bcmfs_sym_chain_order res = BCMFS_SYM_CHAIN_NOT_SUPPORTED;
	if (xform != NULL) {
		if (xform->type == RTE_CRYPTO_SYM_XFORM_AEAD)
			res = BCMFS_SYM_CHAIN_AEAD;
		if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) {
			if (xform->next == NULL)
				res =  BCMFS_SYM_CHAIN_ONLY_AUTH;
			else if (xform->next->type ==
					RTE_CRYPTO_SYM_XFORM_CIPHER)
				res = BCMFS_SYM_CHAIN_AUTH_CIPHER;
		}
		if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) {
			if (xform->next == NULL)
				res =  BCMFS_SYM_CHAIN_ONLY_CIPHER;
			else if (xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH)
				res =  BCMFS_SYM_CHAIN_CIPHER_AUTH;
		}
	}
	return res;
}
static enum bcmfs_sym_chain_order crypto_get_chain_order ( const struct rte_crypto_sym_xform * xform ) { enum bcmfs_sym_chain_order res = BCMFS_SYM_CHAIN_NOT_SUPPORTED ; if ( xform != NULL ) { if ( xform -> type == RTE_CRYPTO_SYM_XFORM_AEAD ) res = BCMFS_SYM_CHAIN_AEAD ; if ( xform -> type == RTE_CRYPTO_SYM_XFORM_AUTH ) { if ( xform -> next == NULL ) res = BCMFS_SYM_CHAIN_ONLY_AUTH ; else if ( xform -> next -> type == RTE_CRYPTO_SYM_XFORM_CIPHER ) res = BCMFS_SYM_CHAIN_AUTH_CIPHER ; } if ( xform -> type == RTE_CRYPTO_SYM_XFORM_CIPHER ) { if ( xform -> next == NULL ) res = BCMFS_SYM_CHAIN_ONLY_CIPHER ; else if ( xform -> next -> type == RTE_CRYPTO_SYM_XFORM_AUTH ) res = BCMFS_SYM_CHAIN_CIPHER_AUTH ; } } return res ; }
Configure the session from a crypto xform chain
Configure the session from a crypto xform chain