X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_ipsec%2Fcrypto.h;h=f8fbf8d4f3282b291109da30d507d2984bab8b98;hb=82962b6abbdce0ee3dfc2b3ae4500150ed90428d;hp=4f551e39ce4765952ef82864eb26215d42ad0f4f;hpb=3975d5cb1db2732dd06d03f85bf593a9c5a3b3b0;p=dpdk.git diff --git a/lib/librte_ipsec/crypto.h b/lib/librte_ipsec/crypto.h index 4f551e39ce..f8fbf8d4f3 100644 --- a/lib/librte_ipsec/crypto.h +++ b/lib/librte_ipsec/crypto.h @@ -47,7 +47,7 @@ struct aead_gcm_aad { } __attribute__((packed)); struct gcm_esph_iv { - struct esp_hdr esph; + struct rte_esp_hdr esph; uint64_t iv; } __attribute__((packed)); @@ -95,7 +95,7 @@ gen_iv(uint64_t iv[IPSEC_MAX_IV_QWORD], rte_be64_t sqn) /* * Helper routine to copy IV - * Righ now we support only algorithms with IV length equals 0/8/16 bytes. + * Right now we support only algorithms with IV length equals 0/8/16 bytes. */ static inline void copy_iv(uint64_t dst[IPSEC_MAX_IV_QWORD], @@ -162,4 +162,21 @@ remove_sqh(void *picv, uint32_t icv_len) icv[i] = icv[i + 1]; } +/* + * setup crypto ops for LOOKASIDE_NONE (pure crypto) type of devices. + */ +static inline void +lksd_none_cop_prepare(struct rte_crypto_op *cop, + struct rte_cryptodev_sym_session *cs, struct rte_mbuf *mb) +{ + struct rte_crypto_sym_op *sop; + + sop = cop->sym; + cop->type = RTE_CRYPTO_OP_TYPE_SYMMETRIC; + cop->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED; + cop->sess_type = RTE_CRYPTO_OP_WITH_SESSION; + sop->m_src = mb; + __rte_crypto_sym_op_attach_sym_session(sop, cs); +} + #endif /* _CRYPTO_H_ */