1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
|
/* SPDX-License-Identifier: GPL-2.0 */
/* Marvell RVU Admin Function driver
*
* Copyright (C) 2024 Marvell.
*
*/
#ifndef STRUCT_H
#define STRUCT_H
#define NIX_MAX_CTX_SIZE 128
/*
* CN20k RVU PF MBOX Interrupt Vector Enumeration
*
* Vectors 0 - 3 are compatible with pre cn20k and hence
* existing macros are being reused.
*/
enum rvu_mbox_pf_int_vec_e {
RVU_MBOX_PF_INT_VEC_VFPF_MBOX0 = 0x4,
RVU_MBOX_PF_INT_VEC_VFPF_MBOX1 = 0x5,
RVU_MBOX_PF_INT_VEC_VFPF1_MBOX0 = 0x6,
RVU_MBOX_PF_INT_VEC_VFPF1_MBOX1 = 0x7,
RVU_MBOX_PF_INT_VEC_AFPF_MBOX = 0x8,
RVU_MBOX_PF_INT_VEC_CNT = 0x9,
};
/* RVU Admin function Interrupt Vector Enumeration */
enum rvu_af_cn20k_int_vec_e {
RVU_AF_CN20K_INT_VEC_POISON = 0x0,
RVU_AF_CN20K_INT_VEC_PFFLR0 = 0x1,
RVU_AF_CN20K_INT_VEC_PFFLR1 = 0x2,
RVU_AF_CN20K_INT_VEC_PFME0 = 0x3,
RVU_AF_CN20K_INT_VEC_PFME1 = 0x4,
RVU_AF_CN20K_INT_VEC_GEN = 0x5,
RVU_AF_CN20K_INT_VEC_PFAF_MBOX0 = 0x6,
RVU_AF_CN20K_INT_VEC_PFAF_MBOX1 = 0x7,
RVU_AF_CN20K_INT_VEC_PFAF1_MBOX0 = 0x8,
RVU_AF_CN20K_INT_VEC_PFAF1_MBOX1 = 0x9,
RVU_AF_CN20K_INT_VEC_CNT = 0xa,
};
struct nix_cn20k_sq_ctx_s {
u64 ena : 1; /* W0 */
u64 qint_idx : 6;
u64 substream : 20;
u64 sdp_mcast : 1;
u64 cq : 20;
u64 sqe_way_mask : 16;
u64 smq : 11; /* W1 */
u64 cq_ena : 1;
u64 xoff : 1;
u64 sso_ena : 1;
u64 smq_rr_weight : 14;
u64 default_chan : 12;
u64 sqb_count : 16;
u64 reserved_120_120 : 1;
u64 smq_rr_count_lb : 7;
u64 smq_rr_count_ub : 25; /* W2 */
u64 sqb_aura : 20;
u64 sq_int : 8;
u64 sq_int_ena : 8;
u64 sqe_stype : 2;
u64 reserved_191_191 : 1;
u64 max_sqe_size : 2; /* W3 */
u64 cq_limit : 8;
u64 lmt_dis : 1;
u64 mnq_dis : 1;
u64 smq_next_sq : 20;
u64 smq_lso_segnum : 8;
u64 tail_offset : 6;
u64 smenq_offset : 6;
u64 head_offset : 6;
u64 smenq_next_sqb_vld : 1;
u64 smq_pend : 1;
u64 smq_next_sq_vld : 1;
u64 reserved_253_255 : 3;
u64 next_sqb : 64; /* W4 */
u64 tail_sqb : 64; /* W5 */
u64 smenq_sqb : 64; /* W6 */
u64 smenq_next_sqb : 64; /* W7 */
u64 head_sqb : 64; /* W8 */
u64 reserved_576_583 : 8; /* W9 */
u64 vfi_lso_total : 18;
u64 vfi_lso_sizem1 : 3;
u64 vfi_lso_sb : 8;
u64 vfi_lso_mps : 14;
u64 vfi_lso_vlan0_ins_ena : 1;
u64 vfi_lso_vlan1_ins_ena : 1;
u64 vfi_lso_vld : 1;
u64 reserved_630_639 : 10;
u64 scm_lso_rem : 18; /* W10 */
u64 reserved_658_703 : 46;
u64 octs : 48; /* W11 */
u64 reserved_752_767 : 16;
u64 pkts : 48; /* W12 */
u64 reserved_816_831 : 16;
u64 aged_drop_octs : 32; /* W13 */
u64 aged_drop_pkts : 32;
u64 dropped_octs : 48; /* W14 */
u64 reserved_944_959 : 16;
u64 dropped_pkts : 48; /* W15 */
u64 reserved_1008_1023 : 16;
};
static_assert(sizeof(struct nix_cn20k_sq_ctx_s) == NIX_MAX_CTX_SIZE);
struct nix_cn20k_cq_ctx_s {
u64 base : 64; /* W0 */
u64 lbp_ena : 1; /* W1 */
u64 lbpid_low : 3;
u64 bp_ena : 1;
u64 lbpid_med : 3;
u64 bpid : 9;
u64 lbpid_high : 3;
u64 qint_idx : 7;
u64 cq_err : 1;
u64 cint_idx : 7;
u64 avg_con : 9;
u64 wrptr : 20;
u64 tail : 20; /* W2 */
u64 head : 20;
u64 avg_level : 8;
u64 update_time : 16;
u64 bp : 8; /* W3 */
u64 drop : 8;
u64 drop_ena : 1;
u64 ena : 1;
u64 cpt_drop_err_en : 1;
u64 reserved_211_211 : 1;
u64 msh_dst : 11;
u64 msh_valid : 1;
u64 stash_thresh : 4;
u64 lbp_frac : 4;
u64 caching : 1;
u64 stashing : 1;
u64 reserved_234_235 : 2;
u64 qsize : 4;
u64 cq_err_int : 8;
u64 cq_err_int_ena : 8;
u64 bpid_ext : 2; /* W4 */
u64 reserved_258_259 : 2;
u64 lbpid_ext : 2;
u64 reserved_262_319 : 58;
u64 reserved_320_383 : 64; /* W5 */
u64 reserved_384_447 : 64; /* W6 */
u64 reserved_448_511 : 64; /* W7 */
u64 padding[8];
};
static_assert(sizeof(struct nix_cn20k_sq_ctx_s) == NIX_MAX_CTX_SIZE);
struct nix_cn20k_rq_ctx_s {
u64 ena : 1;
u64 sso_ena : 1;
u64 ipsech_ena : 1;
u64 ena_wqwd : 1;
u64 cq : 20;
u64 reserved_24_34 : 11;
u64 port_il4_dis : 1;
u64 port_ol4_dis : 1;
u64 lenerr_dis : 1;
u64 csum_il4_dis : 1;
u64 csum_ol4_dis : 1;
u64 len_il4_dis : 1;
u64 len_il3_dis : 1;
u64 len_ol4_dis : 1;
u64 len_ol3_dis : 1;
u64 wqe_aura : 20;
u64 spb_aura : 20;
u64 lpb_aura : 20;
u64 sso_grp : 10;
u64 sso_tt : 2;
u64 pb_caching : 2;
u64 wqe_caching : 1;
u64 xqe_drop_ena : 1;
u64 spb_drop_ena : 1;
u64 lpb_drop_ena : 1;
u64 pb_stashing : 1;
u64 ipsecd_drop_en : 1;
u64 chi_ena : 1;
u64 reserved_125_127 : 3;
u64 band_prof_id_l : 10;
u64 sso_fc_ena : 1;
u64 policer_ena : 1;
u64 spb_sizem1 : 6;
u64 wqe_skip : 2;
u64 spb_high_sizem1 : 3;
u64 spb_ena : 1;
u64 lpb_sizem1 : 12;
u64 first_skip : 7;
u64 reserved_171_171 : 1;
u64 later_skip : 6;
u64 xqe_imm_size : 6;
u64 band_prof_id_h : 4;
u64 reserved_188_189 : 2;
u64 xqe_imm_copy : 1;
u64 xqe_hdr_split : 1;
u64 xqe_drop : 8;
u64 xqe_pass : 8;
u64 wqe_pool_drop : 8;
u64 wqe_pool_pass : 8;
u64 spb_aura_drop : 8;
u64 spb_aura_pass : 8;
u64 spb_pool_drop : 8;
u64 spb_pool_pass : 8;
u64 lpb_aura_drop : 8;
u64 lpb_aura_pass : 8;
u64 lpb_pool_drop : 8;
u64 lpb_pool_pass : 8;
u64 reserved_288_291 : 4;
u64 rq_int : 8;
u64 rq_int_ena : 8;
u64 qint_idx : 7;
u64 reserved_315_319 : 5;
u64 ltag : 24;
u64 good_utag : 8;
u64 bad_utag : 8;
u64 flow_tagw : 6;
u64 ipsec_vwqe : 1;
u64 vwqe_ena : 1;
u64 vtime_wait : 8;
u64 max_vsize_exp : 4;
u64 vwqe_skip : 2;
u64 reserved_382_383 : 2;
u64 octs : 48;
u64 reserved_432_447 : 16;
u64 pkts : 48;
u64 reserved_496_511 : 16;
u64 drop_octs : 48;
u64 reserved_560_575 : 16;
u64 drop_pkts : 48;
u64 reserved_624_639 : 16;
u64 re_pkts : 48;
u64 reserved_688_703 : 16;
u64 reserved_704_767 : 64;
u64 reserved_768_831 : 64;
u64 reserved_832_895 : 64;
u64 reserved_896_959 : 64;
u64 reserved_960_1023 : 64;
};
static_assert(sizeof(struct nix_cn20k_rq_ctx_s) == NIX_MAX_CTX_SIZE);
struct npa_cn20k_aura_s {
u64 pool_addr; /* W0 */
u64 ena : 1; /* W1 */
u64 reserved_65 : 2;
u64 pool_caching : 1;
u64 reserved_68 : 16;
u64 avg_con : 9;
u64 reserved_93 : 1;
u64 pool_drop_ena : 1;
u64 aura_drop_ena : 1;
u64 bp_ena : 1;
u64 reserved_97_103 : 7;
u64 aura_drop : 8;
u64 shift : 6;
u64 reserved_118_119 : 2;
u64 avg_level : 8;
u64 count : 36; /* W2 */
u64 reserved_164_167 : 4;
u64 bpid : 12;
u64 reserved_180_191 : 12;
u64 limit : 36; /* W3 */
u64 reserved_228_231 : 4;
u64 bp : 7;
u64 reserved_239_243 : 5;
u64 fc_ena : 1;
u64 fc_up_crossing : 1;
u64 fc_stype : 2;
u64 fc_hyst_bits : 4;
u64 reserved_252_255 : 4;
u64 fc_addr; /* W4 */
u64 pool_drop : 8; /* W5 */
u64 update_time : 16;
u64 err_int : 8;
u64 err_int_ena : 8;
u64 thresh_int : 1;
u64 thresh_int_ena : 1;
u64 thresh_up : 1;
u64 reserved_363 : 1;
u64 thresh_qint_idx : 7;
u64 reserved_371 : 1;
u64 err_qint_idx : 7;
u64 reserved_379_383 : 5;
u64 thresh : 36; /* W6*/
u64 rsvd_423_420 : 4;
u64 fc_msh_dst : 11;
u64 reserved_435_438 : 4;
u64 op_dpc_ena : 1;
u64 op_dpc_set : 5;
u64 reserved_445_445 : 1;
u64 stream_ctx : 1;
u64 unified_ctx : 1;
u64 reserved_448_511; /* W7 */
u64 padding[8];
};
static_assert(sizeof(struct npa_cn20k_aura_s) == NIX_MAX_CTX_SIZE);
struct npa_cn20k_pool_s {
u64 stack_base; /* W0 */
u64 ena : 1;
u64 nat_align : 1;
u64 reserved_66_67 : 2;
u64 stack_caching : 1;
u64 reserved_69_87 : 19;
u64 buf_offset : 12;
u64 reserved_100_103 : 4;
u64 buf_size : 12;
u64 reserved_116_119 : 4;
u64 ref_cnt_prof : 3;
u64 reserved_123_127 : 5;
u64 stack_max_pages : 32;
u64 stack_pages : 32;
uint64_t bp_0 : 7;
uint64_t bp_1 : 7;
uint64_t bp_2 : 7;
uint64_t bp_3 : 7;
uint64_t bp_4 : 7;
uint64_t bp_5 : 7;
uint64_t bp_6 : 7;
uint64_t bp_7 : 7;
uint64_t bp_ena_0 : 1;
uint64_t bp_ena_1 : 1;
uint64_t bp_ena_2 : 1;
uint64_t bp_ena_3 : 1;
uint64_t bp_ena_4 : 1;
uint64_t bp_ena_5 : 1;
uint64_t bp_ena_6 : 1;
uint64_t bp_ena_7 : 1;
u64 stack_offset : 4;
u64 reserved_260_263 : 4;
u64 shift : 6;
u64 reserved_270_271 : 2;
u64 avg_level : 8;
u64 avg_con : 9;
u64 fc_ena : 1;
u64 fc_stype : 2;
u64 fc_hyst_bits : 4;
u64 fc_up_crossing : 1;
u64 reserved_297_299 : 3;
u64 update_time : 16;
u64 reserved_316_319 : 4;
u64 fc_addr; /* W5 */
u64 ptr_start; /* W6 */
u64 ptr_end; /* W7 */
u64 bpid_0 : 12;
u64 reserved_524_535 : 12;
u64 err_int : 8;
u64 err_int_ena : 8;
u64 thresh_int : 1;
u64 thresh_int_ena : 1;
u64 thresh_up : 1;
u64 reserved_555 : 1;
u64 thresh_qint_idx : 7;
u64 reserved_563 : 1;
u64 err_qint_idx : 7;
u64 reserved_571_575 : 5;
u64 thresh : 36;
u64 rsvd_612_615 : 4;
u64 fc_msh_dst : 11;
u64 reserved_627_630 : 4;
u64 op_dpc_ena : 1;
u64 op_dpc_set : 5;
u64 reserved_637_637 : 1;
u64 stream_ctx : 1;
u64 reserved_639 : 1;
u64 reserved_640_703; /* W10 */
u64 reserved_704_767; /* W11 */
u64 reserved_768_831; /* W12 */
u64 reserved_832_895; /* W13 */
u64 reserved_896_959; /* W14 */
u64 reserved_960_1023; /* W15 */
};
static_assert(sizeof(struct npa_cn20k_pool_s) == NIX_MAX_CTX_SIZE);
#endif
|