1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
5 #ifndef __ROC_IE_ON_H__
6 #define __ROC_IE_ON_H__
8 /* CN9K IPSEC LA opcodes */
9 #define ROC_IE_ONL_MAJOR_OP_WRITE_IPSEC_OUTBOUND 0x20
10 #define ROC_IE_ONL_MAJOR_OP_WRITE_IPSEC_INBOUND 0x21
11 #define ROC_IE_ONL_MAJOR_OP_PROCESS_OUTBOUND_IPSEC 0x23
12 #define ROC_IE_ONL_MAJOR_OP_PROCESS_INBOUND_IPSEC 0x24
14 /* CN9K IPSEC FP opcodes */
15 #define ROC_IE_ONF_MAJOR_OP_PROCESS_OUTBOUND_IPSEC 0x25UL
16 #define ROC_IE_ONF_MAJOR_OP_PROCESS_INBOUND_IPSEC 0x26UL
18 /* Ucode completion codes */
19 #define ROC_IE_ONF_UCC_SUCCESS 0
22 ROC_IE_ON_SA_ENC_NULL = 0,
23 ROC_IE_ON_SA_ENC_DES_CBC = 1,
24 ROC_IE_ON_SA_ENC_3DES_CBC = 2,
25 ROC_IE_ON_SA_ENC_AES_CBC = 3,
26 ROC_IE_ON_SA_ENC_AES_CTR = 4,
27 ROC_IE_ON_SA_ENC_AES_GCM = 5,
28 ROC_IE_ON_SA_ENC_AES_CCM = 6,
32 ROC_IE_ON_SA_AUTH_NULL = 0,
33 ROC_IE_ON_SA_AUTH_MD5 = 1,
34 ROC_IE_ON_SA_AUTH_SHA1 = 2,
35 ROC_IE_ON_SA_AUTH_SHA2_224 = 3,
36 ROC_IE_ON_SA_AUTH_SHA2_256 = 4,
37 ROC_IE_ON_SA_AUTH_SHA2_384 = 5,
38 ROC_IE_ON_SA_AUTH_SHA2_512 = 6,
39 ROC_IE_ON_SA_AUTH_AES_GMAC = 7,
40 ROC_IE_ON_SA_AUTH_AES_XCBC_128 = 8,
44 ROC_IE_ON_SA_FRAG_POST = 0,
45 ROC_IE_ON_SA_FRAG_PRE = 1,
49 ROC_IE_ON_SA_ENCAP_NONE = 0,
50 ROC_IE_ON_SA_ENCAP_UDP = 1,
53 struct roc_ie_onf_sa_ctl {
55 uint64_t exp_proto_inter_frag : 8;
56 uint64_t rsvd_41_40 : 2;
57 /* Disable SPI, SEQ data in RPTR for Inbound inline */
58 uint64_t spi_seq_dis : 1;
60 uint64_t rsvd_44_45 : 2;
61 uint64_t encap_type : 2;
62 uint64_t enc_type : 3;
64 uint64_t auth_type : 4;
66 uint64_t direction : 1;
67 uint64_t outer_ip_ver : 1;
68 uint64_t inner_ip_ver : 1;
69 uint64_t ipsec_mode : 1;
70 uint64_t ipsec_proto : 1;
71 uint64_t aes_key_len : 2;
74 struct roc_onf_ipsec_outb_sa {
76 struct roc_ie_onf_sa_ctl ctl;
88 uint8_t cipher_key[32];
94 struct roc_onf_ipsec_inb_sa {
96 struct roc_ie_onf_sa_ctl ctl;
99 uint8_t nonce[4]; /* Only for AES-GCM */
107 uint8_t cipher_key[32];
110 uint8_t hmac_key[48];
113 #define ROC_ONF_IPSEC_INB_MAX_L2_SZ 32UL
114 #define ROC_ONF_IPSEC_OUTB_MAX_L2_SZ 30UL
115 #define ROC_ONF_IPSEC_OUTB_MAX_L2_INFO_SZ (ROC_ONF_IPSEC_OUTB_MAX_L2_SZ + 2)
117 #define ROC_ONF_IPSEC_INB_RES_OFF 80
118 #define ROC_ONF_IPSEC_INB_SPI_SEQ_SZ 16
120 struct roc_onf_ipsec_outb_hdr {
126 #endif /* __ROC_IE_ON_H__ */