1
2
3
4
5
6#ifndef _ULP_PORT_DB_H_
7#define _ULP_PORT_DB_H_
8
9#include "bnxt_ulp.h"
10
11#define BNXT_PORT_DB_MAX_INTF_LIST 256
12#define BNXT_PORT_DB_MAX_FUNC 2048
13#define BNXT_ULP_FREE_PARIF_BASE 11
14
15enum bnxt_ulp_svif_type {
16 BNXT_ULP_DRV_FUNC_SVIF = 0,
17 BNXT_ULP_VF_FUNC_SVIF,
18 BNXT_ULP_PHY_PORT_SVIF
19};
20
21enum bnxt_ulp_spif_type {
22 BNXT_ULP_DRV_FUNC_SPIF = 0,
23 BNXT_ULP_VF_FUNC_SPIF,
24 BNXT_ULP_PHY_PORT_SPIF
25};
26
27enum bnxt_ulp_parif_type {
28 BNXT_ULP_DRV_FUNC_PARIF = 0,
29 BNXT_ULP_VF_FUNC_PARIF,
30 BNXT_ULP_PHY_PORT_PARIF
31};
32
33enum bnxt_ulp_vnic_type {
34 BNXT_ULP_DRV_FUNC_VNIC = 0,
35 BNXT_ULP_VF_FUNC_VNIC
36};
37
38enum bnxt_ulp_fid_type {
39 BNXT_ULP_DRV_FUNC_FID,
40 BNXT_ULP_VF_FUNC_FID
41};
42
43struct ulp_func_if_info {
44 uint16_t func_valid;
45 uint16_t func_svif;
46 uint16_t func_spif;
47 uint16_t func_parif;
48 uint16_t func_vnic;
49 uint16_t phy_port_id;
50 uint16_t ifindex;
51};
52
53
54struct ulp_interface_info {
55 enum bnxt_ulp_intf_type type;
56 uint16_t drv_func_id;
57 uint16_t vf_func_id;
58};
59
60struct ulp_phy_port_info {
61 uint16_t port_valid;
62 uint16_t port_svif;
63 uint16_t port_spif;
64 uint16_t port_parif;
65 uint16_t port_vport;
66};
67
68
69struct bnxt_ulp_port_db {
70 struct ulp_interface_info *ulp_intf_list;
71 uint32_t ulp_intf_list_size;
72
73
74 uint16_t dev_port_list[RTE_MAX_ETHPORTS];
75 struct ulp_phy_port_info *phy_port_list;
76 uint16_t phy_port_cnt;
77 struct ulp_func_if_info ulp_func_id_tbl[BNXT_PORT_DB_MAX_FUNC];
78};
79
80
81
82
83
84
85
86
87
88int32_t ulp_port_db_init(struct bnxt_ulp_context *ulp_ctxt, uint8_t port_cnt);
89
90
91
92
93
94
95
96
97
98int32_t ulp_port_db_deinit(struct bnxt_ulp_context *ulp_ctxt);
99
100
101
102
103
104
105
106
107
108
109int32_t ulp_port_db_dev_port_intf_update(struct bnxt_ulp_context *ulp_ctxt,
110 struct rte_eth_dev *eth_dev);
111
112
113
114
115
116
117
118
119
120
121int32_t
122ulp_port_db_dev_port_to_ulp_index(struct bnxt_ulp_context *ulp_ctxt,
123 uint32_t port_id, uint32_t *ifindex);
124
125
126
127
128
129
130
131
132
133
134int32_t
135ulp_port_db_function_id_get(struct bnxt_ulp_context *ulp_ctxt,
136 uint32_t ifindex, uint32_t fid_type,
137 uint16_t *func_id);
138
139
140
141
142
143
144
145
146
147
148
149int32_t
150ulp_port_db_svif_get(struct bnxt_ulp_context *ulp_ctxt,
151 uint32_t ifindex, uint32_t dir, uint16_t *svif);
152
153
154
155
156
157
158
159
160
161
162
163int32_t
164ulp_port_db_spif_get(struct bnxt_ulp_context *ulp_ctxt,
165 uint32_t ifindex, uint32_t dir, uint16_t *spif);
166
167
168
169
170
171
172
173
174
175
176
177
178int32_t
179ulp_port_db_parif_get(struct bnxt_ulp_context *ulp_ctxt,
180 uint32_t ifindex, uint32_t dir, uint16_t *parif);
181
182
183
184
185
186
187
188
189
190
191int32_t
192ulp_port_db_default_vnic_get(struct bnxt_ulp_context *ulp_ctxt,
193 uint32_t ifindex, uint32_t vnic_type,
194 uint16_t *vnic);
195
196
197
198
199
200
201
202
203
204
205int32_t
206ulp_port_db_vport_get(struct bnxt_ulp_context *ulp_ctxt,
207 uint32_t ifindex, uint16_t *vport);
208
209
210
211
212
213
214
215
216
217
218int32_t
219ulp_port_db_phy_port_vport_get(struct bnxt_ulp_context *ulp_ctxt,
220 uint32_t phy_port,
221 uint16_t *out_port);
222
223
224
225
226
227
228
229
230
231
232int32_t
233ulp_port_db_phy_port_svif_get(struct bnxt_ulp_context *ulp_ctxt,
234 uint32_t phy_port,
235 uint16_t *svif);
236
237
238
239
240
241
242
243
244
245enum bnxt_ulp_intf_type
246ulp_port_db_port_type_get(struct bnxt_ulp_context *ulp_ctxt,
247 uint32_t ifindex);
248
249
250
251
252
253
254
255
256
257
258int32_t
259ulp_port_db_dev_func_id_to_ulp_index(struct bnxt_ulp_context *ulp_ctxt,
260 uint32_t func_id, uint32_t *ifindex);
261
262
263
264
265
266
267
268
269
270
271int32_t
272ulp_port_db_port_func_id_get(struct bnxt_ulp_context *ulp_ctxt,
273 uint16_t port_id, uint16_t *func_id);
274
275#endif
276