1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(C) 2021 Marvell. 3 */ 4 5 #ifndef __CN9K_IPSEC_H__ 6 #define __CN9K_IPSEC_H__ 7 8 #include "cnxk_ipsec.h" 9 #include "cnxk_security.h" 10 #include "cnxk_security_ar.h" 11 12 struct cn9k_ipsec_sa { 13 union { 14 /** Inbound SA */ 15 struct roc_ie_on_inb_sa in_sa; 16 /** Outbound SA */ 17 struct roc_ie_on_outb_sa out_sa; 18 }; 19 /** IPsec SA direction */ 20 enum rte_security_ipsec_sa_direction dir; 21 /** Pre-populated CPT inst words */ 22 struct cnxk_cpt_inst_tmpl inst; 23 /** Cipher IV offset in bytes */ 24 uint16_t cipher_iv_off; 25 /** Cipher IV length in bytes */ 26 uint8_t cipher_iv_len; 27 /** Outbound custom header length */ 28 uint8_t custom_hdr_len; 29 /** Response length calculation data */ 30 struct cnxk_ipsec_outb_rlens rlens; 31 /** Outbound IP-ID */ 32 uint16_t ip_id; 33 /** ESN */ 34 union { 35 uint64_t esn; 36 struct { 37 uint32_t seq_lo; 38 uint32_t seq_hi; 39 }; 40 }; 41 /** Anti replay */ 42 struct cnxk_on_ipsec_ar ar; 43 /** Anti replay window size */ 44 uint32_t replay_win_sz; 45 }; 46 47 struct cn9k_sec_session { 48 struct cn9k_ipsec_sa sa; 49 } __rte_cache_aligned; 50 51 void cn9k_sec_ops_override(void); 52 53 #endif /* __CN9K_IPSEC_H__ */ 54