xref: /dpdk/drivers/crypto/cnxk/cn10k_ipsec.h (revision 27595cd83053b2d39634a159d6709b3ce3cdf3b0)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4 
5 #ifndef __CN10K_IPSEC_H__
6 #define __CN10K_IPSEC_H__
7 
8 #include <rte_security.h>
9 #include <rte_security_driver.h>
10 
11 #include "roc_constants.h"
12 #include "roc_ie_ot.h"
13 
14 #include "cnxk_cryptodev.h"
15 #include "cnxk_cryptodev_ops.h"
16 #include "cnxk_ipsec.h"
17 
18 /* Forward declaration */
19 struct cn10k_sec_session;
20 
__rte_aligned(ROC_ALIGN)21 struct __rte_aligned(ROC_ALIGN) cn10k_ipsec_sa {
22 	union {
23 		/** Inbound SA */
24 		struct roc_ot_ipsec_inb_sa in_sa;
25 		/** Outbound SA */
26 		struct roc_ot_ipsec_outb_sa out_sa;
27 	};
28 };
29 
30 int cn10k_ipsec_session_create(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp,
31 			       struct rte_security_ipsec_xform *ipsec_xfrm,
32 			       struct rte_crypto_sym_xform *crypto_xfrm,
33 			       struct rte_security_session *sess);
34 int cn10k_sec_ipsec_session_destroy(struct cnxk_cpt_qp *qp, struct cn10k_sec_session *sess);
35 int cn10k_ipsec_stats_get(struct cnxk_cpt_qp *qp, struct cn10k_sec_session *sess,
36 			  struct rte_security_stats *stats);
37 int cn10k_ipsec_session_update(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp,
38 			       struct cn10k_sec_session *sess,
39 			       struct rte_security_session_conf *conf);
40 #endif /* __CN10K_IPSEC_H__ */
41