spu_req_init(struct bcmfs_sym_request *sr, rte_iova_t iova __rte_unused)
{
memset(sr, 0, sizeof(*sr));
+ sr->fptr = iova + offsetof(struct bcmfs_sym_request, fmd);
+ sr->optr = iova + offsetof(struct bcmfs_sym_request, omd);
+ sr->dptr = iova + offsetof(struct bcmfs_sym_request, digest);
+ sr->rptr = iova + offsetof(struct bcmfs_sym_request, resp);
}
static void
uint16_t nb_ops)
{
int i, j;
+ int retval;
uint16_t enq = 0;
struct bcmfs_sym_request *sreq;
struct bcmfs_sym_session *sess;
/* save context */
qp->infl_msgs[i] = &sreq->msgs;
qp->infl_msgs[i]->ctx = (void *)sreq;
+
+ /* pre process the request crypto h/w acceleration */
+ retval = bcmfs_process_sym_crypto_op(ops[i], sess, sreq);
+ if (unlikely(retval < 0))
+ goto enqueue_err;
}
/* Send burst request to hw QP */
enq = bcmfs_enqueue_op_burst(qp, (void **)qp->infl_msgs, i);
return enq;
}
+static void bcmfs_sym_set_request_status(struct rte_crypto_op *op,
+ struct bcmfs_sym_request *out)
+{
+ if (*out->resp == BCMFS_SYM_RESPONSE_SUCCESS)
+ op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
+ else if (*out->resp == BCMFS_SYM_RESPONSE_HASH_TAG_ERROR)
+ op->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
+ else
+ op->status = RTE_CRYPTO_OP_STATUS_ERROR;
+}
+
static uint16_t
bcmfs_sym_pmd_dequeue_op_burst(void *queue_pair,
struct rte_crypto_op **ops,
for (i = 0; i < deq; i++) {
sreq = (struct bcmfs_sym_request *)qp->infl_msgs[i]->ctx;
+ /* set the status based on the response from the crypto h/w */
+ bcmfs_sym_set_request_status(sreq->op, sreq);
+
ops[pkts++] = sreq->op;
rte_mempool_put(qp->sr_mp, sreq);