Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright(C) 2021 Marvell.
3 : : */
4 : :
5 : : #include "roc_api.h"
6 : : #include "roc_priv.h"
7 : :
8 : :
9 : : #define nix_dump(file, fmt, ...) do { \
10 : : if ((file) == NULL) \
11 : : plt_dump(fmt, ##__VA_ARGS__); \
12 : : else \
13 : : fprintf(file, fmt "\n", ##__VA_ARGS__); \
14 : : } while (0)
15 : :
16 : : #define NIX_REG_INFO(reg) \
17 : : { \
18 : : reg, #reg \
19 : : }
20 : : #define NIX_REG_NAME_SZ 48
21 : :
22 : : #define nix_dump_no_nl(file, fmt, ...) do { \
23 : : if ((file) == NULL) \
24 : : plt_dump_no_nl(fmt, ##__VA_ARGS__); \
25 : : else \
26 : : fprintf(file, fmt, ##__VA_ARGS__); \
27 : : } while (0)
28 : :
29 : :
30 : : struct nix_lf_reg_info {
31 : : uint32_t offset;
32 : : const char *name;
33 : : };
34 : :
35 : : static const struct nix_lf_reg_info nix_lf_reg[] = {
36 : : NIX_REG_INFO(NIX_LF_RX_SECRETX(0)),
37 : : NIX_REG_INFO(NIX_LF_RX_SECRETX(1)),
38 : : NIX_REG_INFO(NIX_LF_RX_SECRETX(2)),
39 : : NIX_REG_INFO(NIX_LF_RX_SECRETX(3)),
40 : : NIX_REG_INFO(NIX_LF_RX_SECRETX(4)),
41 : : NIX_REG_INFO(NIX_LF_RX_SECRETX(5)),
42 : : NIX_REG_INFO(NIX_LF_CFG),
43 : : NIX_REG_INFO(NIX_LF_GINT),
44 : : NIX_REG_INFO(NIX_LF_GINT_W1S),
45 : : NIX_REG_INFO(NIX_LF_GINT_ENA_W1C),
46 : : NIX_REG_INFO(NIX_LF_GINT_ENA_W1S),
47 : : NIX_REG_INFO(NIX_LF_ERR_INT),
48 : : NIX_REG_INFO(NIX_LF_ERR_INT_W1S),
49 : : NIX_REG_INFO(NIX_LF_ERR_INT_ENA_W1C),
50 : : NIX_REG_INFO(NIX_LF_ERR_INT_ENA_W1S),
51 : : NIX_REG_INFO(NIX_LF_RAS),
52 : : NIX_REG_INFO(NIX_LF_RAS_W1S),
53 : : NIX_REG_INFO(NIX_LF_RAS_ENA_W1C),
54 : : NIX_REG_INFO(NIX_LF_RAS_ENA_W1S),
55 : : NIX_REG_INFO(NIX_LF_SQ_OP_ERR_DBG),
56 : : NIX_REG_INFO(NIX_LF_MNQ_ERR_DBG),
57 : : NIX_REG_INFO(NIX_LF_SEND_ERR_DBG),
58 : : };
59 : :
60 : : static void
61 : 0 : nix_bitmap_dump(struct plt_bitmap *bmp, FILE *file)
62 : : {
63 : 0 : uint32_t pos = 0, start_pos;
64 : 0 : uint64_t slab = 0;
65 : : int i;
66 : :
67 : : plt_bitmap_scan_init(bmp);
68 [ # # ]: 0 : if (!plt_bitmap_scan(bmp, &pos, &slab))
69 : 0 : return;
70 : :
71 : 0 : start_pos = pos;
72 : :
73 [ # # ]: 0 : nix_dump_no_nl(file, " \t\t[");
74 : : do {
75 [ # # ]: 0 : if (!slab)
76 : : break;
77 : : i = 0;
78 : :
79 [ # # ]: 0 : for (i = 0; i < 64; i++)
80 [ # # ]: 0 : if (slab & (1ULL << i))
81 [ # # ]: 0 : nix_dump_no_nl(file, "%d, ", i);
82 : :
83 [ # # ]: 0 : if (!plt_bitmap_scan(bmp, &pos, &slab))
84 : : break;
85 [ # # ]: 0 : } while (start_pos != pos);
86 [ # # ]: 0 : nix_dump_no_nl(file, " ]");
87 : : }
88 : :
89 : : int
90 : 0 : roc_nix_lf_get_reg_count(struct roc_nix *roc_nix)
91 : : {
92 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
93 : : int reg_count;
94 : :
95 [ # # ]: 0 : if (roc_nix == NULL)
96 : : return NIX_ERR_PARAM;
97 : :
98 : : reg_count = PLT_DIM(nix_lf_reg);
99 : : /* NIX_LF_TX_STATX */
100 : 0 : reg_count += nix->lf_tx_stats;
101 : : /* NIX_LF_RX_STATX */
102 : 0 : reg_count += nix->lf_rx_stats;
103 : : /* NIX_LF_QINTX_CNT*/
104 : 0 : reg_count += nix->qints;
105 : : /* NIX_LF_QINTX_INT */
106 : 0 : reg_count += nix->qints;
107 : : /* NIX_LF_QINTX_ENA_W1S */
108 : 0 : reg_count += nix->qints;
109 : : /* NIX_LF_QINTX_ENA_W1C */
110 : 0 : reg_count += nix->qints;
111 : : /* NIX_LF_CINTX_CNT */
112 : 0 : reg_count += nix->cints;
113 : : /* NIX_LF_CINTX_WAIT */
114 : 0 : reg_count += nix->cints;
115 : : /* NIX_LF_CINTX_INT */
116 : 0 : reg_count += nix->cints;
117 : : /* NIX_LF_CINTX_INT_W1S */
118 : 0 : reg_count += nix->cints;
119 : : /* NIX_LF_CINTX_ENA_W1S */
120 : 0 : reg_count += nix->cints;
121 : : /* NIX_LF_CINTX_ENA_W1C */
122 : 0 : reg_count += nix->cints;
123 : :
124 : 0 : return reg_count;
125 : : }
126 : :
127 : : int
128 : 0 : nix_lf_gen_reg_dump(uintptr_t nix_lf_base, uint64_t *data)
129 : : {
130 : : FILE *file = NULL;
131 : : bool dump_stdout;
132 : : uint64_t reg;
133 : : uint32_t i;
134 : :
135 : 0 : dump_stdout = data ? 0 : 1;
136 : :
137 [ # # ]: 0 : for (i = 0; i < PLT_DIM(nix_lf_reg); i++) {
138 [ # # ]: 0 : reg = plt_read64(nix_lf_base + nix_lf_reg[i].offset);
139 [ # # ]: 0 : if (dump_stdout && reg)
140 : 0 : nix_dump(file, "%32s = 0x%" PRIx64, nix_lf_reg[i].name, reg);
141 [ # # ]: 0 : if (data)
142 : 0 : *data++ = reg;
143 : : }
144 : :
145 : 0 : return i;
146 : : }
147 : :
148 : : int
149 : 0 : nix_lf_stat_reg_dump(uintptr_t nix_lf_base, uint64_t *data, uint8_t lf_tx_stats,
150 : : uint8_t lf_rx_stats)
151 : : {
152 : : uint32_t i, count = 0;
153 : : FILE *file = NULL;
154 : : bool dump_stdout;
155 : : uint64_t reg;
156 : :
157 : 0 : dump_stdout = data ? 0 : 1;
158 : :
159 : : /* NIX_LF_TX_STATX */
160 [ # # ]: 0 : for (i = 0; i < lf_tx_stats; i++) {
161 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_TX_STATX(i));
162 [ # # ]: 0 : if (dump_stdout && reg)
163 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_TX_STATX", i,
164 : : reg);
165 [ # # ]: 0 : if (data)
166 : 0 : *data++ = reg;
167 : : }
168 : : count += i;
169 : :
170 : : /* NIX_LF_RX_STATX */
171 [ # # ]: 0 : for (i = 0; i < lf_rx_stats; i++) {
172 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_RX_STATX(i));
173 [ # # ]: 0 : if (dump_stdout && reg)
174 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_RX_STATX", i,
175 : : reg);
176 [ # # ]: 0 : if (data)
177 : 0 : *data++ = reg;
178 : : }
179 : :
180 : 0 : return count + i;
181 : : }
182 : :
183 : : int
184 : 0 : nix_lf_int_reg_dump(uintptr_t nix_lf_base, uint64_t *data, uint16_t qints,
185 : : uint16_t cints)
186 : : {
187 : : uint32_t i, count = 0;
188 : : FILE *file = NULL;
189 : : bool dump_stdout;
190 : : uint64_t reg;
191 : :
192 : 0 : dump_stdout = data ? 0 : 1;
193 : :
194 : : /* NIX_LF_QINTX_CNT*/
195 [ # # ]: 0 : for (i = 0; i < qints; i++) {
196 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_QINTX_CNT(i));
197 [ # # ]: 0 : if (dump_stdout && reg)
198 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_QINTX_CNT", i,
199 : : reg);
200 [ # # ]: 0 : if (data)
201 : 0 : *data++ = reg;
202 : : }
203 : : count += i;
204 : :
205 : : /* NIX_LF_QINTX_INT */
206 [ # # ]: 0 : for (i = 0; i < qints; i++) {
207 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_QINTX_INT(i));
208 [ # # ]: 0 : if (dump_stdout && reg)
209 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_QINTX_INT", i,
210 : : reg);
211 [ # # ]: 0 : if (data)
212 : 0 : *data++ = reg;
213 : : }
214 : 0 : count += i;
215 : :
216 : : /* NIX_LF_QINTX_ENA_W1S */
217 [ # # ]: 0 : for (i = 0; i < qints; i++) {
218 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_QINTX_ENA_W1S(i));
219 [ # # ]: 0 : if (dump_stdout && reg)
220 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_QINTX_ENA_W1S",
221 : : i, reg);
222 [ # # ]: 0 : if (data)
223 : 0 : *data++ = reg;
224 : : }
225 : 0 : count += i;
226 : :
227 : : /* NIX_LF_QINTX_ENA_W1C */
228 [ # # ]: 0 : for (i = 0; i < qints; i++) {
229 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_QINTX_ENA_W1C(i));
230 [ # # ]: 0 : if (dump_stdout && reg)
231 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_QINTX_ENA_W1C",
232 : : i, reg);
233 [ # # ]: 0 : if (data)
234 : 0 : *data++ = reg;
235 : : }
236 : 0 : count += i;
237 : :
238 : : /* NIX_LF_CINTX_CNT */
239 [ # # ]: 0 : for (i = 0; i < cints; i++) {
240 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_CINTX_CNT(i));
241 [ # # ]: 0 : if (dump_stdout && reg)
242 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_CINTX_CNT", i,
243 : : reg);
244 [ # # ]: 0 : if (data)
245 : 0 : *data++ = reg;
246 : : }
247 : 0 : count += i;
248 : :
249 : : /* NIX_LF_CINTX_WAIT */
250 [ # # ]: 0 : for (i = 0; i < cints; i++) {
251 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_CINTX_WAIT(i));
252 [ # # ]: 0 : if (dump_stdout && reg)
253 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_CINTX_WAIT", i,
254 : : reg);
255 [ # # ]: 0 : if (data)
256 : 0 : *data++ = reg;
257 : : }
258 : 0 : count += i;
259 : :
260 : : /* NIX_LF_CINTX_INT */
261 [ # # ]: 0 : for (i = 0; i < cints; i++) {
262 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_CINTX_INT(i));
263 [ # # ]: 0 : if (dump_stdout && reg)
264 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_CINTX_INT", i,
265 : : reg);
266 [ # # ]: 0 : if (data)
267 : 0 : *data++ = reg;
268 : : }
269 : 0 : count += i;
270 : :
271 : : /* NIX_LF_CINTX_INT_W1S */
272 [ # # ]: 0 : for (i = 0; i < cints; i++) {
273 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_CINTX_INT_W1S(i));
274 [ # # ]: 0 : if (dump_stdout && reg)
275 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_CINTX_INT_W1S",
276 : : i, reg);
277 [ # # ]: 0 : if (data)
278 : 0 : *data++ = reg;
279 : : }
280 : 0 : count += i;
281 : :
282 : : /* NIX_LF_CINTX_ENA_W1S */
283 [ # # ]: 0 : for (i = 0; i < cints; i++) {
284 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_CINTX_ENA_W1S(i));
285 [ # # ]: 0 : if (dump_stdout && reg)
286 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_CINTX_ENA_W1S",
287 : : i, reg);
288 [ # # ]: 0 : if (data)
289 : 0 : *data++ = reg;
290 : : }
291 : 0 : count += i;
292 : :
293 : : /* NIX_LF_CINTX_ENA_W1C */
294 [ # # ]: 0 : for (i = 0; i < cints; i++) {
295 [ # # ]: 0 : reg = plt_read64(nix_lf_base + NIX_LF_CINTX_ENA_W1C(i));
296 : : if (dump_stdout && reg)
297 : 0 : nix_dump(file, "%32s_%d = 0x%" PRIx64, "NIX_LF_CINTX_ENA_W1C",
298 : : i, reg);
299 [ # # ]: 0 : if (data)
300 : 0 : *data++ = reg;
301 : : }
302 : :
303 : 0 : return count + i;
304 : : }
305 : :
306 : : int
307 : 0 : roc_nix_lf_reg_dump(struct roc_nix *roc_nix, uint64_t *data)
308 : : {
309 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
310 : : bool dump_stdout = data ? 0 : 1;
311 : : uintptr_t nix_base;
312 : : uint32_t i;
313 : :
314 [ # # ]: 0 : if (roc_nix == NULL)
315 : : return NIX_ERR_PARAM;
316 : :
317 : 0 : nix_base = nix->base;
318 : : /* General registers */
319 : 0 : i = nix_lf_gen_reg_dump(nix_base, data);
320 : :
321 : : /* Rx, Tx stat registers */
322 : 0 : i += nix_lf_stat_reg_dump(nix_base, dump_stdout ? NULL : &data[i],
323 [ # # ]: 0 : nix->lf_tx_stats, nix->lf_rx_stats);
324 : :
325 : : /* Intr registers */
326 : 0 : i += nix_lf_int_reg_dump(nix_base, dump_stdout ? NULL : &data[i],
327 [ # # ]: 0 : nix->qints, nix->cints);
328 : :
329 : 0 : return 0;
330 : : }
331 : :
332 : : int
333 : 0 : nix_q_ctx_get(struct dev *dev, uint8_t ctype, uint16_t qid, __io void **ctx_p)
334 : : {
335 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
336 : : int rc;
337 : :
338 [ # # ]: 0 : if (roc_model_is_cn9k()) {
339 : : struct nix_aq_enq_rsp *rsp;
340 : : struct nix_aq_enq_req *aq;
341 : :
342 : 0 : aq = mbox_alloc_msg_nix_aq_enq(mbox);
343 [ # # ]: 0 : if (!aq) {
344 : : rc = -ENOSPC;
345 : 0 : goto exit;
346 : : }
347 : :
348 : 0 : aq->qidx = qid;
349 : 0 : aq->ctype = ctype;
350 : 0 : aq->op = NIX_AQ_INSTOP_READ;
351 : :
352 : : rc = mbox_process_msg(mbox, (void *)&rsp);
353 [ # # ]: 0 : if (rc)
354 : 0 : goto exit;
355 [ # # ]: 0 : if (ctype == NIX_AQ_CTYPE_RQ)
356 : 0 : *ctx_p = &rsp->rq;
357 [ # # ]: 0 : else if (ctype == NIX_AQ_CTYPE_SQ)
358 : 0 : *ctx_p = &rsp->sq;
359 : : else
360 : 0 : *ctx_p = &rsp->cq;
361 [ # # ]: 0 : } else if (roc_model_is_cn10k()) {
362 : : struct nix_cn10k_aq_enq_rsp *rsp;
363 : : struct nix_cn10k_aq_enq_req *aq;
364 : :
365 : 0 : aq = mbox_alloc_msg_nix_cn10k_aq_enq(mbox);
366 [ # # ]: 0 : if (!aq) {
367 : : rc = -ENOSPC;
368 : 0 : goto exit;
369 : : }
370 : :
371 : 0 : aq->qidx = qid;
372 : 0 : aq->ctype = ctype;
373 : 0 : aq->op = NIX_AQ_INSTOP_READ;
374 : :
375 : : rc = mbox_process_msg(mbox, (void *)&rsp);
376 [ # # ]: 0 : if (rc)
377 : 0 : goto exit;
378 : :
379 [ # # ]: 0 : if (ctype == NIX_AQ_CTYPE_RQ)
380 : 0 : *ctx_p = &rsp->rq;
381 [ # # ]: 0 : else if (ctype == NIX_AQ_CTYPE_SQ)
382 : 0 : *ctx_p = &rsp->sq;
383 : : else
384 : 0 : *ctx_p = &rsp->cq;
385 : : } else {
386 : : struct nix_cn20k_aq_enq_rsp *rsp;
387 : : struct nix_cn20k_aq_enq_req *aq;
388 : :
389 : 0 : aq = mbox_alloc_msg_nix_cn20k_aq_enq(mbox);
390 [ # # ]: 0 : if (!aq) {
391 : : rc = -ENOSPC;
392 : 0 : goto exit;
393 : : }
394 : :
395 : 0 : aq->qidx = qid;
396 : 0 : aq->ctype = ctype;
397 : 0 : aq->op = NIX_AQ_INSTOP_READ;
398 : :
399 : : rc = mbox_process_msg(mbox, (void *)&rsp);
400 [ # # ]: 0 : if (rc)
401 : 0 : goto exit;
402 : :
403 [ # # ]: 0 : if (ctype == NIX_AQ_CTYPE_RQ)
404 : 0 : *ctx_p = &rsp->rq;
405 [ # # ]: 0 : else if (ctype == NIX_AQ_CTYPE_SQ)
406 : 0 : *ctx_p = &rsp->sq;
407 : : else
408 : 0 : *ctx_p = &rsp->cq;
409 : : }
410 : : rc = 0;
411 : 0 : exit:
412 : : mbox_put(mbox);
413 : 0 : return rc;
414 : : }
415 : :
416 : : static inline void
417 : 0 : nix_cn9k_lf_sq_dump(__io struct nix_sq_ctx_s *ctx, uint32_t *sqb_aura_p, FILE *file)
418 : : {
419 [ # # ]: 0 : nix_dump(file, "W0: sqe_way_mask \t\t%d\nW0: cq \t\t\t\t%d",
420 : : ctx->sqe_way_mask, ctx->cq);
421 [ # # ]: 0 : nix_dump(file, "W0: sdp_mcast \t\t\t%d\nW0: substream \t\t\t0x%03x",
422 : : ctx->sdp_mcast, ctx->substream);
423 [ # # ]: 0 : nix_dump(file, "W0: qint_idx \t\t\t%d\nW0: ena \t\t\t%d\n", ctx->qint_idx,
424 : : ctx->ena);
425 : :
426 [ # # ]: 0 : nix_dump(file, "W1: sqb_count \t\t\t%d\nW1: default_chan \t\t%d",
427 : : ctx->sqb_count, ctx->default_chan);
428 [ # # ]: 0 : nix_dump(file, "W1: smq_rr_quantum \t\t%d\nW1: sso_ena \t\t\t%d",
429 : : ctx->smq_rr_quantum, ctx->sso_ena);
430 [ # # ]: 0 : nix_dump(file, "W1: xoff \t\t\t%d\nW1: cq_ena \t\t\t%d\nW1: smq\t\t\t\t%d\n",
431 : : ctx->xoff, ctx->cq_ena, ctx->smq);
432 : :
433 [ # # ]: 0 : nix_dump(file, "W2: sqe_stype \t\t\t%d\nW2: sq_int_ena \t\t\t%d",
434 : : ctx->sqe_stype, ctx->sq_int_ena);
435 [ # # ]: 0 : nix_dump(file, "W2: sq_int \t\t\t%d\nW2: sqb_aura \t\t\t%d", ctx->sq_int,
436 : : ctx->sqb_aura);
437 [ # # ]: 0 : nix_dump(file, "W2: smq_rr_count \t\t%d\n", ctx->smq_rr_count);
438 : :
439 [ # # ]: 0 : nix_dump(file, "W3: smq_next_sq_vld\t\t%d\nW3: smq_pend\t\t\t%d",
440 : : ctx->smq_next_sq_vld, ctx->smq_pend);
441 [ # # ]: 0 : nix_dump(file, "W3: smenq_next_sqb_vld \t%d\nW3: head_offset\t\t\t%d",
442 : : ctx->smenq_next_sqb_vld, ctx->head_offset);
443 [ # # ]: 0 : nix_dump(file, "W3: smenq_offset\t\t%d\nW3: tail_offset \t\t%d",
444 : : ctx->smenq_offset, ctx->tail_offset);
445 [ # # ]: 0 : nix_dump(file, "W3: smq_lso_segnum \t\t%d\nW3: smq_next_sq \t\t%d",
446 : : ctx->smq_lso_segnum, ctx->smq_next_sq);
447 [ # # ]: 0 : nix_dump(file, "W3: mnq_dis \t\t\t%d\nW3: lmt_dis \t\t\t%d", ctx->mnq_dis,
448 : : ctx->lmt_dis);
449 [ # # ]: 0 : nix_dump(file, "W3: cq_limit\t\t\t%d\nW3: max_sqe_size\t\t%d\n",
450 : : ctx->cq_limit, ctx->max_sqe_size);
451 : :
452 [ # # ]: 0 : nix_dump(file, "W4: next_sqb \t\t\t0x%" PRIx64 "", ctx->next_sqb);
453 [ # # ]: 0 : nix_dump(file, "W5: tail_sqb \t\t\t0x%" PRIx64 "", ctx->tail_sqb);
454 [ # # ]: 0 : nix_dump(file, "W6: smenq_sqb \t\t\t0x%" PRIx64 "", ctx->smenq_sqb);
455 [ # # ]: 0 : nix_dump(file, "W7: smenq_next_sqb \t\t0x%" PRIx64 "", ctx->smenq_next_sqb);
456 [ # # ]: 0 : nix_dump(file, "W8: head_sqb \t\t\t0x%" PRIx64 "", ctx->head_sqb);
457 : :
458 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_vld \t\t%d\nW9: vfi_lso_vlan1_ins_ena\t%d",
459 : : ctx->vfi_lso_vld, ctx->vfi_lso_vlan1_ins_ena);
460 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_vlan0_ins_ena\t%d\nW9: vfi_lso_mps\t\t\t%d",
461 : : ctx->vfi_lso_vlan0_ins_ena, ctx->vfi_lso_mps);
462 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_sb \t\t\t%d\nW9: vfi_lso_sizem1\t\t%d",
463 : : ctx->vfi_lso_sb, ctx->vfi_lso_sizem1);
464 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_total\t\t%d", ctx->vfi_lso_total);
465 : :
466 [ # # ]: 0 : nix_dump(file, "W10: scm_lso_rem \t\t0x%" PRIx64 "",
467 : : (uint64_t)ctx->scm_lso_rem);
468 [ # # ]: 0 : nix_dump(file, "W11: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
469 [ # # ]: 0 : nix_dump(file, "W12: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
470 [ # # ]: 0 : nix_dump(file, "W14: dropped_octs \t\t0x%" PRIx64 "",
471 : : (uint64_t)ctx->drop_octs);
472 [ # # ]: 0 : nix_dump(file, "W15: dropped_pkts \t\t0x%" PRIx64 "",
473 : : (uint64_t)ctx->drop_pkts);
474 : :
475 : 0 : *sqb_aura_p = ctx->sqb_aura;
476 : 0 : }
477 : :
478 : : static inline void
479 : 0 : nix_cn10k_lf_sq_dump(__io struct nix_cn10k_sq_ctx_s *ctx, uint32_t *sqb_aura_p, FILE *file)
480 : : {
481 [ # # ]: 0 : nix_dump(file, "W0: sqe_way_mask \t\t%d\nW0: cq \t\t\t\t%d",
482 : : ctx->sqe_way_mask, ctx->cq);
483 [ # # ]: 0 : nix_dump(file, "W0: sdp_mcast \t\t\t%d\nW0: substream \t\t\t0x%03x",
484 : : ctx->sdp_mcast, ctx->substream);
485 [ # # ]: 0 : nix_dump(file, "W0: qint_idx \t\t\t%d\nW0: ena \t\t\t%d\n", ctx->qint_idx,
486 : : ctx->ena);
487 : :
488 [ # # ]: 0 : nix_dump(file, "W1: sqb_count \t\t\t%d\nW1: default_chan \t\t%d",
489 : : ctx->sqb_count, ctx->default_chan);
490 [ # # ]: 0 : nix_dump(file, "W1: smq_rr_weight \t\t%d\nW1: sso_ena \t\t\t%d",
491 : : ctx->smq_rr_weight, ctx->sso_ena);
492 [ # # ]: 0 : nix_dump(file, "W1: xoff \t\t\t%d\nW1: cq_ena \t\t\t%d\nW1: smq\t\t\t\t%d\n",
493 : : ctx->xoff, ctx->cq_ena, ctx->smq);
494 : :
495 [ # # ]: 0 : nix_dump(file, "W2: sqe_stype \t\t\t%d\nW2: sq_int_ena \t\t\t%d",
496 : : ctx->sqe_stype, ctx->sq_int_ena);
497 [ # # ]: 0 : nix_dump(file, "W2: sq_int \t\t\t%d\nW2: sqb_aura \t\t\t%d", ctx->sq_int,
498 : : ctx->sqb_aura);
499 [ # # ]: 0 : nix_dump(file, "W2: smq_rr_count[ub:lb] \t\t%x:%x\n", ctx->smq_rr_count_ub,
500 : : ctx->smq_rr_count_lb);
501 : :
502 [ # # ]: 0 : nix_dump(file, "W3: smq_next_sq_vld\t\t%d\nW3: smq_pend\t\t\t%d",
503 : : ctx->smq_next_sq_vld, ctx->smq_pend);
504 [ # # ]: 0 : nix_dump(file, "W3: smenq_next_sqb_vld \t%d\nW3: head_offset\t\t\t%d",
505 : : ctx->smenq_next_sqb_vld, ctx->head_offset);
506 [ # # ]: 0 : nix_dump(file, "W3: smenq_offset\t\t%d\nW3: tail_offset \t\t%d",
507 : : ctx->smenq_offset, ctx->tail_offset);
508 [ # # ]: 0 : nix_dump(file, "W3: smq_lso_segnum \t\t%d\nW3: smq_next_sq \t\t%d",
509 : : ctx->smq_lso_segnum, ctx->smq_next_sq);
510 [ # # ]: 0 : nix_dump(file, "W3: mnq_dis \t\t\t%d\nW3: lmt_dis \t\t\t%d", ctx->mnq_dis,
511 : : ctx->lmt_dis);
512 [ # # ]: 0 : nix_dump(file, "W3: cq_limit\t\t\t%d\nW3: max_sqe_size\t\t%d\n",
513 : : ctx->cq_limit, ctx->max_sqe_size);
514 : :
515 [ # # ]: 0 : nix_dump(file, "W4: next_sqb \t\t\t0x%" PRIx64 "", ctx->next_sqb);
516 [ # # ]: 0 : nix_dump(file, "W5: tail_sqb \t\t\t0x%" PRIx64 "", ctx->tail_sqb);
517 [ # # ]: 0 : nix_dump(file, "W6: smenq_sqb \t\t\t0x%" PRIx64 "", ctx->smenq_sqb);
518 [ # # ]: 0 : nix_dump(file, "W7: smenq_next_sqb \t\t0x%" PRIx64 "", ctx->smenq_next_sqb);
519 [ # # ]: 0 : nix_dump(file, "W8: head_sqb \t\t\t0x%" PRIx64 "", ctx->head_sqb);
520 : :
521 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_vld \t\t%d\nW9: vfi_lso_vlan1_ins_ena\t%d", ctx->vfi_lso_vld,
522 : : ctx->vfi_lso_vlan1_ins_ena);
523 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_vlan0_ins_ena\t%d\nW9: vfi_lso_mps\t\t\t%d",
524 : : ctx->vfi_lso_vlan0_ins_ena, ctx->vfi_lso_mps);
525 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_sb \t\t\t%d\nW9: vfi_lso_sizem1\t\t%d", ctx->vfi_lso_sb,
526 : : ctx->vfi_lso_sizem1);
527 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_total\t\t%d", ctx->vfi_lso_total);
528 : :
529 [ # # ]: 0 : nix_dump(file, "W10: scm_lso_rem \t\t0x%" PRIx64 "", (uint64_t)ctx->scm_lso_rem);
530 [ # # ]: 0 : nix_dump(file, "W11: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
531 [ # # ]: 0 : nix_dump(file, "W12: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
532 [ # # ]: 0 : nix_dump(file, "W13: aged_drop_pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->aged_drop_pkts);
533 [ # # ]: 0 : nix_dump(file, "W13: aged_drop_octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->aged_drop_octs);
534 [ # # ]: 0 : nix_dump(file, "W14: dropped_octs \t\t0x%" PRIx64 "", (uint64_t)ctx->drop_octs);
535 [ # # ]: 0 : nix_dump(file, "W15: dropped_pkts \t\t0x%" PRIx64 "", (uint64_t)ctx->drop_pkts);
536 : :
537 : 0 : *sqb_aura_p = ctx->sqb_aura;
538 : 0 : }
539 : :
540 : : static inline void
541 : 0 : nix_lf_sq_dump(__io struct nix_cn20k_sq_ctx_s *ctx, uint32_t *sqb_aura_p, FILE *file)
542 : : {
543 : : int64_t *sq_cnt_ptr = NULL;
544 : :
545 [ # # ]: 0 : nix_dump(file, "W0: sqe_way_mask \t\t%d\nW0: cq \t\t\t\t%d",
546 : : ctx->sqe_way_mask, ctx->cq);
547 [ # # ]: 0 : nix_dump(file, "W0: sdp_mcast \t\t\t%d\nW0: substream \t\t\t0x%03x",
548 : : ctx->sdp_mcast, ctx->substream);
549 [ # # ]: 0 : nix_dump(file, "W0: qint_idx \t\t\t%d\nW0: ena \t\t\t%d\n", ctx->qint_idx,
550 : : ctx->ena);
551 : :
552 [ # # ]: 0 : nix_dump(file, "W1: sqb_count \t\t\t%d\nW1: default_chan \t\t%d",
553 : : ctx->sqb_count, ctx->default_chan);
554 [ # # ]: 0 : nix_dump(file, "W1: smq_rr_weight \t\t%d\nW1: sso_ena \t\t\t%d",
555 : : ctx->smq_rr_weight, ctx->sso_ena);
556 [ # # ]: 0 : nix_dump(file, "W1: xoff \t\t\t%d\nW1: cq_ena \t\t\t%d\nW1: smq\t\t\t\t%d\n",
557 : : ctx->xoff, ctx->cq_ena, ctx->smq);
558 : :
559 [ # # ]: 0 : nix_dump(file, "W2: sqe_stype \t\t\t%d\nW2: sq_int_ena \t\t\t%d",
560 : : ctx->sqe_stype, ctx->sq_int_ena);
561 [ # # ]: 0 : nix_dump(file, "W2: sq_int \t\t\t%d\nW2: sqb_aura \t\t\t%d", ctx->sq_int,
562 : : ctx->sqb_aura);
563 [ # # ]: 0 : nix_dump(file, "W2: smq_rr_count[ub:lb] \t\t%x:%x\n", ctx->smq_rr_count_ub,
564 : : ctx->smq_rr_count_lb);
565 : :
566 [ # # ]: 0 : nix_dump(file, "W3: update_sq_count\t\t%d\n", ctx->update_sq_count);
567 [ # # ]: 0 : nix_dump(file, "W3: smq_next_sq_vld\t\t%d\nW3: smq_pend\t\t\t%d",
568 : : ctx->smq_next_sq_vld, ctx->smq_pend);
569 [ # # ]: 0 : nix_dump(file, "W3: smenq_next_sqb_vld \t%d\nW3: head_offset\t\t\t%d",
570 : : ctx->smenq_next_sqb_vld, ctx->head_offset);
571 [ # # ]: 0 : nix_dump(file, "W3: smenq_offset\t\t%d\nW3: tail_offset \t\t%d",
572 : : ctx->smenq_offset, ctx->tail_offset);
573 [ # # ]: 0 : nix_dump(file, "W3: smq_lso_segnum \t\t%d\nW3: smq_next_sq \t\t%d",
574 : : ctx->smq_lso_segnum, ctx->smq_next_sq);
575 [ # # ]: 0 : nix_dump(file, "W3: mnq_dis \t\t\t%d\nW3: lmt_dis \t\t\t%d", ctx->mnq_dis,
576 : : ctx->lmt_dis);
577 [ # # ]: 0 : nix_dump(file, "W3: cq_limit\t\t\t%d\nW3: max_sqe_size\t\t%d\n",
578 : : ctx->cq_limit, ctx->max_sqe_size);
579 : :
580 [ # # ]: 0 : nix_dump(file, "W4: next_sqb \t\t\t0x%" PRIx64 "", ctx->next_sqb);
581 [ # # ]: 0 : nix_dump(file, "W5: tail_sqb \t\t\t0x%" PRIx64 "", ctx->tail_sqb);
582 [ # # ]: 0 : nix_dump(file, "W6: smenq_sqb \t\t\t0x%" PRIx64 "", ctx->smenq_sqb);
583 [ # # ]: 0 : nix_dump(file, "W7: smenq_next_sqb \t\t0x%" PRIx64 "", ctx->smenq_next_sqb);
584 [ # # ]: 0 : nix_dump(file, "W8: head_sqb \t\t\t0x%" PRIx64 "", ctx->head_sqb);
585 : :
586 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_vld \t\t%d\nW9: vfi_lso_vlan1_ins_ena\t%d", ctx->vfi_lso_vld,
587 : : ctx->vfi_lso_vlan1_ins_ena);
588 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_vlan0_ins_ena\t%d\nW9: vfi_lso_mps\t\t\t%d",
589 : : ctx->vfi_lso_vlan0_ins_ena, ctx->vfi_lso_mps);
590 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_sb \t\t\t%d\nW9: vfi_lso_sizem1\t\t%d", ctx->vfi_lso_sb,
591 : : ctx->vfi_lso_sizem1);
592 [ # # ]: 0 : nix_dump(file, "W9: vfi_lso_total\t\t%d", ctx->vfi_lso_total);
593 : :
594 [ # # ]: 0 : nix_dump(file, "W10: sq_count_iova \t\t0x%" PRIx64 "", (uint64_t)ctx->sq_count_iova);
595 : 0 : sq_cnt_ptr = (int64_t *)(uintptr_t)(ctx->sq_count_iova << 3);
596 [ # # # # ]: 0 : if (sq_cnt_ptr && ctx->update_sq_count)
597 [ # # ]: 0 : nix_dump(file, "sq_count value \t\t0x%" PRIx64 "",
598 : : plt_atomic_load_explicit((uint64_t __plt_atomic *)sq_cnt_ptr,
599 : : plt_memory_order_relaxed));
600 [ # # ]: 0 : nix_dump(file, "W10: scm_lso_rem \t\t0x%" PRIx64 "", (uint64_t)ctx->scm_lso_rem);
601 [ # # ]: 0 : nix_dump(file, "W11: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
602 [ # # ]: 0 : nix_dump(file, "W12: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
603 [ # # ]: 0 : nix_dump(file, "W13: aged_drop_pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->aged_drop_pkts);
604 [ # # ]: 0 : nix_dump(file, "W13: aged_drop_octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->aged_drop_octs);
605 [ # # ]: 0 : nix_dump(file, "W14: dropped_octs \t\t0x%" PRIx64 "", (uint64_t)ctx->drop_octs);
606 [ # # ]: 0 : nix_dump(file, "W15: dropped_pkts \t\t0x%" PRIx64 "", (uint64_t)ctx->drop_pkts);
607 : :
608 : 0 : *sqb_aura_p = ctx->sqb_aura;
609 : 0 : }
610 : :
611 : : static inline void
612 : 0 : nix_cn9k_lf_rq_dump(__io struct nix_rq_ctx_s *ctx, FILE *file)
613 : : {
614 [ # # ]: 0 : nix_dump(file, "W0: wqe_aura \t\t\t%d\nW0: substream \t\t\t0x%03x",
615 : : ctx->wqe_aura, ctx->substream);
616 [ # # ]: 0 : nix_dump(file, "W0: cq \t\t\t\t%d\nW0: ena_wqwd \t\t\t%d", ctx->cq,
617 : : ctx->ena_wqwd);
618 [ # # ]: 0 : nix_dump(file, "W0: ipsech_ena \t\t\t%d\nW0: sso_ena \t\t\t%d",
619 : : ctx->ipsech_ena, ctx->sso_ena);
620 [ # # ]: 0 : nix_dump(file, "W0: ena \t\t\t%d\n", ctx->ena);
621 : :
622 [ # # ]: 0 : nix_dump(file, "W1: lpb_drop_ena \t\t%d\nW1: spb_drop_ena \t\t%d",
623 : : ctx->lpb_drop_ena, ctx->spb_drop_ena);
624 [ # # ]: 0 : nix_dump(file, "W1: xqe_drop_ena \t\t%d\nW1: wqe_caching \t\t%d",
625 : : ctx->xqe_drop_ena, ctx->wqe_caching);
626 [ # # ]: 0 : nix_dump(file, "W1: pb_caching \t\t\t%d\nW1: sso_tt \t\t\t%d",
627 : : ctx->pb_caching, ctx->sso_tt);
628 [ # # ]: 0 : nix_dump(file, "W1: sso_grp \t\t\t%d\nW1: lpb_aura \t\t\t%d", ctx->sso_grp,
629 : : ctx->lpb_aura);
630 [ # # ]: 0 : nix_dump(file, "W1: spb_aura \t\t\t%d\n", ctx->spb_aura);
631 : :
632 [ # # ]: 0 : nix_dump(file, "W2: xqe_hdr_split \t\t%d\nW2: xqe_imm_copy \t\t%d",
633 : : ctx->xqe_hdr_split, ctx->xqe_imm_copy);
634 [ # # ]: 0 : nix_dump(file, "W2: xqe_imm_size \t\t%d\nW2: later_skip \t\t\t%d",
635 : : ctx->xqe_imm_size, ctx->later_skip);
636 [ # # ]: 0 : nix_dump(file, "W2: first_skip \t\t\t%d\nW2: lpb_sizem1 \t\t\t%d",
637 : : ctx->first_skip, ctx->lpb_sizem1);
638 [ # # ]: 0 : nix_dump(file, "W2: spb_ena \t\t\t%d\nW2: wqe_skip \t\t\t%d", ctx->spb_ena,
639 : : ctx->wqe_skip);
640 [ # # ]: 0 : nix_dump(file, "W2: spb_sizem1 \t\t\t%d\n", ctx->spb_sizem1);
641 : :
642 [ # # ]: 0 : nix_dump(file, "W3: spb_pool_pass \t\t%d\nW3: spb_pool_drop \t\t%d",
643 : : ctx->spb_pool_pass, ctx->spb_pool_drop);
644 [ # # ]: 0 : nix_dump(file, "W3: spb_aura_pass \t\t%d\nW3: spb_aura_drop \t\t%d",
645 : : ctx->spb_aura_pass, ctx->spb_aura_drop);
646 [ # # ]: 0 : nix_dump(file, "W3: wqe_pool_pass \t\t%d\nW3: wqe_pool_drop \t\t%d",
647 : : ctx->wqe_pool_pass, ctx->wqe_pool_drop);
648 [ # # ]: 0 : nix_dump(file, "W3: xqe_pass \t\t\t%d\nW3: xqe_drop \t\t\t%d\n",
649 : : ctx->xqe_pass, ctx->xqe_drop);
650 : :
651 [ # # ]: 0 : nix_dump(file, "W4: qint_idx \t\t\t%d\nW4: rq_int_ena \t\t\t%d",
652 : : ctx->qint_idx, ctx->rq_int_ena);
653 [ # # ]: 0 : nix_dump(file, "W4: rq_int \t\t\t%d\nW4: lpb_pool_pass \t\t%d", ctx->rq_int,
654 : : ctx->lpb_pool_pass);
655 [ # # ]: 0 : nix_dump(file, "W4: lpb_pool_drop \t\t%d\nW4: lpb_aura_pass \t\t%d",
656 : : ctx->lpb_pool_drop, ctx->lpb_aura_pass);
657 [ # # ]: 0 : nix_dump(file, "W4: lpb_aura_drop \t\t%d\n", ctx->lpb_aura_drop);
658 : :
659 [ # # ]: 0 : nix_dump(file, "W5: flow_tagw \t\t\t%d\nW5: bad_utag \t\t\t%d",
660 : : ctx->flow_tagw, ctx->bad_utag);
661 [ # # ]: 0 : nix_dump(file, "W5: good_utag \t\t\t%d\nW5: ltag \t\t\t%d\n", ctx->good_utag,
662 : : ctx->ltag);
663 : :
664 [ # # ]: 0 : nix_dump(file, "W6: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
665 [ # # ]: 0 : nix_dump(file, "W7: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
666 [ # # ]: 0 : nix_dump(file, "W8: drop_octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_octs);
667 [ # # ]: 0 : nix_dump(file, "W9: drop_pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_pkts);
668 [ # # ]: 0 : nix_dump(file, "W10: re_pkts \t\t\t0x%" PRIx64 "\n", (uint64_t)ctx->re_pkts);
669 : 0 : }
670 : :
671 : : void
672 : 0 : nix_cn10k_lf_rq_dump(__io struct nix_cn10k_rq_ctx_s *ctx, FILE *file)
673 : : {
674 [ # # ]: 0 : nix_dump(file, "W0: wqe_aura \t\t\t%d\nW0: len_ol3_dis \t\t\t%d",
675 : : ctx->wqe_aura, ctx->len_ol3_dis);
676 [ # # ]: 0 : nix_dump(file, "W0: len_ol4_dis \t\t\t%d\nW0: len_il3_dis \t\t\t%d",
677 : : ctx->len_ol4_dis, ctx->len_il3_dis);
678 [ # # ]: 0 : nix_dump(file, "W0: len_il4_dis \t\t\t%d\nW0: csum_ol4_dis \t\t\t%d",
679 : : ctx->len_il4_dis, ctx->csum_ol4_dis);
680 [ # # ]: 0 : nix_dump(file, "W0: csum_ol3_dis \t\t\t%d\nW0: lenerr_dis \t\t\t%d",
681 : : ctx->csum_ol4_dis, ctx->lenerr_dis);
682 [ # # ]: 0 : nix_dump(file, "W0: cq \t\t\t\t%d\nW0: ena_wqwd \t\t\t%d", ctx->cq,
683 : : ctx->ena_wqwd);
684 [ # # ]: 0 : nix_dump(file, "W0: ipsech_ena \t\t\t%d\nW0: sso_ena \t\t\t%d",
685 : : ctx->ipsech_ena, ctx->sso_ena);
686 [ # # ]: 0 : nix_dump(file, "W0: ena \t\t\t%d\n", ctx->ena);
687 : :
688 [ # # ]: 0 : nix_dump(file, "W1: chi_ena \t\t%d\nW1: ipsecd_drop_en \t\t%d", ctx->chi_ena,
689 : : ctx->ipsecd_drop_en);
690 [ # # ]: 0 : nix_dump(file, "W1: pb_stashing \t\t\t%d", ctx->pb_stashing);
691 [ # # ]: 0 : nix_dump(file, "W1: lpb_drop_ena \t\t%d\nW1: spb_drop_ena \t\t%d",
692 : : ctx->lpb_drop_ena, ctx->spb_drop_ena);
693 [ # # ]: 0 : nix_dump(file, "W1: xqe_drop_ena \t\t%d\nW1: wqe_caching \t\t%d",
694 : : ctx->xqe_drop_ena, ctx->wqe_caching);
695 [ # # ]: 0 : nix_dump(file, "W1: pb_caching \t\t\t%d\nW1: sso_tt \t\t\t%d",
696 : : ctx->pb_caching, ctx->sso_tt);
697 [ # # ]: 0 : nix_dump(file, "W1: sso_grp \t\t\t%d\nW1: lpb_aura \t\t\t%d", ctx->sso_grp,
698 : : ctx->lpb_aura);
699 [ # # ]: 0 : nix_dump(file, "W1: spb_aura \t\t\t%d\n", ctx->spb_aura);
700 : :
701 [ # # ]: 0 : nix_dump(file, "W2: xqe_hdr_split \t\t%d\nW2: xqe_imm_copy \t\t%d",
702 : : ctx->xqe_hdr_split, ctx->xqe_imm_copy);
703 [ # # ]: 0 : nix_dump(file, "W2: xqe_imm_size \t\t%d\nW2: later_skip \t\t\t%d",
704 : : ctx->xqe_imm_size, ctx->later_skip);
705 [ # # ]: 0 : nix_dump(file, "W2: first_skip \t\t\t%d\nW2: lpb_sizem1 \t\t\t%d",
706 : : ctx->first_skip, ctx->lpb_sizem1);
707 [ # # ]: 0 : nix_dump(file, "W2: spb_ena \t\t\t%d\nW2: wqe_skip \t\t\t%d", ctx->spb_ena,
708 : : ctx->wqe_skip);
709 [ # # ]: 0 : nix_dump(file, "W2: spb_sizem1 \t\t\t%d\nW2: policer_ena \t\t\t%d",
710 : : ctx->spb_sizem1, ctx->policer_ena);
711 [ # # ]: 0 : nix_dump(file, "W2: band_prof_id \t\t\t%d", ctx->band_prof_id);
712 : :
713 [ # # ]: 0 : nix_dump(file, "W3: spb_pool_pass \t\t%d\nW3: spb_pool_drop \t\t%d",
714 : : ctx->spb_pool_pass, ctx->spb_pool_drop);
715 [ # # ]: 0 : nix_dump(file, "W3: spb_aura_pass \t\t%d\nW3: spb_aura_drop \t\t%d",
716 : : ctx->spb_aura_pass, ctx->spb_aura_drop);
717 [ # # ]: 0 : nix_dump(file, "W3: wqe_pool_pass \t\t%d\nW3: wqe_pool_drop \t\t%d",
718 : : ctx->wqe_pool_pass, ctx->wqe_pool_drop);
719 [ # # ]: 0 : nix_dump(file, "W3: xqe_pass \t\t\t%d\nW3: xqe_drop \t\t\t%d\n",
720 : : ctx->xqe_pass, ctx->xqe_drop);
721 : :
722 [ # # ]: 0 : nix_dump(file, "W4: qint_idx \t\t\t%d\nW4: rq_int_ena \t\t\t%d",
723 : : ctx->qint_idx, ctx->rq_int_ena);
724 [ # # ]: 0 : nix_dump(file, "W4: rq_int \t\t\t%d\nW4: lpb_pool_pass \t\t%d", ctx->rq_int,
725 : : ctx->lpb_pool_pass);
726 [ # # ]: 0 : nix_dump(file, "W4: lpb_pool_drop \t\t%d\nW4: lpb_aura_pass \t\t%d",
727 : : ctx->lpb_pool_drop, ctx->lpb_aura_pass);
728 [ # # ]: 0 : nix_dump(file, "W4: lpb_aura_drop \t\t%d\n", ctx->lpb_aura_drop);
729 : :
730 [ # # ]: 0 : nix_dump(file, "W5: vwqe_skip \t\t\t%d\nW5: max_vsize_exp \t\t\t%d",
731 : : ctx->vwqe_skip, ctx->max_vsize_exp);
732 [ # # ]: 0 : nix_dump(file, "W5: vtime_wait \t\t\t%d\nW5: vwqe_ena \t\t\t%d",
733 : : ctx->vtime_wait, ctx->max_vsize_exp);
734 [ # # ]: 0 : nix_dump(file, "W5: ipsec_vwqe \t\t\t%d", ctx->ipsec_vwqe);
735 [ # # ]: 0 : nix_dump(file, "W5: flow_tagw \t\t\t%d\nW5: bad_utag \t\t\t%d",
736 : : ctx->flow_tagw, ctx->bad_utag);
737 [ # # ]: 0 : nix_dump(file, "W5: good_utag \t\t\t%d\nW5: ltag \t\t\t%d\n", ctx->good_utag,
738 : : ctx->ltag);
739 : :
740 [ # # ]: 0 : nix_dump(file, "W6: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
741 [ # # ]: 0 : nix_dump(file, "W7: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
742 [ # # ]: 0 : nix_dump(file, "W8: drop_octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_octs);
743 [ # # ]: 0 : nix_dump(file, "W9: drop_pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_pkts);
744 [ # # ]: 0 : nix_dump(file, "W10: re_pkts \t\t\t0x%" PRIx64 "\n", (uint64_t)ctx->re_pkts);
745 : 0 : }
746 : :
747 : : void
748 : 0 : nix_lf_rq_dump(__io struct nix_cn20k_rq_ctx_s *ctx, FILE *file)
749 : : {
750 [ # # ]: 0 : nix_dump(file, "W0: wqe_aura \t\t\t%d\nW0: len_ol3_dis \t\t\t%d",
751 : : ctx->wqe_aura, ctx->len_ol3_dis);
752 [ # # ]: 0 : nix_dump(file, "W0: len_ol4_dis \t\t\t%d\nW0: len_il3_dis \t\t\t%d",
753 : : ctx->len_ol4_dis, ctx->len_il3_dis);
754 [ # # ]: 0 : nix_dump(file, "W0: len_il4_dis \t\t\t%d\nW0: csum_ol4_dis \t\t\t%d",
755 : : ctx->len_il4_dis, ctx->csum_ol4_dis);
756 [ # # ]: 0 : nix_dump(file, "W0: csum_il4_dis \t\t\t%d\nW0: lenerr_dis \t\t\t%d",
757 : : ctx->csum_il4_dis, ctx->lenerr_dis);
758 [ # # ]: 0 : nix_dump(file, "W0: port_ol4_dis \t\t\t%d\nW0: port_il4_dis\t\t\t%d",
759 : : ctx->port_ol4_dis, ctx->port_il4_dis);
760 [ # # ]: 0 : nix_dump(file, "W0: cq \t\t\t\t%d\nW0: ena_wqwd \t\t\t%d", ctx->cq,
761 : : ctx->ena_wqwd);
762 [ # # ]: 0 : nix_dump(file, "W0: ipsech_ena \t\t\t%d\nW0: sso_ena \t\t\t%d",
763 : : ctx->ipsech_ena, ctx->sso_ena);
764 [ # # ]: 0 : nix_dump(file, "W0: ena \t\t\t%d\n", ctx->ena);
765 : :
766 [ # # ]: 0 : nix_dump(file, "W1: chi_ena \t\t%d\nW1: ipsecd_drop_en \t\t%d", ctx->chi_ena,
767 : : ctx->ipsecd_drop_en);
768 [ # # ]: 0 : nix_dump(file, "W1: pb_stashing \t\t\t%d", ctx->pb_stashing);
769 [ # # ]: 0 : nix_dump(file, "W1: lpb_drop_ena \t\t%d\nW1: spb_drop_ena \t\t%d",
770 : : ctx->lpb_drop_ena, ctx->spb_drop_ena);
771 [ # # ]: 0 : nix_dump(file, "W1: xqe_drop_ena \t\t%d\nW1: wqe_caching \t\t%d",
772 : : ctx->xqe_drop_ena, ctx->wqe_caching);
773 [ # # ]: 0 : nix_dump(file, "W1: pb_caching \t\t\t%d\nW1: sso_tt \t\t\t%d",
774 : : ctx->pb_caching, ctx->sso_tt);
775 [ # # ]: 0 : nix_dump(file, "W1: sso_grp \t\t\t%d\nW1: lpb_aura \t\t\t%d", ctx->sso_grp,
776 : : ctx->lpb_aura);
777 [ # # ]: 0 : nix_dump(file, "W1: spb_aura \t\t\t%d\n", ctx->spb_aura);
778 : :
779 [ # # ]: 0 : nix_dump(file, "W2: xqe_hdr_split \t\t%d\nW2: xqe_imm_copy \t\t%d",
780 : : ctx->xqe_hdr_split, ctx->xqe_imm_copy);
781 [ # # ]: 0 : nix_dump(file, "W2: band_prof_id\t\t0x%" PRIx64 "\n",
782 : : (uint64_t)((ctx->band_prof_id_h << 10) | ctx->band_prof_id_l));
783 [ # # ]: 0 : nix_dump(file, "W2: xqe_imm_size \t\t%d\nW2: later_skip \t\t\t%d",
784 : : ctx->xqe_imm_size, ctx->later_skip);
785 [ # # ]: 0 : nix_dump(file, "W2: sso_bp_ena\t\t%d\n", ctx->sso_bp_ena);
786 [ # # ]: 0 : nix_dump(file, "W2: first_skip \t\t\t%d\nW2: lpb_sizem1 \t\t\t%d",
787 : : ctx->first_skip, ctx->lpb_sizem1);
788 [ # # ]: 0 : nix_dump(file, "W2: spb_ena \t\t\t%d\nW2: spb_high_sizem1 \t\t\t%d", ctx->spb_ena,
789 : : ctx->spb_high_sizem1);
790 [ # # ]: 0 : nix_dump(file, "W2: wqe_skip \t\t\t%d", ctx->wqe_skip);
791 [ # # ]: 0 : nix_dump(file, "W2: spb_sizem1 \t\t\t%d\nW2: policer_ena \t\t\t%d",
792 : : ctx->spb_sizem1, ctx->policer_ena);
793 [ # # ]: 0 : nix_dump(file, "W2: sso_fc_ena \t\t\t%d\n", ctx->sso_fc_ena);
794 : :
795 [ # # ]: 0 : nix_dump(file, "W3: spb_pool_pass \t\t%d\nW3: spb_pool_drop \t\t%d",
796 : : ctx->spb_pool_pass, ctx->spb_pool_drop);
797 [ # # ]: 0 : nix_dump(file, "W3: spb_aura_pass \t\t%d\nW3: spb_aura_drop \t\t%d",
798 : : ctx->spb_aura_pass, ctx->spb_aura_drop);
799 [ # # ]: 0 : nix_dump(file, "W3: wqe_pool_pass \t\t%d\nW3: wqe_pool_drop \t\t%d",
800 : : ctx->wqe_pool_pass, ctx->wqe_pool_drop);
801 [ # # ]: 0 : nix_dump(file, "W3: xqe_pass \t\t\t%d\nW3: xqe_drop \t\t\t%d\n",
802 : : ctx->xqe_pass, ctx->xqe_drop);
803 : :
804 [ # # ]: 0 : nix_dump(file, "W4: qint_idx \t\t\t%d\nW4: rq_int_ena \t\t\t%d",
805 : : ctx->qint_idx, ctx->rq_int_ena);
806 [ # # ]: 0 : nix_dump(file, "W4: rq_int \t\t\t%d\nW4: lpb_pool_pass \t\t%d", ctx->rq_int,
807 : : ctx->lpb_pool_pass);
808 [ # # ]: 0 : nix_dump(file, "W4: lpb_pool_drop \t\t%d\nW4: lpb_aura_pass \t\t%d",
809 : : ctx->lpb_pool_drop, ctx->lpb_aura_pass);
810 [ # # ]: 0 : nix_dump(file, "W4: lpb_aura_drop \t\t%d\n", ctx->lpb_aura_drop);
811 : :
812 [ # # ]: 0 : nix_dump(file, "W5: flow_tagw \t\t\t%d\nW5: bad_utag \t\t\t%d",
813 : : ctx->flow_tagw, ctx->bad_utag);
814 [ # # ]: 0 : nix_dump(file, "W5: good_utag \t\t\t%d\nW5: ltag \t\t\t%d\n", ctx->good_utag,
815 : : ctx->ltag);
816 : :
817 [ # # ]: 0 : nix_dump(file, "W6: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
818 [ # # ]: 0 : nix_dump(file, "W7: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
819 [ # # ]: 0 : nix_dump(file, "W8: drop_octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_octs);
820 [ # # ]: 0 : nix_dump(file, "W9: drop_pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_pkts);
821 [ # # ]: 0 : nix_dump(file, "W10: re_pkts \t\t\t0x%" PRIx64 "\n", (uint64_t)ctx->re_pkts);
822 : 0 : }
823 : :
824 : : static inline void
825 : 0 : nix_cn20k_lf_cq_dump(__io struct nix_cn20k_cq_ctx_s *ctx, FILE *file)
826 : : {
827 [ # # ]: 0 : nix_dump(file, "W0: base \t\t\t0x%" PRIx64 "\n", ctx->base);
828 : :
829 [ # # ]: 0 : nix_dump(file, "W1: wrptr \t\t\t%" PRIx64 "", (uint64_t)ctx->wrptr);
830 [ # # ]: 0 : nix_dump(file, "W1: avg_con \t\t\t%d\nW1: cint_idx \t\t\t%d", ctx->avg_con,
831 : : ctx->cint_idx);
832 [ # # ]: 0 : nix_dump(file, "W1: cq_err \t\t\t%d\nW1: qint_idx \t\t\t%d", ctx->cq_err,
833 : : ctx->qint_idx);
834 [ # # ]: 0 : nix_dump(file, "W1: bpid \t\t\t%d\nW1: bp_ena \t\t\t%d\n", ctx->bpid,
835 : : ctx->bp_ena);
836 [ # # ]: 0 : nix_dump(file,
837 : : "W1: lbpid_high \t\t\t0x%03x\nW1: lbpid_med \t\t\t0x%03x\n"
838 : : "W1: lbpid_low \t\t\t0x%03x\n(W1: lbpid) \t\t\t0x%03x\n",
839 : : ctx->lbpid_high, ctx->lbpid_med, ctx->lbpid_low, (unsigned int)
840 : : (ctx->lbpid_high << 6 | ctx->lbpid_med << 3 | ctx->lbpid_low));
841 [ # # ]: 0 : nix_dump(file, "W1: lbp_ena \t\t\t\t%d\n", ctx->lbp_ena);
842 : :
843 [ # # ]: 0 : nix_dump(file, "W2: update_time \t\t%d\nW2: avg_level \t\t\t%d",
844 : : ctx->update_time, ctx->avg_level);
845 [ # # ]: 0 : nix_dump(file, "W2: head \t\t\t%d\nW2: tail \t\t\t%d\n", ctx->head,
846 : : ctx->tail);
847 : :
848 [ # # ]: 0 : nix_dump(file, "W3: cq_err_int_ena \t\t%d\nW3: cq_err_int \t\t\t%d",
849 : : ctx->cq_err_int_ena, ctx->cq_err_int);
850 [ # # ]: 0 : nix_dump(file, "W3: qsize \t\t\t%d\nW3: stashing \t\t\t%d", ctx->qsize,
851 : : ctx->stashing);
852 [ # # ]: 0 : nix_dump(file, "W3: caching \t\t\t%d\nW3: lbp_frac \t\t\t%d", ctx->caching, ctx->lbp_frac);
853 [ # # ]: 0 : nix_dump(file, "W3: stash_thresh \t\t\t%d\nW3: msh_valid\t\t\t%d", ctx->stash_thresh,
854 : : ctx->msh_valid);
855 [ # # ]: 0 : nix_dump(file, "W3: msh_dst \t\t\t0x%03x\nW3: cpt_drop_err_en \t\t\t%d\n",
856 : : ctx->msh_dst, ctx->cpt_drop_err_en);
857 [ # # ]: 0 : nix_dump(file, "W3: ena \t\t\t%d\n", ctx->ena);
858 [ # # ]: 0 : nix_dump(file, "W3: drop_ena \t\t\t%d\nW3: drop \t\t\t%d", ctx->drop_ena,
859 : : ctx->drop);
860 [ # # ]: 0 : nix_dump(file, "W3: bp \t\t\t\t%d\n", ctx->bp);
861 [ # # ]: 0 : nix_dump(file, "W4: lbpid_ext \t\t\t%d\nW3: bpid_ext \t\t\t%d", ctx->lbpid_ext,
862 : : ctx->bpid_ext);
863 : 0 : }
864 : :
865 : : static inline void
866 : 0 : nix_lf_cq_dump(__io struct nix_cq_ctx_s *ctx, FILE *file)
867 : : {
868 [ # # ]: 0 : nix_dump(file, "W0: base \t\t\t0x%" PRIx64 "\n", ctx->base);
869 : :
870 [ # # ]: 0 : nix_dump(file, "W1: wrptr \t\t\t%" PRIx64 "", (uint64_t)ctx->wrptr);
871 [ # # ]: 0 : nix_dump(file, "W1: avg_con \t\t\t%d\nW1: cint_idx \t\t\t%d", ctx->avg_con,
872 : : ctx->cint_idx);
873 [ # # ]: 0 : nix_dump(file, "W1: cq_err \t\t\t%d\nW1: qint_idx \t\t\t%d", ctx->cq_err,
874 : : ctx->qint_idx);
875 [ # # ]: 0 : nix_dump(file, "W1: bpid \t\t\t%d\nW1: bp_ena \t\t\t%d\n", ctx->bpid,
876 : : ctx->bp_ena);
877 [ # # ]: 0 : nix_dump(file,
878 : : "W1: lbpid_high \t\t\t0x%03x\nW1: lbpid_med \t\t\t0x%03x\n"
879 : : "W1: lbpid_low \t\t\t0x%03x\n(W1: lbpid) \t\t\t0x%03x\n",
880 : : ctx->lbpid_high, ctx->lbpid_med, ctx->lbpid_low, (unsigned int)
881 : : (ctx->lbpid_high << 6 | ctx->lbpid_med << 3 | ctx->lbpid_low));
882 [ # # ]: 0 : nix_dump(file, "W1: lbp_ena \t\t\t\t%d\n", ctx->lbp_ena);
883 : :
884 [ # # ]: 0 : nix_dump(file, "W2: update_time \t\t%d\nW2: avg_level \t\t\t%d",
885 : : ctx->update_time, ctx->avg_level);
886 [ # # ]: 0 : nix_dump(file, "W2: head \t\t\t%d\nW2: tail \t\t\t%d\n", ctx->head,
887 : : ctx->tail);
888 : :
889 [ # # ]: 0 : nix_dump(file, "W3: cq_err_int_ena \t\t%d\nW3: cq_err_int \t\t\t%d",
890 : : ctx->cq_err_int_ena, ctx->cq_err_int);
891 [ # # ]: 0 : nix_dump(file, "W3: qsize \t\t\t%d\nW3: caching \t\t\t%d", ctx->qsize,
892 : : ctx->caching);
893 [ # # ]: 0 : nix_dump(file, "W3: lbp_frac \t\t\t%d\n", ctx->lbp_frac);
894 [ # # ]: 0 : nix_dump(file, "W3: substream \t\t\t0x%03x\nW3: cpt_drop_err_en \t\t\t%d\n",
895 : : ctx->substream, ctx->cpt_drop_err_en);
896 [ # # ]: 0 : nix_dump(file, "W3: ena \t\t\t%d\n", ctx->ena);
897 [ # # ]: 0 : nix_dump(file, "W3: drop_ena \t\t\t%d\nW3: drop \t\t\t%d", ctx->drop_ena,
898 : : ctx->drop);
899 [ # # ]: 0 : nix_dump(file, "W3: bp \t\t\t\t%d\n", ctx->bp);
900 : 0 : }
901 : :
902 : : int
903 : 0 : roc_nix_queues_ctx_dump(struct roc_nix *roc_nix, FILE *file)
904 : : {
905 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
906 : : struct npa_cn20k_aq_enq_req *npa_aq_cn20k;
907 : 0 : int rc = -1, q, rq = nix->nb_rx_queues;
908 : : struct npa_aq_enq_rsp *npa_rsp;
909 : : struct npa_aq_enq_req *npa_aq;
910 : 0 : struct dev *dev = &nix->dev;
911 : 0 : int sq = nix->nb_tx_queues;
912 : : struct roc_nix_rq *inl_rq;
913 : : struct npa_lf *npa_lf;
914 : : volatile void *ctx;
915 : : uint32_t sqb_aura;
916 : :
917 : 0 : npa_lf = idev_npa_obj_get();
918 [ # # ]: 0 : if (npa_lf == NULL)
919 : : return NPA_ERR_DEVICE_NOT_BOUNDED;
920 : :
921 [ # # ]: 0 : for (q = 0; q < rq; q++) {
922 : 0 : rc = nix_q_ctx_get(dev, NIX_AQ_CTYPE_CQ, q, &ctx);
923 [ # # ]: 0 : if (rc) {
924 : 0 : plt_err("Failed to get cq context");
925 : 0 : goto fail;
926 : : }
927 [ # # ]: 0 : nix_dump(file, "============== port=%d cq=%d ===============",
928 : : roc_nix->port_id, q);
929 [ # # ]: 0 : if (roc_model_is_cn20k())
930 : 0 : nix_cn20k_lf_cq_dump(ctx, file);
931 : : else
932 : 0 : nix_lf_cq_dump(ctx, file);
933 : : }
934 : :
935 [ # # ]: 0 : for (q = 0; q < rq; q++) {
936 : 0 : rc = nix_q_ctx_get(dev, NIX_AQ_CTYPE_RQ, q, &ctx);
937 [ # # ]: 0 : if (rc) {
938 : 0 : plt_err("Failed to get rq context");
939 : 0 : goto fail;
940 : : }
941 [ # # ]: 0 : nix_dump(file, "============== port=%d rq=%d ===============",
942 : : roc_nix->port_id, q);
943 [ # # ]: 0 : if (roc_model_is_cn9k())
944 : 0 : nix_cn9k_lf_rq_dump(ctx, file);
945 [ # # ]: 0 : else if (roc_model_is_cn10k())
946 : 0 : nix_cn10k_lf_rq_dump(ctx, file);
947 : : else
948 : 0 : nix_lf_rq_dump(ctx, file);
949 : : }
950 : :
951 : : /* Dump inline dev RQ for this port */
952 : 0 : inl_rq = roc_nix_inl_dev_rq(roc_nix);
953 [ # # ]: 0 : if (inl_rq) {
954 : 0 : struct idev_cfg *idev = idev_get_cfg();
955 : : struct nix_inl_dev *inl_dev = NULL;
956 : :
957 [ # # # # ]: 0 : if (idev && idev->nix_inl_dev)
958 : : inl_dev = idev->nix_inl_dev;
959 : :
960 : : if (!inl_dev)
961 : : return -EINVAL;
962 : :
963 : 0 : rc = nix_q_ctx_get(&inl_dev->dev, NIX_AQ_CTYPE_RQ, inl_rq->qid, &ctx);
964 [ # # ]: 0 : if (rc) {
965 : 0 : plt_err("Failed to get rq context");
966 : 0 : goto fail;
967 : : }
968 [ # # ]: 0 : nix_dump(file, "============== port=%d inl_rq=%d ===============", roc_nix->port_id,
969 : : inl_rq->qid);
970 [ # # ]: 0 : if (roc_model_is_cn9k())
971 : 0 : nix_cn9k_lf_rq_dump(ctx, file);
972 [ # # ]: 0 : else if (roc_model_is_cn10k())
973 : 0 : nix_cn10k_lf_rq_dump(ctx, file);
974 : : else
975 : 0 : nix_lf_rq_dump(ctx, file);
976 : : }
977 : :
978 [ # # ]: 0 : for (q = 0; q < sq; q++) {
979 : 0 : rc = nix_q_ctx_get(dev, NIX_AQ_CTYPE_SQ, q, &ctx);
980 [ # # ]: 0 : if (rc) {
981 : 0 : plt_err("Failed to get sq context");
982 : 0 : goto fail;
983 : : }
984 [ # # ]: 0 : nix_dump(file, "============== port=%d sq=%d ===============",
985 : : roc_nix->port_id, q);
986 [ # # ]: 0 : if (roc_model_is_cn9k())
987 : 0 : nix_cn9k_lf_sq_dump(ctx, &sqb_aura, file);
988 [ # # ]: 0 : else if (roc_model_is_cn10k())
989 : 0 : nix_cn10k_lf_sq_dump(ctx, &sqb_aura, file);
990 : : else
991 : 0 : nix_lf_sq_dump(ctx, &sqb_aura, file);
992 : :
993 : : if (!npa_lf) {
994 : : plt_err("NPA LF does not exist");
995 : : continue;
996 : : }
997 : :
998 [ # # ]: 0 : if (roc_model_is_cn20k()) {
999 : 0 : npa_aq_cn20k = mbox_alloc_msg_npa_cn20k_aq_enq(mbox_get(npa_lf->mbox));
1000 : : npa_aq = (struct npa_aq_enq_req *)npa_aq_cn20k; /* Common fields */
1001 : : } else {
1002 : 0 : npa_aq = mbox_alloc_msg_npa_aq_enq(mbox_get(npa_lf->mbox));
1003 : : }
1004 [ # # ]: 0 : if (npa_aq == NULL) {
1005 : : rc = -ENOSPC;
1006 : 0 : mbox_put(npa_lf->mbox);
1007 : 0 : goto fail;
1008 : : }
1009 : 0 : npa_aq->aura_id = sqb_aura;
1010 : 0 : npa_aq->ctype = NPA_AQ_CTYPE_AURA;
1011 : 0 : npa_aq->op = NPA_AQ_INSTOP_READ;
1012 : :
1013 : 0 : rc = mbox_process_msg(npa_lf->mbox, (void *)&npa_rsp);
1014 : 0 : mbox_put(npa_lf->mbox);
1015 [ # # ]: 0 : if (rc) {
1016 : 0 : plt_err("Failed to get sq's sqb_aura context");
1017 : 0 : continue;
1018 : : }
1019 : :
1020 [ # # ]: 0 : nix_dump(file, "\nSQB Aura W0: Pool addr\t\t0x%" PRIx64 "",
1021 : : npa_rsp->aura.pool_addr);
1022 [ # # ]: 0 : nix_dump(file, "SQB Aura W1: ena\t\t\t%d", npa_rsp->aura.ena);
1023 [ # # ]: 0 : nix_dump(file, "SQB Aura W2: count\t\t%" PRIx64 "",
1024 : : (uint64_t)npa_rsp->aura.count);
1025 [ # # ]: 0 : nix_dump(file, "SQB Aura W3: limit\t\t%" PRIx64 "",
1026 : : (uint64_t)npa_rsp->aura.limit);
1027 [ # # ]: 0 : nix_dump(file, "SQB Aura W3: fc_ena\t\t%d", npa_rsp->aura.fc_ena);
1028 [ # # ]: 0 : nix_dump(file, "SQB Aura W4: fc_addr\t\t0x%" PRIx64 "\n",
1029 : : npa_rsp->aura.fc_addr);
1030 : : }
1031 : :
1032 : 0 : fail:
1033 : : return rc;
1034 : : }
1035 : :
1036 : : /* Dumps struct nix_cqe_hdr_s and union nix_rx_parse_u */
1037 : : void
1038 : 0 : roc_nix_cqe_dump(FILE *file, const struct nix_cqe_hdr_s *cq)
1039 : : {
1040 : : const union nix_rx_parse_u *rx =
1041 : : (const union nix_rx_parse_u *)((const uint64_t *)cq + 1);
1042 : 0 : const uint64_t *sgs = (const uint64_t *)(rx + 1);
1043 : : int i;
1044 : :
1045 [ # # ]: 0 : nix_dump(file, "tag \t\t0x%x\tq \t\t%d\t\tnode \t\t%d\tcqe_type \t%d",
1046 : : cq->tag, cq->q, cq->node, cq->cqe_type);
1047 : :
1048 [ # # ]: 0 : nix_dump(file, "W0: chan \t0x%x\t\tdesc_sizem1 \t%d", rx->chan,
1049 : : rx->desc_sizem1);
1050 [ # # ]: 0 : nix_dump(file, "W0: imm_copy \t%d\t\texpress \t%d", rx->imm_copy,
1051 : : rx->express);
1052 [ # # ]: 0 : nix_dump(file, "W0: wqwd \t%d\t\terrlev \t\t%d\t\terrcode \t%d", rx->wqwd,
1053 : : rx->errlev, rx->errcode);
1054 [ # # ]: 0 : nix_dump(file, "W0: latype \t%d\t\tlbtype \t\t%d\t\tlctype \t\t%d",
1055 : : rx->latype, rx->lbtype, rx->lctype);
1056 [ # # ]: 0 : nix_dump(file, "W0: ldtype \t%d\t\tletype \t\t%d\t\tlftype \t\t%d",
1057 : : rx->ldtype, rx->letype, rx->lftype);
1058 [ # # ]: 0 : nix_dump(file, "W0: lgtype \t%d \t\tlhtype \t\t%d", rx->lgtype, rx->lhtype);
1059 : :
1060 [ # # ]: 0 : nix_dump(file, "W1: pkt_lenm1 \t%d", rx->pkt_lenm1);
1061 [ # # ]: 0 : nix_dump(file, "W1: l2m \t%d\t\tl2b \t\t%d\t\tl3m \t\t%d\tl3b \t\t%d",
1062 : : rx->l2m, rx->l2b, rx->l3m, rx->l3b);
1063 [ # # ]: 0 : nix_dump(file, "W1: vtag0_valid %d\t\tvtag0_gone \t%d", rx->vtag0_valid,
1064 : : rx->vtag0_gone);
1065 [ # # ]: 0 : nix_dump(file, "W1: vtag1_valid %d\t\tvtag1_gone \t%d", rx->vtag1_valid,
1066 : : rx->vtag1_gone);
1067 [ # # ]: 0 : nix_dump(file, "W1: pkind \t%d", rx->pkind);
1068 [ # # ]: 0 : nix_dump(file, "W1: vtag0_tci \t%d\t\tvtag1_tci \t%d", rx->vtag0_tci,
1069 : : rx->vtag1_tci);
1070 : :
1071 [ # # ]: 0 : nix_dump(file, "W2: laflags \t%d\t\tlbflags\t\t%d\t\tlcflags \t%d",
1072 : : rx->laflags, rx->lbflags, rx->lcflags);
1073 [ # # ]: 0 : nix_dump(file, "W2: ldflags \t%d\t\tleflags\t\t%d\t\tlfflags \t%d",
1074 : : rx->ldflags, rx->leflags, rx->lfflags);
1075 [ # # ]: 0 : nix_dump(file, "W2: lgflags \t%d\t\tlhflags \t%d", rx->lgflags, rx->lhflags);
1076 : :
1077 [ # # ]: 0 : nix_dump(file, "W3: eoh_ptr \t%d\t\twqe_aura \t%d\t\tpb_aura \t%d",
1078 : : rx->eoh_ptr, rx->wqe_aura, rx->pb_aura);
1079 [ # # ]: 0 : nix_dump(file, "W3: match_id \t%d", rx->match_id);
1080 : :
1081 [ # # ]: 0 : nix_dump(file, "W4: laptr \t%d\t\tlbptr \t\t%d\t\tlcptr \t\t%d", rx->laptr,
1082 : : rx->lbptr, rx->lcptr);
1083 [ # # ]: 0 : nix_dump(file, "W4: ldptr \t%d\t\tleptr \t\t%d\t\tlfptr \t\t%d", rx->ldptr,
1084 : : rx->leptr, rx->lfptr);
1085 [ # # ]: 0 : nix_dump(file, "W4: lgptr \t%d\t\tlhptr \t\t%d", rx->lgptr, rx->lhptr);
1086 : :
1087 [ # # ]: 0 : nix_dump(file, "W5: vtag0_ptr \t%d\t\tvtag1_ptr \t%d\t\tflow_key_alg \t%d",
1088 : : rx->vtag0_ptr, rx->vtag1_ptr, rx->flow_key_alg);
1089 : :
1090 [ # # ]: 0 : for (i = 0; i < (rx->desc_sizem1 + 1) << 1; i++)
1091 [ # # ]: 0 : nix_dump(file, "sg[%u] = %p", i, (void *)sgs[i]);
1092 : 0 : }
1093 : :
1094 : : void
1095 : 0 : roc_nix_rq_dump(struct roc_nix_rq *rq, FILE *file)
1096 : : {
1097 [ # # ]: 0 : nix_dump(file, "nix_rq@%p", rq);
1098 [ # # ]: 0 : nix_dump(file, " qid = %d", rq->qid);
1099 [ # # ]: 0 : nix_dump(file, " aura_handle = 0x%" PRIx64 "", rq->aura_handle);
1100 [ # # ]: 0 : nix_dump(file, " ipsec_ena = %d", rq->ipsech_ena);
1101 [ # # ]: 0 : nix_dump(file, " first_skip = %d", rq->first_skip);
1102 [ # # ]: 0 : nix_dump(file, " later_skip = %d", rq->later_skip);
1103 [ # # ]: 0 : nix_dump(file, " lpb_size = %d", rq->lpb_size);
1104 [ # # ]: 0 : nix_dump(file, " sso_ena = %d", rq->sso_ena);
1105 [ # # ]: 0 : nix_dump(file, " tag_mask = %d", rq->tag_mask);
1106 [ # # ]: 0 : nix_dump(file, " flow_tag_width = %d", rq->flow_tag_width);
1107 [ # # ]: 0 : nix_dump(file, " tt = %d", rq->tt);
1108 [ # # ]: 0 : nix_dump(file, " hwgrp = %d", rq->hwgrp);
1109 [ # # ]: 0 : nix_dump(file, " vwqe_ena = %d", rq->vwqe_ena);
1110 [ # # ]: 0 : nix_dump(file, " vwqe_first_skip = %d", rq->vwqe_first_skip);
1111 [ # # ]: 0 : nix_dump(file, " vwqe_max_sz_exp = %d", rq->vwqe_max_sz_exp);
1112 [ # # ]: 0 : nix_dump(file, " vwqe_wait_tmo = %ld", rq->vwqe_wait_tmo);
1113 [ # # ]: 0 : nix_dump(file, " vwqe_aura_handle = %ld", rq->vwqe_aura_handle);
1114 [ # # ]: 0 : nix_dump(file, " roc_nix = %p", rq->roc_nix);
1115 [ # # ]: 0 : nix_dump(file, " inl_dev_refs = %d", rq->inl_dev_refs);
1116 [ # # ]: 0 : nix_dump(file, " tc = %d", rq->tc);
1117 : 0 : }
1118 : :
1119 : : void
1120 : 0 : roc_nix_cq_dump(struct roc_nix_cq *cq, FILE *file)
1121 : : {
1122 [ # # ]: 0 : nix_dump(file, "nix_cq@%p", cq);
1123 [ # # ]: 0 : nix_dump(file, " qid = %d", cq->qid);
1124 [ # # ]: 0 : nix_dump(file, " qnb_desc = %d", cq->nb_desc);
1125 [ # # ]: 0 : nix_dump(file, " roc_nix = %p", cq->roc_nix);
1126 [ # # ]: 0 : nix_dump(file, " door = 0x%" PRIx64 "", cq->door);
1127 [ # # ]: 0 : nix_dump(file, " status = %p", cq->status);
1128 [ # # ]: 0 : nix_dump(file, " wdata = 0x%" PRIx64 "", cq->wdata);
1129 [ # # ]: 0 : nix_dump(file, " desc_base = %p", cq->desc_base);
1130 [ # # ]: 0 : nix_dump(file, " qmask = 0x%" PRIx32 "", cq->qmask);
1131 : 0 : }
1132 : :
1133 : : void
1134 : 0 : roc_nix_sq_dump(struct roc_nix_sq *sq, FILE *file)
1135 : : {
1136 [ # # ]: 0 : nix_dump(file, "nix_sq@%p", sq);
1137 [ # # ]: 0 : nix_dump(file, " qid = %d", sq->qid);
1138 [ # # ]: 0 : nix_dump(file, " max_sqe_sz = %d", sq->max_sqe_sz);
1139 [ # # ]: 0 : nix_dump(file, " nb_desc = %d", sq->nb_desc);
1140 [ # # ]: 0 : nix_dump(file, " sqes_per_sqb_log2 = %d", sq->sqes_per_sqb_log2);
1141 [ # # ]: 0 : nix_dump(file, " roc_nix= %p", sq->roc_nix);
1142 [ # # ]: 0 : nix_dump(file, " aura_handle = 0x%" PRIx64 "", sq->aura_handle);
1143 [ # # ]: 0 : nix_dump(file, " nb_sqb_bufs_adj = %d", sq->nb_sqb_bufs_adj);
1144 [ # # ]: 0 : nix_dump(file, " nb_sqb_bufs = %d", sq->nb_sqb_bufs);
1145 [ # # ]: 0 : nix_dump(file, " io_addr = 0x%" PRIx64 "", sq->io_addr);
1146 [ # # ]: 0 : nix_dump(file, " lmt_addr = %p", sq->lmt_addr);
1147 [ # # ]: 0 : nix_dump(file, " sqe_mem = %p", sq->sqe_mem);
1148 [ # # ]: 0 : nix_dump(file, " fc = %p", sq->fc);
1149 [ # # ]: 0 : nix_dump(file, " tc = %d", sq->tc);
1150 : 0 : };
1151 : :
1152 : : static uint8_t
1153 : 0 : nix_tm_reg_dump_prep(struct nix *nix, uint16_t hw_lvl, uint16_t schq,
1154 : : uint64_t *reg, char regstr[][NIX_REG_NAME_SZ])
1155 : : {
1156 : : FILE *file = NULL;
1157 : : uint8_t k = 0;
1158 : :
1159 [ # # # # : 0 : switch (hw_lvl) {
# # ]
1160 : 0 : case NIX_TXSCH_LVL_SMQ:
1161 : 0 : reg[k] = NIX_AF_SMQX_CFG(schq);
1162 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_SMQ[%u]_CFG",
1163 : : schq);
1164 : :
1165 : 0 : reg[k] = NIX_AF_MDQX_PARENT(schq);
1166 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_PARENT",
1167 : : schq);
1168 : :
1169 : 0 : reg[k] = NIX_AF_MDQX_SCHEDULE(schq);
1170 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1171 : : "NIX_AF_MDQ[%u]_SCHEDULE", schq);
1172 : :
1173 : 0 : reg[k] = NIX_AF_MDQX_PIR(schq);
1174 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_PIR",
1175 : : schq);
1176 : :
1177 : 0 : reg[k] = NIX_AF_MDQX_CIR(schq);
1178 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_CIR",
1179 : : schq);
1180 : :
1181 : 0 : reg[k] = NIX_AF_MDQX_SHAPE(schq);
1182 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_SHAPE",
1183 : : schq);
1184 : :
1185 : 0 : reg[k] = NIX_AF_MDQX_SW_XOFF(schq);
1186 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_SW_XOFF",
1187 : : schq);
1188 : : break;
1189 : 0 : case NIX_TXSCH_LVL_TL4:
1190 : 0 : reg[k] = NIX_AF_TL4X_PARENT(schq);
1191 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_PARENT",
1192 : : schq);
1193 : :
1194 : 0 : reg[k] = NIX_AF_TL4X_TOPOLOGY(schq);
1195 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1196 : : "NIX_AF_TL4[%u]_TOPOLOGY", schq);
1197 : :
1198 : 0 : reg[k] = NIX_AF_TL4X_SDP_LINK_CFG(schq);
1199 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1200 : : "NIX_AF_TL4[%u]_SDP_LINK_CFG", schq);
1201 : :
1202 : 0 : reg[k] = NIX_AF_TL4X_SCHEDULE(schq);
1203 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1204 : : "NIX_AF_TL4[%u]_SCHEDULE", schq);
1205 : :
1206 : 0 : reg[k] = NIX_AF_TL4X_PIR(schq);
1207 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_PIR",
1208 : : schq);
1209 : :
1210 : 0 : reg[k] = NIX_AF_TL4X_CIR(schq);
1211 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_CIR",
1212 : : schq);
1213 : :
1214 : 0 : reg[k] = NIX_AF_TL4X_SHAPE(schq);
1215 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_SHAPE",
1216 : : schq);
1217 : :
1218 : 0 : reg[k] = NIX_AF_TL4X_SW_XOFF(schq);
1219 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_SW_XOFF",
1220 : : schq);
1221 : : break;
1222 : 0 : case NIX_TXSCH_LVL_TL3:
1223 : 0 : reg[k] = NIX_AF_TL3X_PARENT(schq);
1224 [ # # ]: 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_PARENT",
1225 : : schq);
1226 : :
1227 : 0 : reg[k] = NIX_AF_TL3X_TOPOLOGY(schq);
1228 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1229 : : "NIX_AF_TL3[%u]_TOPOLOGY", schq);
1230 : :
1231 : : /* Link configuration */
1232 [ # # ]: 0 : if (!nix->sdp_link &&
1233 [ # # ]: 0 : nix->tm_link_cfg_lvl == NIX_TXSCH_LVL_TL3) {
1234 : 0 : reg[k] = NIX_AF_TL3_TL2X_LINKX_CFG(schq, nix->tx_link);
1235 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1236 : : "NIX_AF_TL3_TL2[%u]_LINK[%u]_CFG", schq,
1237 : : nix->tx_link);
1238 : : }
1239 : :
1240 : 0 : reg[k] = NIX_AF_TL3X_SCHEDULE(schq);
1241 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1242 : : "NIX_AF_TL3[%u]_SCHEDULE", schq);
1243 : :
1244 : 0 : reg[k] = NIX_AF_TL3X_PIR(schq);
1245 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_PIR",
1246 : : schq);
1247 : :
1248 : 0 : reg[k] = NIX_AF_TL3X_CIR(schq);
1249 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_CIR",
1250 : : schq);
1251 : :
1252 : 0 : reg[k] = NIX_AF_TL3X_SHAPE(schq);
1253 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_SHAPE",
1254 : : schq);
1255 : :
1256 : 0 : reg[k] = NIX_AF_TL3X_SW_XOFF(schq);
1257 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_SW_XOFF",
1258 : : schq);
1259 : : break;
1260 : 0 : case NIX_TXSCH_LVL_TL2:
1261 : 0 : reg[k] = NIX_AF_TL2X_PARENT(schq);
1262 [ # # ]: 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_PARENT",
1263 : : schq);
1264 : :
1265 : 0 : reg[k] = NIX_AF_TL2X_TOPOLOGY(schq);
1266 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1267 : : "NIX_AF_TL2[%u]_TOPOLOGY", schq);
1268 : :
1269 : : /* Link configuration */
1270 [ # # ]: 0 : if (!nix->sdp_link &&
1271 [ # # ]: 0 : nix->tm_link_cfg_lvl == NIX_TXSCH_LVL_TL2) {
1272 : 0 : reg[k] = NIX_AF_TL3_TL2X_LINKX_CFG(schq, nix->tx_link);
1273 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1274 : : "NIX_AF_TL3_TL2[%u]_LINK[%u]_CFG", schq,
1275 : : nix->tx_link);
1276 : : }
1277 : :
1278 : 0 : reg[k] = NIX_AF_TL2X_SCHEDULE(schq);
1279 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1280 : : "NIX_AF_TL2[%u]_SCHEDULE", schq);
1281 : :
1282 : 0 : reg[k] = NIX_AF_TL2X_PIR(schq);
1283 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_PIR",
1284 : : schq);
1285 : :
1286 : 0 : reg[k] = NIX_AF_TL2X_CIR(schq);
1287 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_CIR",
1288 : : schq);
1289 : :
1290 : 0 : reg[k] = NIX_AF_TL2X_SHAPE(schq);
1291 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_SHAPE",
1292 : : schq);
1293 : :
1294 : 0 : reg[k] = NIX_AF_TL2X_SW_XOFF(schq);
1295 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_SW_XOFF",
1296 : : schq);
1297 : : break;
1298 : 0 : case NIX_TXSCH_LVL_TL1:
1299 : :
1300 : 0 : reg[k] = NIX_AF_TL1X_TOPOLOGY(schq);
1301 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1302 : : "NIX_AF_TL1[%u]_TOPOLOGY", schq);
1303 : :
1304 : 0 : reg[k] = NIX_AF_TL1X_SCHEDULE(schq);
1305 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1306 : : "NIX_AF_TL1[%u]_SCHEDULE", schq);
1307 : :
1308 : 0 : reg[k] = NIX_AF_TL1X_CIR(schq);
1309 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL1[%u]_CIR",
1310 : : schq);
1311 : :
1312 : 0 : reg[k] = NIX_AF_TL1X_SW_XOFF(schq);
1313 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL1[%u]_SW_XOFF",
1314 : : schq);
1315 : :
1316 : 0 : reg[k] = NIX_AF_TL1X_DROPPED_PACKETS(schq);
1317 : 0 : snprintf(regstr[k++], NIX_REG_NAME_SZ,
1318 : : "NIX_AF_TL1[%u]_DROPPED_PACKETS", schq);
1319 : : break;
1320 : : default:
1321 : : break;
1322 : : }
1323 : :
1324 : : if (k > MAX_REGS_PER_MBOX_MSG) {
1325 : : nix_dump(file, "\t!!!NIX TM Registers request overflow!!!");
1326 : : return 0;
1327 : : }
1328 : : return k;
1329 : : }
1330 : :
1331 : : static void
1332 : 0 : nix_tm_dump_lvl(struct nix *nix, struct nix_tm_node_list *list, uint8_t hw_lvl)
1333 : : {
1334 : : char regstr[MAX_REGS_PER_MBOX_MSG * 2][NIX_REG_NAME_SZ];
1335 : : uint64_t reg[MAX_REGS_PER_MBOX_MSG * 2];
1336 : 0 : struct mbox *mbox = (&nix->dev)->mbox;
1337 : : struct nix_txschq_config *req, *rsp;
1338 : : const char *lvlstr, *parent_lvlstr;
1339 : : struct nix_tm_node *node, *parent;
1340 : : struct nix_tm_node *root = NULL;
1341 : : uint32_t schq, parent_schq;
1342 : : bool found = false;
1343 : : FILE *file = NULL;
1344 : : uint8_t j, k, rc;
1345 : :
1346 [ # # ]: 0 : TAILQ_FOREACH(node, list, node) {
1347 [ # # ]: 0 : if (node->hw_lvl != hw_lvl)
1348 : 0 : continue;
1349 : :
1350 : : found = true;
1351 : 0 : parent = node->parent;
1352 [ # # ]: 0 : if (hw_lvl == NIX_TXSCH_LVL_CNT) {
1353 : : lvlstr = "SQ";
1354 : 0 : schq = node->id;
1355 : : } else {
1356 : : lvlstr = nix_tm_hwlvl2str(node->hw_lvl);
1357 : 0 : schq = node->hw_id;
1358 : : }
1359 : :
1360 [ # # ]: 0 : if (parent) {
1361 : 0 : parent_schq = parent->hw_id;
1362 [ # # # # : 0 : parent_lvlstr = nix_tm_hwlvl2str(parent->hw_lvl);
# # ]
1363 [ # # ]: 0 : } else if (node->hw_lvl == NIX_TXSCH_LVL_TL1) {
1364 : 0 : parent_schq = nix->tx_link;
1365 : : parent_lvlstr = "LINK";
1366 : : } else {
1367 : 0 : parent_schq = node->parent_hw_id;
1368 [ # # # # : 0 : parent_lvlstr = nix_tm_hwlvl2str(node->hw_lvl + 1);
# ]
1369 : : }
1370 : :
1371 [ # # ]: 0 : nix_dump(file, "\t(%p%s) %s_%d->%s_%d", node,
1372 : : node->child_realloc ? "[CR]" : "", lvlstr, schq,
1373 : : parent_lvlstr, parent_schq);
1374 : :
1375 [ # # ]: 0 : if (!(node->flags & NIX_TM_NODE_HWRES))
1376 : 0 : continue;
1377 : :
1378 : : /* Need to dump TL1 when root is TL2 */
1379 [ # # ]: 0 : if (node->hw_lvl == nix->tm_root_lvl)
1380 : : root = node;
1381 : :
1382 : : /* Dump registers only when HWRES is present */
1383 : 0 : k = nix_tm_reg_dump_prep(nix, node->hw_lvl, schq, reg, regstr);
1384 [ # # ]: 0 : if (!k)
1385 : 0 : continue;
1386 : :
1387 : 0 : req = mbox_alloc_msg_nix_txschq_cfg(mbox_get(mbox));
1388 : 0 : req->read = 1;
1389 : 0 : req->lvl = node->hw_lvl;
1390 : 0 : req->num_regs = k;
1391 : 0 : mbox_memcpy(req->reg, reg, sizeof(uint64_t) * k);
1392 : 0 : rc = mbox_process_msg(mbox, (void **)&rsp);
1393 [ # # ]: 0 : if (!rc) {
1394 [ # # ]: 0 : for (j = 0; j < k; j++)
1395 : 0 : nix_dump(file, "\t\t%s=0x%016" PRIx64, regstr[j],
1396 : : rsp->regval[j]);
1397 : : } else {
1398 : 0 : nix_dump(file, "\t!!!Failed to dump registers!!!");
1399 : : }
1400 : : mbox_put(mbox);
1401 : : }
1402 : :
1403 [ # # ]: 0 : if (found)
1404 : 0 : nix_dump(file, "\n");
1405 : :
1406 : : /* Dump TL1 node data when root level is TL2 */
1407 [ # # # # ]: 0 : if (root && root->hw_lvl == NIX_TXSCH_LVL_TL2) {
1408 : 0 : k = nix_tm_reg_dump_prep(nix, NIX_TXSCH_LVL_TL1,
1409 : 0 : root->parent_hw_id, reg, regstr);
1410 [ # # ]: 0 : if (!k)
1411 : 0 : return;
1412 : :
1413 : 0 : req = mbox_alloc_msg_nix_txschq_cfg(mbox_get(mbox));
1414 : 0 : req->read = 1;
1415 : 0 : req->lvl = NIX_TXSCH_LVL_TL1;
1416 : 0 : req->num_regs = k;
1417 : 0 : mbox_memcpy(req->reg, reg, sizeof(uint64_t) * k);
1418 : 0 : rc = mbox_process_msg(mbox, (void **)&rsp);
1419 [ # # ]: 0 : if (!rc) {
1420 [ # # ]: 0 : for (j = 0; j < k; j++)
1421 : 0 : nix_dump(file, "\t\t%s=0x%016" PRIx64, regstr[j],
1422 : : rsp->regval[j]);
1423 : : } else {
1424 : 0 : nix_dump(file, "\t!!!Failed to dump registers!!!");
1425 : : }
1426 : : mbox_put(mbox);
1427 : 0 : nix_dump(file, "\n");
1428 : : }
1429 : : }
1430 : :
1431 : : void
1432 [ # # ]: 0 : roc_nix_tm_dump(struct roc_nix *roc_nix, FILE *file)
1433 : : {
1434 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
1435 : : struct dev *dev = &nix->dev;
1436 : : uint8_t hw_lvl, i;
1437 : :
1438 [ # # # # : 0 : nix_dump(file, "===TM hierarchy and registers dump of %s (pf:vf) (%d:%d)===",
# # ]
1439 : : nix->pci_dev->name, dev_get_pf(dev->pf_func),
1440 : : dev_get_vf(dev->pf_func));
1441 : :
1442 : : /* Dump all trees */
1443 [ # # ]: 0 : for (i = 0; i < ROC_NIX_TM_TREE_MAX; i++) {
1444 [ # # ]: 0 : nix_dump(file, "\tTM %s:", nix_tm_tree2str(i));
1445 [ # # ]: 0 : for (hw_lvl = 0; hw_lvl <= NIX_TXSCH_LVL_CNT; hw_lvl++)
1446 : 0 : nix_tm_dump_lvl(nix, &nix->trees[i], hw_lvl);
1447 : : }
1448 : :
1449 : : /* Dump unused resources */
1450 [ # # ]: 0 : nix_dump(file, "\tTM unused resources:");
1451 : : hw_lvl = NIX_TXSCH_LVL_SMQ;
1452 [ # # ]: 0 : for (; hw_lvl < NIX_TXSCH_LVL_CNT; hw_lvl++) {
1453 [ # # # # : 0 : nix_dump(file, "\t\ttxschq %7s num = %d",
# # # # #
# # # ]
1454 : : nix_tm_hwlvl2str(hw_lvl),
1455 : : nix_tm_resource_avail(nix, hw_lvl, false));
1456 : :
1457 : 0 : nix_bitmap_dump(nix->schq_bmp[hw_lvl], file);
1458 [ # # ]: 0 : nix_dump(file, "\n");
1459 : :
1460 [ # # # # : 0 : nix_dump(file, "\t\ttxschq_contig %7s num = %d",
# # # # #
# # # ]
1461 : : nix_tm_hwlvl2str(hw_lvl),
1462 : : nix_tm_resource_avail(nix, hw_lvl, true));
1463 : 0 : nix_bitmap_dump(nix->schq_contig_bmp[hw_lvl], file);
1464 [ # # ]: 0 : nix_dump(file, "\n");
1465 : : }
1466 : 0 : }
1467 : :
1468 : : void
1469 [ # # ]: 0 : roc_nix_dump(struct roc_nix *roc_nix, FILE *file)
1470 : : {
1471 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
1472 : : struct dev *dev = &nix->dev;
1473 : : int i;
1474 : :
1475 [ # # ]: 0 : nix_dump(file, "nix@%p", nix);
1476 [ # # # # : 0 : nix_dump(file, " pf = %d", dev_get_pf(dev->pf_func));
# # ]
1477 [ # # # # : 0 : nix_dump(file, " vf = %d", dev_get_vf(dev->pf_func));
# # ]
1478 [ # # ]: 0 : nix_dump(file, " bar2 = 0x%" PRIx64, dev->bar2);
1479 [ # # ]: 0 : nix_dump(file, " bar4 = 0x%" PRIx64, dev->bar4);
1480 [ # # ]: 0 : nix_dump(file, " port_id = %d", roc_nix->port_id);
1481 [ # # ]: 0 : nix_dump(file, " rss_tag_as_xor = %d", roc_nix->rss_tag_as_xor);
1482 [ # # ]: 0 : nix_dump(file, " rss_tag_as_xor = %d", roc_nix->max_sqb_count);
1483 [ # # ]: 0 : nix_dump(file, " outb_nb_desc = %u", roc_nix->outb_nb_desc);
1484 : :
1485 [ # # ]: 0 : nix_dump(file, " \tpci_dev = %p", nix->pci_dev);
1486 [ # # ]: 0 : nix_dump(file, " \tbase = 0x%" PRIxPTR "", nix->base);
1487 [ # # ]: 0 : nix_dump(file, " \tlmt_base = 0x%" PRIxPTR "", nix->lmt_base);
1488 [ # # ]: 0 : nix_dump(file, " \treta_size = %d", nix->reta_sz);
1489 [ # # ]: 0 : nix_dump(file, " \ttx_chan_base = %d", nix->tx_chan_base);
1490 [ # # ]: 0 : nix_dump(file, " \trx_chan_base = %d", nix->rx_chan_base);
1491 [ # # ]: 0 : nix_dump(file, " \tnb_rx_queues = %d", nix->nb_rx_queues);
1492 [ # # ]: 0 : nix_dump(file, " \tnb_tx_queues = %d", nix->nb_tx_queues);
1493 [ # # ]: 0 : nix_dump(file, " \tlso_tsov6_idx = %d", nix->lso_tsov6_idx);
1494 [ # # ]: 0 : nix_dump(file, " \tlso_tsov4_idx = %d", nix->lso_tsov4_idx);
1495 [ # # ]: 0 : nix_dump(file, " \tlso_udp_tun_v4v4 = %d",
1496 : : nix->lso_udp_tun_idx[ROC_NIX_LSO_TUN_V4V4]);
1497 [ # # ]: 0 : nix_dump(file, " \tlso_udp_tun_v4v6 = %d",
1498 : : nix->lso_udp_tun_idx[ROC_NIX_LSO_TUN_V4V6]);
1499 [ # # ]: 0 : nix_dump(file, " \tlso_udp_tun_v6v4 = %d",
1500 : : nix->lso_udp_tun_idx[ROC_NIX_LSO_TUN_V6V4]);
1501 [ # # ]: 0 : nix_dump(file, " \tlso_udp_tun_v6v6 = %d",
1502 : : nix->lso_udp_tun_idx[ROC_NIX_LSO_TUN_V6V6]);
1503 [ # # ]: 0 : nix_dump(file, " \tlso_tun_v4v4 = %d",
1504 : : nix->lso_tun_idx[ROC_NIX_LSO_TUN_V4V4]);
1505 [ # # ]: 0 : nix_dump(file, " \tlso_tun_v4v6 = %d",
1506 : : nix->lso_tun_idx[ROC_NIX_LSO_TUN_V4V6]);
1507 [ # # ]: 0 : nix_dump(file, " \tlso_tun_v6v4 = %d",
1508 : : nix->lso_tun_idx[ROC_NIX_LSO_TUN_V6V4]);
1509 [ # # ]: 0 : nix_dump(file, " \tlso_tun_v6v6 = %d",
1510 : : nix->lso_tun_idx[ROC_NIX_LSO_TUN_V6V6]);
1511 [ # # ]: 0 : nix_dump(file, " \tlf_rx_stats = %d", nix->lf_rx_stats);
1512 [ # # ]: 0 : nix_dump(file, " \tlf_tx_stats = %d", nix->lf_tx_stats);
1513 [ # # ]: 0 : nix_dump(file, " \trx_chan_cnt = %d", nix->rx_chan_cnt);
1514 [ # # ]: 0 : nix_dump(file, " \ttx_chan_cnt = %d", nix->tx_chan_cnt);
1515 [ # # ]: 0 : nix_dump(file, " \tcgx_links = %d", nix->cgx_links);
1516 [ # # ]: 0 : nix_dump(file, " \tlbk_links = %d", nix->lbk_links);
1517 [ # # ]: 0 : nix_dump(file, " \tsdp_links = %d", nix->sdp_links);
1518 [ # # ]: 0 : nix_dump(file, " \ttx_link = %d", nix->tx_link);
1519 [ # # ]: 0 : nix_dump(file, " \tsqb_size = %d", nix->sqb_size);
1520 [ # # ]: 0 : nix_dump(file, " \tmsixoff = %d", nix->msixoff);
1521 [ # # ]: 0 : for (i = 0; i < nix->nb_cpt_lf; i++)
1522 [ # # ]: 0 : nix_dump(file, " \tcpt_msixoff[%d] = %d", i, nix->cpt_msixoff[i]);
1523 [ # # ]: 0 : nix_dump(file, " \tcints = %d", nix->cints);
1524 [ # # ]: 0 : nix_dump(file, " \tqints = %d", nix->qints);
1525 [ # # ]: 0 : nix_dump(file, " \tsdp_link = %d", nix->sdp_link);
1526 [ # # ]: 0 : nix_dump(file, " \tptp_en = %d", nix->ptp_en);
1527 [ # # ]: 0 : nix_dump(file, " \trss_alg_idx = %d", nix->rss_alg_idx);
1528 [ # # ]: 0 : nix_dump(file, " \ttx_pause = %d", nix->tx_pause);
1529 [ # # ]: 0 : nix_dump(file, " \tinl_inb_ena = %d", nix->inl_inb_ena);
1530 [ # # ]: 0 : nix_dump(file, " \tinl_outb_ena = %d", nix->inl_outb_ena);
1531 [ # # ]: 0 : nix_dump(file, " \tinb_sa_base = 0x%p", nix->inb_sa_base[nix->ipsec_prof_id]);
1532 [ # # ]: 0 : nix_dump(file, " \tinb_sa_sz = %" PRIu64, nix->inb_sa_sz[nix->ipsec_prof_id]);
1533 [ # # ]: 0 : nix_dump(file, " \toutb_sa_base = 0x%p", nix->outb_sa_base);
1534 [ # # ]: 0 : nix_dump(file, " \toutb_sa_sz = %" PRIu64, nix->outb_sa_sz);
1535 [ # # ]: 0 : nix_dump(file, " \toutb_err_sso_pffunc = 0x%x", nix->outb_err_sso_pffunc);
1536 [ # # ]: 0 : nix_dump(file, " \tcpt_lf_base = 0x%p", nix->cpt_lf_base);
1537 [ # # ]: 0 : nix_dump(file, " \tnb_cpt_lf = %d", nix->nb_cpt_lf);
1538 [ # # ]: 0 : nix_dump(file, " \tinb_inl_dev = %d", nix->inb_inl_dev);
1539 : :
1540 : 0 : }
1541 : :
1542 : : void
1543 : 0 : roc_nix_inl_dev_dump(struct roc_nix_inl_dev *roc_inl_dev, FILE *file)
1544 : : {
1545 : 0 : struct idev_cfg *idev = idev_get_cfg();
1546 : : struct nix_inl_dev *inl_dev = NULL;
1547 : : struct dev *dev = NULL;
1548 : : int i;
1549 : :
1550 [ # # ]: 0 : if (roc_inl_dev) {
1551 : 0 : inl_dev = (struct nix_inl_dev *)&roc_inl_dev->reserved;
1552 : : } else {
1553 [ # # # # ]: 0 : if (idev && idev->nix_inl_dev)
1554 : : inl_dev = idev->nix_inl_dev;
1555 : : else
1556 : : return;
1557 : : }
1558 : :
1559 : : dev = &inl_dev->dev;
1560 [ # # ]: 0 : nix_dump(file, "nix_inl_dev@%p", inl_dev);
1561 [ # # # # : 0 : nix_dump(file, " pf = %d", dev_get_pf(dev->pf_func));
# # ]
1562 [ # # # # : 0 : nix_dump(file, " vf = %d", dev_get_vf(dev->pf_func));
# # ]
1563 [ # # ]: 0 : nix_dump(file, " bar2 = 0x%" PRIx64, dev->bar2);
1564 [ # # ]: 0 : nix_dump(file, " bar4 = 0x%" PRIx64, dev->bar4);
1565 : :
1566 [ # # ]: 0 : nix_dump(file, " \tpci_dev = %p", inl_dev->pci_dev);
1567 [ # # ]: 0 : nix_dump(file, " \tnix_base = 0x%" PRIxPTR "", inl_dev->nix_base);
1568 [ # # ]: 0 : nix_dump(file, " \tsso_base = 0x%" PRIxPTR "", inl_dev->sso_base);
1569 [ # # ]: 0 : nix_dump(file, " \tssow_base = 0x%" PRIxPTR "", inl_dev->ssow_base);
1570 [ # # ]: 0 : nix_dump(file, " \tnix_msixoff = %d", inl_dev->nix_msixoff);
1571 [ # # ]: 0 : nix_dump(file, " \tsso_msixoff = %d", inl_dev->sso_msixoff);
1572 [ # # ]: 0 : nix_dump(file, " \tssow_msixoff = %d", inl_dev->ssow_msixoff);
1573 [ # # ]: 0 : nix_dump(file, " \tnix_cints = %d", inl_dev->cints);
1574 [ # # ]: 0 : nix_dump(file, " \tnix_qints = %d", inl_dev->qints);
1575 [ # # ]: 0 : nix_dump(file, " \tinb_sa_base = 0x%p", inl_dev->inb_sa_base[inl_dev->ipsec_prof_id]);
1576 [ # # ]: 0 : nix_dump(file, " \tinb_sa_sz = %d", inl_dev->inb_sa_sz[inl_dev->ipsec_prof_id]);
1577 [ # # ]: 0 : nix_dump(file, " \txaq_buf_size = %u", inl_dev->xaq_buf_size);
1578 [ # # ]: 0 : nix_dump(file, " \txae_waes = %u", inl_dev->xae_waes);
1579 [ # # ]: 0 : nix_dump(file, " \tiue = %u", inl_dev->iue);
1580 [ # # ]: 0 : nix_dump(file, " \txaq_aura = 0x%" PRIx64, inl_dev->xaq.aura_handle);
1581 [ # # ]: 0 : nix_dump(file, " \txaq_mem = 0x%p", inl_dev->xaq.mem);
1582 : :
1583 [ # # ]: 0 : nix_dump(file, " \tinl_dev_rq:");
1584 [ # # ]: 0 : for (i = 0; i < inl_dev->nb_rqs; i++)
1585 : 0 : roc_nix_rq_dump(&inl_dev->rqs[i], file);
1586 : : }
1587 : :
1588 : : void
1589 [ # # ]: 0 : roc_nix_inl_outb_cpt_lfs_dump(struct roc_nix *roc_nix, FILE *file)
1590 : : {
1591 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
1592 : 0 : struct roc_cpt_lf *lf_base = nix->cpt_lf_base;
1593 : : int i;
1594 : :
1595 [ # # ]: 0 : nix_dump(file, "nix@%p", nix);
1596 [ # # ]: 0 : for (i = 0; i < nix->nb_cpt_lf; i++) {
1597 [ # # ]: 0 : nix_dump(file, "NIX inline dev outbound CPT LFs:");
1598 : 0 : cpt_lf_print(&lf_base[i]);
1599 : : }
1600 : 0 : }
1601 : :
1602 : : static void
1603 : 0 : nix_tm_sqe_dump(uint64_t *sqe, int head_off, int end_off, int instr_sz, FILE *file, int full,
1604 : : uint16_t *num)
1605 : : {
1606 : 0 : int i, j, inc = (8 * (0x2 >> instr_sz)), segs;
1607 : : uint64_t *ptr;
1608 : :
1609 [ # # # # ]: 0 : if (!sqe || !(*num))
1610 : : return;
1611 : :
1612 : : ptr = sqe + (head_off * inc);
1613 [ # # ]: 0 : for (i = head_off; i < end_off; i++) {
1614 [ # # ]: 0 : if (!(*num))
1615 : : return;
1616 : 0 : ptr = sqe + (i * inc);
1617 [ # # ]: 0 : nix_dump(file, "Entry : %d >>>>>\n", i);
1618 [ # # ]: 0 : nix_dump(file, "\t\tSEND_HDR[0]: 0x%016lx SEND_HDR[1]: 0x%016lx\n", *ptr,
1619 : : *(ptr + 1));
1620 : 0 : *num = *num - 1;
1621 [ # # ]: 0 : if (!full)
1622 : 0 : continue;
1623 : 0 : ptr += 2;
1624 [ # # ]: 0 : if (((*ptr >> 60) & 0xF) == NIX_SUBDC_EXT) {
1625 [ # # ]: 0 : nix_dump(file, "\t\tSUBDC_EXT[0]: 0x%016lx DUBDC_EXT[1]: 0x%016lx\n", *ptr,
1626 : : *(ptr + 1));
1627 : 0 : ptr += 2;
1628 : : }
1629 [ # # ]: 0 : if (((*ptr >> 60) & 0xF) == NIX_SUBDC_AGE_AND_STATS) {
1630 [ # # ]: 0 : nix_dump(file,
1631 : : "\t\tSUBDC_AGE_STATS[0]: 0x%016lx SUBDC_AGE_STATS[1]: 0x%016lx\n",
1632 : : *ptr, *(ptr + 1));
1633 : 0 : ptr += 2;
1634 : : }
1635 [ # # ]: 0 : if (((*ptr >> 60) & 0xF) == NIX_SUBDC_JUMP) {
1636 [ # # ]: 0 : nix_dump(file, "\t\tSUBDC_JUMP: 0x%016lx\n", *ptr);
1637 : : ptr += 1;
1638 : 0 : ptr = (uint64_t *)*ptr;
1639 : : }
1640 [ # # ]: 0 : if (((*ptr >> 60) & 0xF) == NIX_SUBDC_CRC) {
1641 [ # # ]: 0 : nix_dump(file, "\t\tSUBDC_CRC[0]: 0x%016lx SUBDC_CRC[1]: 0x%016lx\n", *ptr,
1642 : : *(ptr + 1));
1643 : 0 : ptr += 2;
1644 : : }
1645 : : /* We are not parsing immediate send descriptor */
1646 [ # # ]: 0 : if (((*ptr >> 60) & 0xF) == NIX_SUBDC_IMM) {
1647 [ # # ]: 0 : nix_dump(file, "\t\tSUBDC_IMM: 0x%016lx ", *ptr);
1648 : 0 : continue;
1649 : : }
1650 : : while (1) {
1651 [ # # ]: 0 : if (((*ptr >> 60) & 0xF) == NIX_SUBDC_SG) {
1652 [ # # ]: 0 : nix_dump(file, "\t\tSUBDC_SG: 0x%016lx ", *ptr);
1653 : 0 : segs = (*ptr >> 48) & 0x3;
1654 : 0 : ptr += 1;
1655 [ # # ]: 0 : for (j = 0; j < segs; j++) {
1656 [ # # ]: 0 : nix_dump(file, "\t\t\t 0x%016lx ", *ptr);
1657 : 0 : ptr += 1;
1658 : : }
1659 [ # # ]: 0 : if (segs == 2)
1660 : 0 : ptr += 1;
1661 [ # # ]: 0 : } else if (((*ptr >> 60) & 0xF) == NIX_SUBDC_SG2) {
1662 [ # # ]: 0 : nix_dump(file, "\t\tSUBDC_SG2: 0x%016lx ", *ptr);
1663 : : ptr += 1;
1664 [ # # ]: 0 : nix_dump(file, "\t\t\t 0x%016lx ", *ptr);
1665 : 0 : ptr += 1;
1666 : : } else
1667 : : break;
1668 : : }
1669 : : }
1670 : : }
1671 : :
1672 : : int
1673 : 0 : roc_nix_sq_desc_dump(struct roc_nix *roc_nix, uint16_t q, uint16_t offset, uint16_t num, FILE *file)
1674 : : {
1675 : : int head_off, count, rc = 0, tail_off, full = 0;
1676 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
1677 : 0 : struct roc_nix_sq *sq = nix->sqs[q];
1678 : : void *sqb_buf, *dat, *tail_sqb;
1679 : : struct ndc_sync_op *ndc_req;
1680 : 0 : struct dev *dev = &nix->dev;
1681 : : uint16_t sqes_per_sqb;
1682 : : struct mbox *mbox;
1683 : :
1684 : 0 : mbox = dev->mbox;
1685 : : /* Sync NDC-NIX-TX for LF */
1686 : 0 : ndc_req = mbox_alloc_msg_ndc_sync_op(mbox_get(mbox));
1687 [ # # ]: 0 : if (ndc_req == NULL) {
1688 : : mbox_put(mbox);
1689 : 0 : return -EFAULT;
1690 : : }
1691 : :
1692 : 0 : ndc_req->nix_lf_tx_sync = 1;
1693 [ # # ]: 0 : if (mbox_process(mbox))
1694 : : rc |= NIX_ERR_NDC_SYNC;
1695 : : mbox_put(mbox);
1696 : :
1697 [ # # ]: 0 : if (rc)
1698 : 0 : plt_err("NDC_SYNC failed rc %d", rc);
1699 : :
1700 : 0 : rc = nix_q_ctx_get(dev, NIX_AQ_CTYPE_SQ, q, (void *)&dat);
1701 [ # # ]: 0 : if (rc)
1702 : : return rc;
1703 [ # # ]: 0 : if (roc_model_is_cn9k()) {
1704 : 0 : volatile struct nix_sq_ctx_s *ctx = (struct nix_sq_ctx_s *)dat;
1705 : :
1706 [ # # # # ]: 0 : if (ctx->mnq_dis || ctx->lmt_dis)
1707 : : full = 1;
1708 : :
1709 : 0 : count = ctx->sqb_count;
1710 : 0 : sqb_buf = (void *)ctx->head_sqb;
1711 : 0 : tail_sqb = (void *)ctx->tail_sqb;
1712 : 0 : head_off = ctx->head_offset;
1713 : 0 : tail_off = ctx->tail_offset;
1714 [ # # ]: 0 : } else if (roc_model_is_cn10k()) {
1715 : 0 : volatile struct nix_cn10k_sq_ctx_s *ctx = (struct nix_cn10k_sq_ctx_s *)dat;
1716 : :
1717 [ # # # # ]: 0 : if (ctx->mnq_dis || ctx->lmt_dis)
1718 : : full = 1;
1719 : :
1720 : 0 : count = ctx->sqb_count;
1721 : 0 : sqb_buf = (void *)ctx->head_sqb;
1722 : 0 : tail_sqb = (void *)ctx->tail_sqb;
1723 : 0 : head_off = ctx->head_offset;
1724 : 0 : tail_off = ctx->tail_offset;
1725 : : } else {
1726 : 0 : volatile struct nix_cn20k_sq_ctx_s *ctx = (struct nix_cn20k_sq_ctx_s *)dat;
1727 : :
1728 [ # # # # ]: 0 : if (ctx->mnq_dis || ctx->lmt_dis)
1729 : : full = 1;
1730 : :
1731 : 0 : count = ctx->sqb_count;
1732 : 0 : sqb_buf = (void *)ctx->head_sqb;
1733 : 0 : tail_sqb = (void *)ctx->tail_sqb;
1734 : 0 : head_off = ctx->head_offset;
1735 : 0 : tail_off = ctx->tail_offset;
1736 : : }
1737 : 0 : sqes_per_sqb = 1 << sq->sqes_per_sqb_log2;
1738 [ # # ]: 0 : while (count) {
1739 : : void *next_sqb;
1740 : :
1741 [ # # ]: 0 : if (sqb_buf == tail_sqb) {
1742 [ # # ]: 0 : if ((head_off + offset) >= tail_off) /* Nothing to be dump */
1743 : : return 0;
1744 : 0 : head_off += tail_off;
1745 : 0 : break;
1746 [ # # ]: 0 : } else if ((head_off + offset) >= sqes_per_sqb) {
1747 : 0 : next_sqb = *(void **)((uint64_t *)sqb_buf +
1748 : 0 : (uint32_t)((sqes_per_sqb - 1) *
1749 : 0 : (0x2 >> sq->max_sqe_sz) * 8));
1750 : : /* While traffic running HW may freed/reused this SQE */
1751 [ # # ]: 0 : if (!next_sqb)
1752 : : return 0;
1753 : : sqb_buf = next_sqb;
1754 : : head_off = 0;
1755 : 0 : count--;
1756 : : } else {
1757 : : head_off += offset;
1758 : : break;
1759 : : }
1760 : : }
1761 [ # # ]: 0 : while (count) {
1762 : : void *next_sqb;
1763 : :
1764 [ # # ]: 0 : if (sqb_buf == tail_sqb)
1765 : 0 : nix_tm_sqe_dump(sqb_buf, head_off, tail_off, sq->max_sqe_sz, file, full,
1766 : : &num);
1767 : : else
1768 : 0 : nix_tm_sqe_dump(sqb_buf, head_off, (sqes_per_sqb - 1), sq->max_sqe_sz, file,
1769 : : full, &num);
1770 [ # # ]: 0 : if (!num)
1771 : : break;
1772 : 0 : next_sqb = *(void **)((uint64_t *)sqb_buf +
1773 : 0 : (uint32_t)((sqes_per_sqb - 1) * (0x2 >> sq->max_sqe_sz) * 8));
1774 : : /* While traffic running HW may freed/reused this SQE */
1775 [ # # ]: 0 : if (!next_sqb)
1776 : : return 0;
1777 : : sqb_buf = next_sqb;
1778 : : head_off = 0;
1779 : 0 : count--;
1780 : : }
1781 : :
1782 : : return 0;
1783 : : }
|