src/dpdk/drivers/crypto/zuc/rte_zuc_pmd.c
static int
process_ops(struct rte_crypto_op **ops, enum zuc_operation op_type,
		struct zuc_session **sessions,
		struct zuc_qp *qp, uint8_t num_ops,
		uint16_t *accumulated_enqueued_ops)
{
	unsigned i;
	unsigned enqueued_ops, processed_ops;

	switch (op_type) {
	case ZUC_OP_ONLY_CIPHER:
		processed_ops = process_zuc_cipher_op(qp, ops,
				sessions, num_ops);
		break;
	case ZUC_OP_ONLY_AUTH:
		processed_ops = process_zuc_hash_op(qp, ops, sessions,
				num_ops);
		break;
	case ZUC_OP_CIPHER_AUTH:
		processed_ops = process_zuc_cipher_op(qp, ops, sessions,
				num_ops);
		process_zuc_hash_op(qp, ops, sessions, processed_ops);
		break;
	case ZUC_OP_AUTH_CIPHER:
		processed_ops = process_zuc_hash_op(qp, ops, sessions,
				num_ops);
		process_zuc_cipher_op(qp, ops, sessions, processed_ops);
		break;
	default:
		/* Operation not supported. */
		processed_ops = 0;
	}

	for (i = 0; i < num_ops; i++) {
		/*
		 * If there was no error/authentication failure,
		 * change status to successful.
		 */
		if (ops[i]->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)
			ops[i]->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
		/* Free session if a session-less crypto op. */
		if (ops[i]->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
			memset(sessions[i], 0, sizeof(struct zuc_session));
			memset(ops[i]->sym->session, 0,
			rte_cryptodev_sym_get_existing_header_session_size(
					ops[i]->sym->session));
			rte_mempool_put(qp->sess_mp_priv, sessions[i]);
			rte_mempool_put(qp->sess_mp, ops[i]->sym->session);
			ops[i]->sym->session = NULL;
		}
	}

	enqueued_ops = rte_ring_enqueue_burst(qp->processed_ops,
			(void **)ops, processed_ops, NULL);
	qp->qp_stats.enqueued_count += enqueued_ops;
	*accumulated_enqueued_ops += enqueued_ops;

	return enqueued_ops;
}
/** Process a batch of crypto ops which shares the same operation type. */
Process a batch of crypto ops which shares the same operation type.
Process a batch of crypto ops which shares the same operation type .
static int
process_ops(struct rte_crypto_op **ops, enum zuc_operation op_type,
		struct zuc_session **sessions,
		struct zuc_qp *qp, uint8_t num_ops,
		uint16_t *accumulated_enqueued_ops)
{
	unsigned i;
	unsigned enqueued_ops, processed_ops;
	switch (op_type) {
	case ZUC_OP_ONLY_CIPHER:
		processed_ops = process_zuc_cipher_op(qp, ops,
				sessions, num_ops);
		break;
	case ZUC_OP_ONLY_AUTH:
		processed_ops = process_zuc_hash_op(qp, ops, sessions,
				num_ops);
		break;
	case ZUC_OP_CIPHER_AUTH:
		processed_ops = process_zuc_cipher_op(qp, ops, sessions,
				num_ops);
		process_zuc_hash_op(qp, ops, sessions, processed_ops);
		break;
	case ZUC_OP_AUTH_CIPHER:
		processed_ops = process_zuc_hash_op(qp, ops, sessions,
				num_ops);
		process_zuc_cipher_op(qp, ops, sessions, processed_ops);
		break;
	default:
		processed_ops = 0;
	}
	for (i = 0; i < num_ops; i++) {
		if (ops[i]->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)
			ops[i]->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
		if (ops[i]->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
			memset(sessions[i], 0, sizeof(struct zuc_session));
			memset(ops[i]->sym->session, 0,
			rte_cryptodev_sym_get_existing_header_session_size(
					ops[i]->sym->session));
			rte_mempool_put(qp->sess_mp_priv, sessions[i]);
			rte_mempool_put(qp->sess_mp, ops[i]->sym->session);
			ops[i]->sym->session = NULL;
		}
	}
	enqueued_ops = rte_ring_enqueue_burst(qp->processed_ops,
			(void **)ops, processed_ops, NULL);
	qp->qp_stats.enqueued_count += enqueued_ops;
	*accumulated_enqueued_ops += enqueued_ops;
	return enqueued_ops;
}
static int process_ops ( struct rte_crypto_op * * ops , enum zuc_operation op_type , struct zuc_session * * sessions , struct zuc_qp * qp , uint8_t num_ops , uint16_t * accumulated_enqueued_ops ) { unsigned i ; unsigned enqueued_ops , processed_ops ; switch ( op_type ) { case ZUC_OP_ONLY_CIPHER : processed_ops = process_zuc_cipher_op ( qp , ops , sessions , num_ops ) ; break ; case ZUC_OP_ONLY_AUTH : processed_ops = process_zuc_hash_op ( qp , ops , sessions , num_ops ) ; break ; case ZUC_OP_CIPHER_AUTH : processed_ops = process_zuc_cipher_op ( qp , ops , sessions , num_ops ) ; process_zuc_hash_op ( qp , ops , sessions , processed_ops ) ; break ; case ZUC_OP_AUTH_CIPHER : processed_ops = process_zuc_hash_op ( qp , ops , sessions , num_ops ) ; process_zuc_cipher_op ( qp , ops , sessions , processed_ops ) ; break ; default : processed_ops = 0 ; } for ( i = 0 ; i < num_ops ; i ++ ) { if ( ops [ i ] -> status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED ) ops [ i ] -> status = RTE_CRYPTO_OP_STATUS_SUCCESS ; if ( ops [ i ] -> sess_type == RTE_CRYPTO_OP_SESSIONLESS ) { memset ( sessions [ i ] , 0 , sizeof ( struct zuc_session ) ) ; memset ( ops [ i ] -> sym -> session , 0 , rte_cryptodev_sym_get_existing_header_session_size ( ops [ i ] -> sym -> session ) ) ; rte_mempool_put ( qp -> sess_mp_priv , sessions [ i ] ) ; rte_mempool_put ( qp -> sess_mp , ops [ i ] -> sym -> session ) ; ops [ i ] -> sym -> session = NULL ; } } enqueued_ops = rte_ring_enqueue_burst ( qp -> processed_ops , ( void * * ) ops , processed_ops , NULL ) ; qp -> qp_stats . enqueued_count += enqueued_ops ; * accumulated_enqueued_ops += enqueued_ops ; return enqueued_ops ; }
Process a batch of crypto ops which shares the same operation type.
Process a batch of crypto ops which shares the same operation type .
/* Operation not supported. */ /*
		 * If there was no error/authentication failure,
		 * change status to successful.
		 */ /* Free session if a session-less crypto op. */