src/dpdk/drivers/crypto/mvsam/rte_mrvl_pmd.c
static uint16_t
mrvl_crypto_pmd_dequeue_burst(void *queue_pair,
		struct rte_crypto_op **ops,
		uint16_t nb_ops)
{
	int ret;
	struct mrvl_crypto_qp *qp = queue_pair;
	struct sam_cio *cio = qp->cio;
	struct sam_cio_op_result results[nb_ops];
	uint16_t i;

	ret = sam_cio_deq(cio, results, &nb_ops);
	if (ret < 0) {
		/* Count all dequeued as error. */
		qp->stats.dequeue_err_count += nb_ops;

		/* But act as they were dequeued anyway*/
		qp->stats.dequeued_count += nb_ops;

		return 0;
	}

	/* Unpack and check results. */
	for (i = 0; i < nb_ops; ++i) {
		ops[i] = results[i].cookie;

		switch (results[i].status) {
		case SAM_CIO_OK:
			ops[i]->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
			break;
		case SAM_CIO_ERR_ICV:
			MRVL_LOG(DEBUG, "CIO returned SAM_CIO_ERR_ICV.");
			ops[i]->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
			break;
		default:
			MRVL_LOG(DEBUG,
				"CIO returned Error: %d.", results[i].status);
			ops[i]->status = RTE_CRYPTO_OP_STATUS_ERROR;
			break;
		}
	}

	qp->stats.dequeued_count += nb_ops;
	return nb_ops;
}
/**
 * Dequeue burst.
 *
 * @param queue_pair Pointer to queue pair.
 * @param ops Pointer to ops requests array.
 * @param nb_ops Number of elements in ops requests array.
 * @returns Number of elements dequeued.
 */
Dequeue burst.
@param queue_pair Pointer to queue pair.
@param ops Pointer to ops requests array.
@param nb_ops Number of elements in ops requests array.
@returns Number of elements dequeued.
Dequeue burst . @param queue_pair Pointer to queue pair . @param ops Pointer to ops requests array . @param nb_ops Number of elements in ops requests array . @returns Number of elements dequeued .
static uint16_t
mrvl_crypto_pmd_dequeue_burst(void *queue_pair,
		struct rte_crypto_op **ops,
		uint16_t nb_ops)
{
	int ret;
	struct mrvl_crypto_qp *qp = queue_pair;
	struct sam_cio *cio = qp->cio;
	struct sam_cio_op_result results[nb_ops];
	uint16_t i;
	ret = sam_cio_deq(cio, results, &nb_ops);
	if (ret < 0) {
		qp->stats.dequeue_err_count += nb_ops;
		qp->stats.dequeued_count += nb_ops;
		return 0;
	}
	for (i = 0; i < nb_ops; ++i) {
		ops[i] = results[i].cookie;
		switch (results[i].status) {
		case SAM_CIO_OK:
			ops[i]->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
			break;
		case SAM_CIO_ERR_ICV:
			MRVL_LOG(DEBUG, "CIO returned SAM_CIO_ERR_ICV.");
			ops[i]->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
			break;
		default:
			MRVL_LOG(DEBUG,
				"CIO returned Error: %d.", results[i].status);
			ops[i]->status = RTE_CRYPTO_OP_STATUS_ERROR;
			break;
		}
	}
	qp->stats.dequeued_count += nb_ops;
	return nb_ops;
}
static uint16_t mrvl_crypto_pmd_dequeue_burst ( void * queue_pair , struct rte_crypto_op * * ops , uint16_t nb_ops ) { int ret ; struct mrvl_crypto_qp * qp = queue_pair ; struct sam_cio * cio = qp -> cio ; struct sam_cio_op_result results [ nb_ops ] ; uint16_t i ; ret = sam_cio_deq ( cio , results , & nb_ops ) ; if ( ret < 0 ) { qp -> stats . dequeue_err_count += nb_ops ; qp -> stats . dequeued_count += nb_ops ; return 0 ; } for ( i = 0 ; i < nb_ops ; ++ i ) { ops [ i ] = results [ i ] . cookie ; switch ( results [ i ] . status ) { case SAM_CIO_OK : ops [ i ] -> status = RTE_CRYPTO_OP_STATUS_SUCCESS ; break ; case SAM_CIO_ERR_ICV : MRVL_LOG ( DEBUG , " " ) ; ops [ i ] -> status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED ; break ; default : MRVL_LOG ( DEBUG , " " , results [ i ] . status ) ; ops [ i ] -> status = RTE_CRYPTO_OP_STATUS_ERROR ; break ; } } qp -> stats . dequeued_count += nb_ops ; return nb_ops ; }
Dequeue burst.
Dequeue burst .
/* Count all dequeued as error. */ /* But act as they were dequeued anyway*/ /* Unpack and check results. */