static __rte_always_inline int __rte_hot
cpt_sec_inst_fill(struct cnxk_cpt_qp *qp, struct rte_crypto_op *op,
- struct cn10k_sec_session *sess,
- struct cpt_inflight_req *infl_req, struct cpt_inst_s *inst)
+ struct cn10k_sec_session *sess, struct cpt_inst_s *inst)
{
struct rte_crypto_sym_op *sym_op = op->sym;
struct cn10k_ipsec_sa *sa;
if (sa->is_outbound)
ret = process_outb_sa(&qp->lf, op, sa, inst);
- else {
- infl_req->op_flags |= CPT_OP_FLAGS_IPSEC_DIR_INBOUND;
+ else
ret = process_inb_sa(op, sa, inst);
- }
return ret;
}
if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) {
sec_sess = get_sec_session_private_data(
sym_op->sec_session);
- ret = cpt_sec_inst_fill(qp, op, sec_sess, infl_req,
- &inst[0]);
+ ret = cpt_sec_inst_fill(qp, op, sec_sess, &inst[0]);
if (unlikely(ret))
return 0;
w7 = sec_sess->sa.inst.w7;
if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
asym_op = op->asym;
- ae_sess = get_asym_session_private_data(
- asym_op->session, cn10k_cryptodev_driver_id);
+ ae_sess = (struct cnxk_ae_sess *)
+ asym_op->session->sess_private_data;
ret = cnxk_ae_enqueue(qp, op, infl_req, &inst[0],
ae_sess);
if (unlikely(ret))
cn10k_cpt_sec_post_process(struct rte_crypto_op *cop,
struct cpt_cn10k_res_s *res)
{
- struct rte_mbuf *m = cop->sym->m_src;
+ struct rte_mbuf *mbuf = cop->sym->m_src;
const uint16_t m_len = res->rlen;
- m->data_len = m_len;
- m->pkt_len = m_len;
-}
-
-static inline void
-cn10k_cpt_sec_ucc_process(struct rte_crypto_op *cop,
- struct cpt_inflight_req *infl_req,
- const uint8_t uc_compcode)
-{
- struct cn10k_sec_session *sess;
- struct cn10k_ipsec_sa *sa;
- struct rte_mbuf *mbuf;
-
- if (uc_compcode == ROC_IE_OT_UCC_SUCCESS_SA_SOFTEXP_FIRST)
- cop->aux_flags = RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY;
-
- if (!(infl_req->op_flags & CPT_OP_FLAGS_IPSEC_DIR_INBOUND))
- return;
-
- sess = get_sec_session_private_data(cop->sym->sec_session);
- sa = &sess->sa;
+ mbuf->data_len = m_len;
+ mbuf->pkt_len = m_len;
- mbuf = cop->sym->m_src;
-
- switch (uc_compcode) {
+ switch (res->uc_compcode) {
case ROC_IE_OT_UCC_SUCCESS:
- if (sa->ip_csum_enable)
- mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
break;
case ROC_IE_OT_UCC_SUCCESS_PKT_IP_BADCSUM:
mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_BAD;
break;
case ROC_IE_OT_UCC_SUCCESS_PKT_L4_GOODCSUM:
- mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
- if (sa->ip_csum_enable)
- mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
+ mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD |
+ RTE_MBUF_F_RX_IP_CKSUM_GOOD;
break;
case ROC_IE_OT_UCC_SUCCESS_PKT_L4_BADCSUM:
- mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD;
- if (sa->ip_csum_enable)
- mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
+ mbuf->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD |
+ RTE_MBUF_F_RX_IP_CKSUM_GOOD;
+ break;
+ case ROC_IE_OT_UCC_SUCCESS_PKT_IP_GOODCSUM:
+ mbuf->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_GOOD;
+ break;
+ case ROC_IE_OT_UCC_SUCCESS_SA_SOFTEXP_FIRST:
+ cop->aux_flags = RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY;
break;
default:
+ plt_dp_err("Success with unknown microcode completion code");
break;
}
}
cop->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) {
if (likely(compcode == CPT_COMP_WARN)) {
/* Success with additional info */
- cn10k_cpt_sec_ucc_process(cop, infl_req, uc_compcode);
cn10k_cpt_sec_post_process(cop, res);
} else {
cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
uintptr_t *mdata = infl_req->mdata;
struct cnxk_ae_sess *sess;
- sess = get_asym_session_private_data(
- op->session, cn10k_cryptodev_driver_id);
+ sess = (struct cnxk_ae_sess *)
+ op->session->sess_private_data;
cnxk_ae_post_process(cop, sess, (uint8_t *)mdata[0]);
}
if (unlikely(rte_get_timer_cycles() >
pend_q->time_out)) {
plt_err("Request timed out");
+ cnxk_cpt_dump_on_err(qp);
pend_q->time_out = rte_get_timer_cycles() +
DEFAULT_COMMAND_TIMEOUT *
rte_get_timer_hz();