]> git.droids-corp.org - dpdk.git/commitdiff
crypto/cnxk: add context reload for IV
authorTejasree Kondoj <ktejasree@marvell.com>
Fri, 17 Dec 2021 09:19:59 +0000 (14:49 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Fri, 21 Jan 2022 08:40:01 +0000 (09:40 +0100)
Adding context reload in datapath for IV in debug mode.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
drivers/crypto/cnxk/cn10k_cryptodev_ops.c
drivers/crypto/cnxk/cn10k_ipsec_la_ops.h

index 7617bdcd873faaf816bc7ca04f2572ba55d44a60..638268e44c428803219b3c2aeb9e9442e60151f3 100644 (file)
@@ -49,7 +49,8 @@ sess_put:
 }
 
 static __rte_always_inline int __rte_hot
-cpt_sec_inst_fill(struct rte_crypto_op *op, struct cn10k_sec_session *sess,
+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 rte_crypto_sym_op *sym_op = op->sym;
@@ -69,7 +70,7 @@ cpt_sec_inst_fill(struct rte_crypto_op *op, struct cn10k_sec_session *sess,
        sa = &sess->sa;
 
        if (sa->is_outbound)
-               ret = process_outb_sa(op, sa, inst);
+               ret = process_outb_sa(&qp->lf, op, sa, inst);
        else {
                infl_req->op_flags |= CPT_OP_FLAGS_IPSEC_DIR_INBOUND;
                ret = process_inb_sa(op, sa, inst);
@@ -122,7 +123,7 @@ cn10k_cpt_fill_inst(struct cnxk_cpt_qp *qp, struct rte_crypto_op *ops[],
                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(op, sec_sess, infl_req,
+                       ret = cpt_sec_inst_fill(qp, op, sec_sess, infl_req,
                                                &inst[0]);
                        if (unlikely(ret))
                                return 0;
index cab6a5047ca02d908c46dc5a798add3f669b9f98..f2d812238dae12fde78a7aa525cbcae47c78aa12 100644 (file)
@@ -48,8 +48,8 @@ ipsec_po_sa_aes_gcm_iv_set(struct cn10k_ipsec_sa *sess,
 }
 
 static __rte_always_inline int
-process_outb_sa(struct rte_crypto_op *cop, struct cn10k_ipsec_sa *sess,
-               struct cpt_inst_s *inst)
+process_outb_sa(struct roc_cpt_lf *lf, struct rte_crypto_op *cop,
+               struct cn10k_ipsec_sa *sess, struct cpt_inst_s *inst)
 {
        struct rte_crypto_sym_op *sym_op = cop->sym;
        struct rte_mbuf *m_src = sym_op->m_src;
@@ -61,6 +61,8 @@ process_outb_sa(struct rte_crypto_op *cop, struct cn10k_ipsec_sa *sess,
                return -ENOMEM;
        }
 
+       RTE_SET_USED(lf);
+
 #ifdef LA_IPSEC_DEBUG
        if (sess->out_sa.w2.s.iv_src == ROC_IE_OT_SA_IV_SRC_FROM_SA) {
                if (sess->out_sa.w2.s.enc_type == ROC_IE_OT_SA_ENC_AES_GCM)
@@ -68,6 +70,10 @@ process_outb_sa(struct rte_crypto_op *cop, struct cn10k_ipsec_sa *sess,
                else
                        ipsec_po_sa_iv_set(sess, cop);
        }
+
+       /* Trigger CTX reload to fetch new data from DRAM */
+       roc_cpt_lf_ctx_reload(lf, &sess->out_sa);
+       rte_delay_ms(1);
 #endif
 
        if (m_src->ol_flags & RTE_MBUF_F_TX_IP_CKSUM)