net/i40e/base: update FW API version to 1.15
[dpdk.git] / drivers / net / cnxk / cn9k_ethdev.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4 #ifndef __CN9K_ETHDEV_H__
5 #define __CN9K_ETHDEV_H__
6
7 #include <cnxk_ethdev.h>
8 #include <cnxk_security.h>
9 #include <cnxk_security_ar.h>
10
11 struct cn9k_eth_txq {
12         uint64_t cmd[8];
13         int64_t fc_cache_pkts;
14         uint64_t *fc_mem;
15         void *lmt_addr;
16         rte_iova_t io_addr;
17         uint64_t lso_tun_fmt;
18         uint16_t sqes_per_sqb_log2;
19         int16_t nb_sqb_bufs_adj;
20         rte_iova_t cpt_io_addr;
21         uint64_t sa_base;
22         uint64_t *cpt_fc;
23         uint16_t cpt_desc;
24 } __plt_cache_aligned;
25
26 struct cn9k_eth_rxq {
27         uint64_t mbuf_initializer;
28         uint64_t data_off;
29         uintptr_t desc;
30         void *lookup_mem;
31         uintptr_t cq_door;
32         uint64_t wdata;
33         int64_t *cq_status;
34         uint32_t head;
35         uint32_t qmask;
36         uint32_t available;
37         uint16_t rq;
38         struct cnxk_timesync_info *tstamp;
39 } __plt_cache_aligned;
40
41 /* Private data in sw rsvd area of struct roc_onf_ipsec_inb_sa */
42 struct cn9k_inb_priv_data {
43         void *userdata;
44         uint32_t replay_win_sz;
45         struct cnxk_on_ipsec_ar ar;
46         struct cnxk_eth_sec_sess *eth_sec;
47 };
48
49 /* Private data in sw rsvd area of struct roc_onf_ipsec_outb_sa */
50 struct cn9k_outb_priv_data {
51         union {
52                 uint64_t esn;
53                 struct {
54                         uint32_t seq;
55                         uint32_t esn_hi;
56                 };
57         };
58
59         /* Rlen computation data */
60         struct cnxk_ipsec_outb_rlens rlens;
61
62         /* IP identifier */
63         uint16_t ip_id;
64
65         /* SA index */
66         uint32_t sa_idx;
67
68         /* Flags */
69         uint16_t copy_salt : 1;
70
71         /* Salt */
72         uint32_t nonce;
73
74         /* User data pointer */
75         void *userdata;
76
77         /* Back pointer to eth sec session */
78         struct cnxk_eth_sec_sess *eth_sec;
79 };
80
81 struct cn9k_sec_sess_priv {
82         union {
83                 struct {
84                         uint32_t sa_idx;
85                         uint8_t inb_sa : 1;
86                         uint8_t rsvd1 : 2;
87                         uint8_t roundup_byte : 5;
88                         uint8_t roundup_len;
89                         uint16_t partial_len;
90                 };
91
92                 uint64_t u64;
93         };
94 } __rte_packed;
95
96 /* Rx and Tx routines */
97 void cn9k_eth_set_rx_function(struct rte_eth_dev *eth_dev);
98 void cn9k_eth_set_tx_function(struct rte_eth_dev *eth_dev);
99
100 /* Security context setup */
101 void cn9k_eth_sec_ops_override(void);
102
103 #endif /* __CN9K_ETHDEV_H__ */