X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fcrypto%2Focteontx2%2Fotx2_ipsec_po_ops.h;h=58b199f4f3af65c609b2e9206727aea52874c056;hb=26590b5200bb1d6bdfa931f8615339d049d13881;hp=dd29c413d37cae46b88b38b96aee9733df416658;hpb=fab634eb87ca3883562c95a20f9a69eba645456b;p=dpdk.git diff --git a/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h b/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h index dd29c413d3..58b199f4f3 100644 --- a/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h +++ b/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h @@ -25,7 +25,8 @@ otx2_ipsec_po_out_rlen_get(struct otx2_sec_session_ipsec_lp *sess, } static __rte_always_inline struct cpt_request_info * -alloc_request_struct(char *maddr, void *cop, int mdata_len) +alloc_request_struct(char *maddr, void *cop, int mdata_len, + enum otx2_ipsec_po_mode_type mode_type) { struct cpt_request_info *req; struct cpt_meta_info *meta; @@ -47,6 +48,7 @@ alloc_request_struct(char *maddr, void *cop, int mdata_len) op[1] = (uintptr_t)cop; op[2] = (uintptr_t)req; op[3] = mdata_len; + op[4] = mode_type; return req; } @@ -86,7 +88,8 @@ process_outb_sa(struct rte_crypto_op *cop, } mdata += extend_tail; /* mdata follows encrypted data */ - req = alloc_request_struct(mdata, (void *)cop, mdata_len); + req = alloc_request_struct(mdata, (void *)cop, mdata_len, + sess->mode_type); data = rte_pktmbuf_prepend(m_src, extend_head); if (unlikely(data == NULL)) { @@ -108,7 +111,7 @@ process_outb_sa(struct rte_crypto_op *cop, memcpy(&hdr->iv[0], &sa->iv.gcm.nonce, 4); memcpy(&hdr->iv[4], rte_crypto_op_ctod_offset(cop, uint8_t *, sess->iv_offset), sess->iv_length); - } else if (ctl_wrd->auth_type == OTX2_IPSEC_FP_SA_ENC_AES_CBC) { + } else if (ctl_wrd->auth_type == OTX2_IPSEC_PO_SA_AUTH_SHA1) { memcpy(&hdr->iv[0], rte_crypto_op_ctod_offset(cop, uint8_t *, sess->iv_offset), sess->iv_length); } @@ -120,7 +123,8 @@ process_outb_sa(struct rte_crypto_op *cop, req->ist.ei0 = word0.u64; req->ist.ei1 = rte_pktmbuf_iova(m_src); req->ist.ei2 = req->ist.ei1; - req->ist.ei3 = sess->ucmd_w3; + + sa->esn_hi = sess->seq_hi; hdr->seq = rte_cpu_to_be_32(sess->seq_lo); hdr->ip_id = rte_cpu_to_be_32(sess->ip_id); @@ -157,7 +161,8 @@ process_inb_sa(struct rte_crypto_op *cop, goto exit; } - req = alloc_request_struct(mdata, (void *)cop, mdata_len); + req = alloc_request_struct(mdata, (void *)cop, mdata_len, + sess->mode_type); /* Prepare CPT instruction */ word0.u64 = sess->ucmd_w0; @@ -166,7 +171,6 @@ process_inb_sa(struct rte_crypto_op *cop, req->ist.ei0 = word0.u64; req->ist.ei1 = rte_pktmbuf_iova(m_src); req->ist.ei2 = req->ist.ei1; - req->ist.ei3 = sess->ucmd_w3; exit: *prep_req = req;