crypto/octeontx2: add lookaside SA context definitions
[dpdk.git] / drivers / crypto / octeontx2 / otx2_cryptodev_sec.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (C) 2020 Marvell International Ltd.
3  */
4
5 #ifndef __OTX2_CRYPTODEV_SEC_H__
6 #define __OTX2_CRYPTODEV_SEC_H__
7
8 #include "otx2_ipsec_po.h"
9
10 struct otx2_sec_session_ipsec_lp {
11         RTE_STD_C11
12         union {
13                 /* Inbound SA */
14                 struct otx2_ipsec_po_in_sa in_sa;
15                 /* Outbound SA */
16                 struct otx2_ipsec_po_out_sa out_sa;
17         };
18
19         uint64_t ucmd_w3;
20         union {
21                 uint64_t ucmd_w0;
22                 struct {
23                         uint16_t ucmd_dlen;
24                         uint16_t ucmd_param2;
25                         uint16_t ucmd_param1;
26                         uint16_t ucmd_opcode;
27                 };
28         };
29
30         uint8_t partial_len;
31         uint8_t roundup_len;
32         uint8_t roundup_byte;
33         uint16_t ip_id;
34         union {
35                 uint64_t esn;
36                 struct {
37                         uint32_t seq_lo;
38                         uint32_t seq_hi;
39                 };
40         };
41
42         /** Context length in 8-byte words */
43         size_t ctx_len;
44         /** Auth IV offset in bytes */
45         uint16_t auth_iv_offset;
46         /** IV offset in bytes */
47         uint16_t iv_offset;
48         /** AAD length */
49         uint16_t aad_length;
50         /** MAC len in bytes */
51         uint8_t mac_len;
52         /** IV length in bytes */
53         uint8_t iv_length;
54         /** Auth IV length in bytes */
55         uint8_t auth_iv_length;
56 };
57
58 #endif /* __OTX2_CRYPTODEV_SEC_H__ */