crypto/cnxk: add cn9k security session operations
[dpdk.git] / drivers / crypto / cnxk / cn9k_ipsec.h
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
11 struct cn9k_ipsec_sa {
12         union {
13                 /** Inbound SA */
14                 struct roc_ie_on_inb_sa in_sa;
15                 /** Outbound SA */
16                 struct roc_ie_on_outb_sa out_sa;
17         };
18         /** IPsec SA direction */
19         enum rte_security_ipsec_sa_direction dir;
20         /** Pre-populated CPT inst words */
21         struct cnxk_cpt_inst_tmpl inst;
22         /** Cipher IV offset in bytes */
23         uint16_t cipher_iv_off;
24         /** Cipher IV length in bytes */
25         uint8_t cipher_iv_len;
26         /** Response length calculation data */
27         struct cnxk_ipsec_outb_rlens rlens;
28         /** Outbound IP-ID */
29         uint16_t ip_id;
30         /** ESN */
31         union {
32                 uint64_t esn;
33                 struct {
34                         uint32_t seq_lo;
35                         uint32_t seq_hi;
36                 };
37         };
38 };
39
40 struct cn9k_sec_session {
41         struct cn9k_ipsec_sa sa;
42 } __rte_cache_aligned;
43
44 void cn9k_sec_ops_override(void);
45
46 #endif /* __CN9K_IPSEC_H__ */