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 : : #define cpt_dump(file, fmt, ...) \
9 : : 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 : : static inline void
17 : 0 : cpt_cnxk_parse_hdr_dump(FILE *file, const struct cpt_parse_hdr_s *cpth)
18 : : {
19 : : const struct cpt_frag_info_s *frag_info;
20 : : const struct cpt_rxc_sg_s *rxc_sg;
21 : : uint32_t offset;
22 : : int i;
23 : :
24 [ # # ]: 0 : cpt_dump(file, "CPT_PARSE \t0x%p:", cpth);
25 : :
26 : : /* W0 */
27 [ # # ]: 0 : cpt_dump(file, "W0: cookie \t0x%x\t\tmatch_id \t0x%04x \t", cpth->w0.cookie,
28 : : cpth->w0.match_id);
29 [ # # ]: 0 : cpt_dump(file, "W0: err_sum \t%u \t", cpth->w0.err_sum);
30 [ # # ]: 0 : cpt_dump(file, "W0: reas_sts \t0x%x\t\tet_owr \t%u\t\tpkt_fmt \t%u \t", cpth->w0.reas_sts,
31 : : cpth->w0.et_owr, cpth->w0.pkt_fmt);
32 [ # # ]: 0 : cpt_dump(file, "W0: pad_len \t%u\t\tnum_frags \t%u\t\tpkt_out \t%u \t", cpth->w0.pad_len,
33 : : cpth->w0.num_frags, cpth->w0.pkt_out);
34 : :
35 : : /* W1 */
36 [ # # ]: 0 : cpt_dump(file, "W1: wqe_ptr \t0x%016" PRIx64 "\t", cpth->wqe_ptr);
37 : :
38 : : /* W2 */
39 [ # # ]: 0 : cpt_dump(file, "W2: pkt_inline \t0x%x\t\torig_pkt_aura \t0x%x", cpth->w2.pkt_inline,
40 : : cpth->w2.orig_pkt_aura);
41 [ # # ]: 0 : cpt_dump(file, "W2: il3_off \t0x%x\t\tptr_pad \t0x%x \t", cpth->w2.il3_off,
42 : : cpth->w2.ptr_pad);
43 [ # # ]: 0 : cpt_dump(file, "W2: ptr_offset \t0x%x \t", cpth->w2.ptr_offset);
44 : :
45 : : /* W3 */
46 [ # # ]: 0 : cpt_dump(file, "W3: hw_ccode \t0x%x\t\tuc_ccode \t0x%x\t\tfrag_age \t0x%04x",
47 : : cpth->w3.hw_ccode, cpth->w3.uc_ccode, cpth->w3.frag_age);
48 [ # # ]: 0 : cpt_dump(file, "W3: pf_func \t0x%x\t\trlen \t0x%x \t", cpth->w3.pf_func, cpth->w3.rlen);
49 : :
50 : : /* W4 */
51 [ # # ]: 0 : cpt_dump(file, "W4: l4_chksum \t0x%x\t\tl4_chksum_type \t0x%x", cpth->w4.l4_chksum,
52 : : cpth->w4.l4_chksum_type);
53 [ # # ]: 0 : cpt_dump(file, "W4: channel \t0x%x\t\tsctr_size \t0x%08x\t\tgthr_size \t0x%08x",
54 : : cpth->w4.channel, cpth->w4.sctr_size, cpth->w4.gthr_size);
55 : :
56 : : /* offset of 0 implies 256B, otherwise it implies offset*32B */
57 : 0 : offset = cpth->w2.ptr_offset;
58 : 0 : offset = (((offset - 1) & 0x7) + 1) * 32;
59 : 0 : frag_info = PLT_PTR_ADD(cpth, offset);
60 : :
61 [ # # ]: 0 : if (cpth->w0.num_frags > 0) {
62 [ # # ]: 0 : cpt_dump(file, "CPT Fraginfo_0 \t%p:", frag_info);
63 : :
64 : : /* W0 */
65 [ # # ]: 0 : cpt_dump(file, "W0: f0.info \t0x%x", frag_info->w0.f0.info);
66 [ # # ]: 0 : cpt_dump(file, "W0: f1.info \t0x%x", frag_info->w0.f1.info);
67 [ # # ]: 0 : cpt_dump(file, "W0: f2.info \t0x%x", frag_info->w0.f2.info);
68 [ # # ]: 0 : cpt_dump(file, "W0: f3.info \t0x%x", frag_info->w0.f3.info);
69 : :
70 : : /* W1 */
71 [ # # ]: 0 : cpt_dump(file, "W1: frag_size0 \t0x%x", frag_info->w1.frag_size0);
72 [ # # ]: 0 : cpt_dump(file, "W1: frag_size1 \t0x%x", frag_info->w1.frag_size1);
73 [ # # ]: 0 : cpt_dump(file, "W1: frag_size2 \t0x%x", frag_info->w1.frag_size2);
74 [ # # ]: 0 : cpt_dump(file, "W1: frag_size3 \t0x%x", frag_info->w1.frag_size3);
75 : :
76 : 0 : frag_info++;
77 : : }
78 : :
79 [ # # ]: 0 : if (cpth->w0.num_frags > 4) {
80 [ # # ]: 0 : cpt_dump(file, "CPT Fraginfo_1 \t%p:", frag_info);
81 : :
82 : : /* W0 */
83 [ # # ]: 0 : cpt_dump(file, "W0: f4.info \t0x%x", frag_info->w0.f0.info);
84 [ # # ]: 0 : cpt_dump(file, "W0: f5.info \t0x%x", frag_info->w0.f1.info);
85 [ # # ]: 0 : cpt_dump(file, "W0: f6.info \t0x%x", frag_info->w0.f2.info);
86 [ # # ]: 0 : cpt_dump(file, "W0: f7.info \t0x%x", frag_info->w0.f3.info);
87 : :
88 : : /* W1 */
89 [ # # ]: 0 : cpt_dump(file, "W1: frag_size4 \t0x%x", frag_info->w1.frag_size0);
90 [ # # ]: 0 : cpt_dump(file, "W1: frag_size5 \t0x%x", frag_info->w1.frag_size1);
91 [ # # ]: 0 : cpt_dump(file, "W1: frag_size6 \t0x%x", frag_info->w1.frag_size2);
92 [ # # ]: 0 : cpt_dump(file, "W1: frag_size7 \t0x%x", frag_info->w1.frag_size3);
93 : :
94 : 0 : frag_info++;
95 : : }
96 : :
97 : : rxc_sg = (const struct cpt_rxc_sg_s *)frag_info;
98 [ # # ]: 0 : for (i = 0; i < cpth->w4.sctr_size; i++) {
99 [ # # ]: 0 : cpt_dump(file, "CPT RXC SC SGS \t%p:", rxc_sg);
100 [ # # ]: 0 : cpt_dump(file, "W0: seg1_size \t0x%x\t\tseg2_size \t0x%x\t\tseg3_size \t0x%04x",
101 : : rxc_sg->w0.seg1_size, rxc_sg->w0.seg2_size, rxc_sg->w0.seg3_size);
102 [ # # ]: 0 : cpt_dump(file, "W0: segs \t0x%x\t\tnxt_fst_frag \t0x%x\t\tblk_sz \t0x%x",
103 : : rxc_sg->w0.segs, rxc_sg->w0.nxt_fst_frag, rxc_sg->w0.blk_sz);
104 [ # # ]: 0 : cpt_dump(file, "W1: seg1_ptr \t0x%" PRIx64, rxc_sg->seg1_ptr);
105 [ # # ]: 0 : cpt_dump(file, "W2: seg2_ptr \t0x%" PRIx64, rxc_sg->seg2_ptr);
106 [ # # ]: 0 : cpt_dump(file, "W3: seg3_ptr \t0x%" PRIx64, rxc_sg->seg3_ptr);
107 : :
108 : 0 : rxc_sg++;
109 : : }
110 : :
111 [ # # ]: 0 : for (i = 0; i < cpth->w4.gthr_size; i++) {
112 [ # # ]: 0 : cpt_dump(file, "CPT RXC GT SGS \t0x%p:", rxc_sg);
113 [ # # ]: 0 : cpt_dump(file, "W0: seg1_size \t0x%x\t\tseg2_size \t0x%x\t\tseg3_size \t0x%04x",
114 : : rxc_sg->w0.seg1_size, rxc_sg->w0.seg2_size, rxc_sg->w0.seg3_size);
115 [ # # ]: 0 : cpt_dump(file, "W0: segs \t0x%x\t\tnxt_fst_frag \t0x%x\t\tblk_sz \t0x%x",
116 : : rxc_sg->w0.segs, rxc_sg->w0.nxt_fst_frag, rxc_sg->w0.blk_sz);
117 [ # # ]: 0 : cpt_dump(file, "W1: seg1_ptr \t0x%" PRIx64, rxc_sg->seg1_ptr);
118 [ # # ]: 0 : cpt_dump(file, "W2: seg2_ptr \t0x%" PRIx64, rxc_sg->seg2_ptr);
119 [ # # ]: 0 : cpt_dump(file, "W3: seg3_ptr \t0x%" PRIx64, rxc_sg->seg3_ptr);
120 : :
121 : 0 : rxc_sg++;
122 : : }
123 : 0 : }
124 : :
125 : : static inline void
126 : 0 : cpt_cn10k_parse_hdr_dump(FILE *file, const struct cpt_cn10k_parse_hdr_s *cpth)
127 : : {
128 : : const struct cpt_cn10k_frag_info_s *frag_info;
129 : : uint32_t offset;
130 : : const uint64_t *slot;
131 : :
132 [ # # ]: 0 : cpt_dump(file, "CPT_PARSE \t0x%p:", cpth);
133 : :
134 : : /* W0 */
135 [ # # ]: 0 : cpt_dump(file, "W0: cookie \t0x%x\t\tmatch_id \t0x%04x \t",
136 : : cpth->w0.cookie, cpth->w0.match_id);
137 [ # # ]: 0 : cpt_dump(file, "W0: err_sum \t%u \t", cpth->w0.err_sum);
138 [ # # ]: 0 : cpt_dump(file, "W0: reas_sts \t0x%x\t\tet_owr \t%u\t\tpkt_fmt \t%u \t", cpth->w0.reas_sts,
139 : : cpth->w0.et_owr, cpth->w0.pkt_fmt);
140 [ # # ]: 0 : cpt_dump(file, "W0: pad_len \t%u\t\tnum_frags \t%u\t\tpkt_out \t%u \t", cpth->w0.pad_len,
141 : : cpth->w0.num_frags, cpth->w0.pkt_out);
142 : :
143 : : /* W1 */
144 [ # # # # : 0 : cpt_dump(file, "W1: wqe_ptr \t0x%016" PRIx64 "\t",
# # ]
145 : : (uint64_t)plt_be_to_cpu_64(cpth->wqe_ptr));
146 : :
147 : : /* W2 */
148 [ # # ]: 0 : cpt_dump(file, "W2: frag_age \t0x%x\t\torig_pf_func \t0x%04x", cpth->w2.frag_age,
149 : : cpth->w2.orig_pf_func);
150 [ # # ]: 0 : cpt_dump(file, "W2: il3_off \t0x%x\t\tfi_pad \t0x%x \t", cpth->w2.il3_off, cpth->w2.fi_pad);
151 [ # # ]: 0 : cpt_dump(file, "W2: fi_offset \t0x%x \t", cpth->w2.fi_offset);
152 : :
153 : : /* W3 */
154 [ # # ]: 0 : cpt_dump(file, "W3: hw_ccode \t0x%x\t\tuc_ccode \t0x%x\t\tspi \t0x%08x", cpth->w3.hw_ccode,
155 : : cpth->w3.uc_ccode, cpth->w3.spi);
156 : :
157 : : /* W4 */
158 [ # # # # : 0 : cpt_dump(file, "W4: esn \t%" PRIx64 " \t OR frag1_wqe_ptr \t0x%" PRIx64, cpth->esn,
# # ]
159 : : (uint64_t)plt_be_to_cpu_64(cpth->frag1_wqe_ptr));
160 : :
161 : : /* offset of 0 implies 256B, otherwise it implies offset*8B */
162 : 0 : offset = cpth->w2.fi_offset;
163 : 0 : offset = (((offset - 1) & 0x1f) + 1) * 8;
164 : 0 : frag_info = PLT_PTR_ADD(cpth, offset);
165 : :
166 [ # # ]: 0 : cpt_dump(file, "CPT Fraginfo \t0x%p:", frag_info);
167 : :
168 : : /* W0 */
169 [ # # ]: 0 : cpt_dump(file, "W0: f0.info \t0x%x", frag_info->w0.f0.info);
170 [ # # ]: 0 : cpt_dump(file, "W0: f1.info \t0x%x", frag_info->w0.f1.info);
171 [ # # ]: 0 : cpt_dump(file, "W0: f2.info \t0x%x", frag_info->w0.f2.info);
172 [ # # ]: 0 : cpt_dump(file, "W0: f3.info \t0x%x", frag_info->w0.f3.info);
173 : :
174 : : /* W1 */
175 [ # # ]: 0 : cpt_dump(file, "W1: frag_size0 \t0x%x", frag_info->w1.frag_size0);
176 [ # # ]: 0 : cpt_dump(file, "W1: frag_size1 \t0x%x", frag_info->w1.frag_size1);
177 [ # # ]: 0 : cpt_dump(file, "W1: frag_size2 \t0x%x", frag_info->w1.frag_size2);
178 [ # # ]: 0 : cpt_dump(file, "W1: frag_size3 \t0x%x", frag_info->w1.frag_size3);
179 : :
180 : : slot = (const uint64_t *)(frag_info + 1);
181 [ # # # # : 0 : cpt_dump(file, "Frag Slot2: WQE ptr \t%p", (void *)plt_be_to_cpu_64(slot[0]));
# # ]
182 [ # # # # : 0 : cpt_dump(file, "Frag Slot3: WQE ptr \t%p", (void *)plt_be_to_cpu_64(slot[1]));
# # ]
183 : 0 : }
184 : :
185 : : void
186 [ # # ]: 0 : roc_cpt_parse_hdr_dump(FILE *file, const union cpt_parse_hdr_u *cpth)
187 : : {
188 [ # # ]: 0 : if (roc_model_is_cn10k())
189 : 0 : cpt_cn10k_parse_hdr_dump(file, &cpth->cn10k);
190 : : else
191 : 0 : cpt_cnxk_parse_hdr_dump(file, &cpth->s);
192 : 0 : }
193 : :
194 : : void
195 : 0 : roc_cpt_cq_dump(FILE *file, const struct cpt_cq_s *cq)
196 : : {
197 [ # # ]: 0 : cpt_dump(file, "CPT_CQ \t%p:", cq);
198 : :
199 : : /* W0 */
200 [ # # ]: 0 : cpt_dump(file, "W0: compcode \t0x%x\t\tdoneint \t%u\t", cq->w0.s.compcode,
201 : : cq->w0.s.doneint);
202 [ # # ]: 0 : cpt_dump(file, "W0: uc_compcode \t0x%x\t\tuc_info \t0%" PRIu64, cq->w0.s.uc_compcode,
203 : : (uint64_t)cq->w0.s.uc_info);
204 : :
205 : : /* W1 */
206 [ # # ]: 0 : cpt_dump(file, "W1: esn \t%" PRIx64 "\t\n", cq->w1.esn);
207 : :
208 : : /* W2 */
209 [ # # ]: 0 : cpt_dump(file, "W2: fmt \t0x%x\t\tuc_info2 \t%" PRIu64, cq->w2.s.fmt,
210 : : (uint64_t)cq->w2.s.uc_info2);
211 : :
212 : : /* W3 */
213 [ # # ]: 0 : cpt_dump(file, "W3: comp_ptr \t0x%" PRIx64 "\t\n", cq->w3.comp_ptr);
214 : 0 : }
215 : :
216 : : static int
217 : 0 : cpt_af_reg_read(struct roc_cpt *roc_cpt, uint64_t reg, uint64_t *val)
218 : : {
219 : : struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
220 : : struct cpt_rd_wr_reg_msg *msg;
221 : : struct dev *dev = &cpt->dev;
222 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
223 : : int ret;
224 : :
225 : 0 : msg = mbox_alloc_msg_cpt_rd_wr_register(mbox);
226 [ # # ]: 0 : if (msg == NULL) {
227 : : ret = -EIO;
228 : 0 : goto exit;
229 : : }
230 : :
231 : 0 : msg->hdr.pcifunc = dev->pf_func;
232 : :
233 : 0 : msg->is_write = 0;
234 : 0 : msg->reg_offset = reg;
235 : 0 : msg->ret_val = val;
236 : :
237 : 0 : ret = mbox_process_msg(dev->mbox, (void *)&msg);
238 [ # # ]: 0 : if (ret) {
239 : : ret = -EIO;
240 : 0 : goto exit;
241 : : }
242 : :
243 : 0 : *val = msg->val;
244 : :
245 : : ret = 0;
246 : 0 : exit:
247 : : mbox_put(mbox);
248 : 0 : return ret;
249 : : }
250 : :
251 : : static int
252 : 0 : cpt_sts_print(struct roc_cpt *roc_cpt)
253 : : {
254 : : struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
255 : : struct dev *dev = &cpt->dev;
256 : : struct cpt_sts_req *req;
257 : : struct cpt_sts_rsp *rsp;
258 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
259 : : int ret;
260 : :
261 : 0 : req = mbox_alloc_msg_cpt_sts_get(mbox);
262 [ # # ]: 0 : if (req == NULL) {
263 : : ret = -EIO;
264 : 0 : goto exit;
265 : : }
266 : :
267 : 0 : req->blkaddr = 0;
268 : 0 : ret = mbox_process_msg(dev->mbox, (void *)&rsp);
269 [ # # ]: 0 : if (ret) {
270 : : ret = -EIO;
271 : 0 : goto exit;
272 : : }
273 : :
274 : 0 : plt_print(" %s:\t0x%016" PRIx64, "inst_req_pc", rsp->inst_req_pc);
275 : 0 : plt_print(" %s:\t0x%016" PRIx64, "inst_lat_pc", rsp->inst_lat_pc);
276 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "rd_req_pc", rsp->rd_req_pc);
277 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "rd_lat_pc", rsp->rd_lat_pc);
278 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "rd_uc_pc", rsp->rd_uc_pc);
279 : 0 : plt_print(" %s:\t0x%016" PRIx64, "active_cycles_pc",
280 : : rsp->active_cycles_pc);
281 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_mis_pc", rsp->ctx_mis_pc);
282 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_hit_pc", rsp->ctx_hit_pc);
283 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_aop_pc", rsp->ctx_aop_pc);
284 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_aop_lat_pc",
285 : : rsp->ctx_aop_lat_pc);
286 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_ifetch_pc",
287 : : rsp->ctx_ifetch_pc);
288 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_ifetch_lat_pc",
289 : : rsp->ctx_ifetch_lat_pc);
290 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_ffetch_pc",
291 : : rsp->ctx_ffetch_pc);
292 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_ffetch_lat_pc",
293 : : rsp->ctx_ffetch_lat_pc);
294 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_wback_pc", rsp->ctx_wback_pc);
295 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_wback_lat_pc",
296 : : rsp->ctx_wback_lat_pc);
297 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_psh_pc", rsp->ctx_psh_pc);
298 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_psh_lat_pc",
299 : : rsp->ctx_psh_lat_pc);
300 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_err", rsp->ctx_err);
301 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_enc_id", rsp->ctx_enc_id);
302 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_flush_timer",
303 : : rsp->ctx_flush_timer);
304 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "rxc_time", rsp->rxc_time);
305 : 0 : plt_print(" %s:\t0x%016" PRIx64, "rxc_time_cfg", rsp->rxc_time_cfg);
306 : 0 : plt_print(" %s:\t0x%016" PRIx64, "rxc_active_sts",
307 : : rsp->rxc_active_sts);
308 : 0 : plt_print(" %s:\t0x%016" PRIx64, "rxc_zombie_sts",
309 : : rsp->rxc_zombie_sts);
310 : 0 : plt_print(" %s:\t0x%016" PRIx64, "rxc_dfrg", rsp->rxc_dfrg);
311 : 0 : plt_print(" %s:\t0x%016" PRIx64, "x2p_link_cfg0",
312 : : rsp->x2p_link_cfg0);
313 : 0 : plt_print(" %s:\t0x%016" PRIx64, "x2p_link_cfg1",
314 : : rsp->x2p_link_cfg1);
315 : 0 : plt_print(" %s:\t0x%016" PRIx64, "busy_sts_ae", rsp->busy_sts_ae);
316 : 0 : plt_print(" %s:\t0x%016" PRIx64, "free_sts_ae", rsp->free_sts_ae);
317 : 0 : plt_print(" %s:\t0x%016" PRIx64, "busy_sts_se", rsp->busy_sts_se);
318 : 0 : plt_print(" %s:\t0x%016" PRIx64, "free_sts_se", rsp->free_sts_se);
319 : 0 : plt_print(" %s:\t0x%016" PRIx64, "busy_sts_ie", rsp->busy_sts_ie);
320 : 0 : plt_print(" %s:\t0x%016" PRIx64, "free_sts_ie", rsp->free_sts_ie);
321 : 0 : plt_print(" %s:\t0x%016" PRIx64, "exe_err_info", rsp->exe_err_info);
322 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "cptclk_cnt", rsp->cptclk_cnt);
323 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "diag", rsp->diag);
324 : :
325 : : ret = 0;
326 : 0 : exit:
327 : : mbox_put(mbox);
328 : 0 : return ret;
329 : : }
330 : :
331 : : int
332 : 0 : roc_cpt_afs_print(struct roc_cpt *roc_cpt)
333 : : {
334 : : uint64_t reg_val;
335 : :
336 : 0 : plt_print("CPT AF registers:");
337 : :
338 [ # # ]: 0 : if (cpt_af_reg_read(roc_cpt, CPT_AF_LFX_CTL(0), ®_val))
339 : : return -EIO;
340 : :
341 : 0 : plt_print(" CPT_AF_LF0_CTL:\t0x%016" PRIx64, reg_val);
342 : :
343 [ # # ]: 0 : if (cpt_af_reg_read(roc_cpt, CPT_AF_LFX_CTL2(0), ®_val))
344 : : return -EIO;
345 : :
346 : 0 : plt_print(" CPT_AF_LF0_CTL2:\t0x%016" PRIx64, reg_val);
347 : :
348 : 0 : cpt_sts_print(roc_cpt);
349 : :
350 : 0 : return 0;
351 : : }
352 : :
353 : : void
354 : 0 : cpt_lf_print(struct roc_cpt_lf *lf)
355 : : {
356 : : uint64_t reg_val;
357 : :
358 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_Q_BASE);
359 : 0 : plt_print(" CPT_LF_Q_BASE:\t%016lx", reg_val);
360 : :
361 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_Q_SIZE);
362 : 0 : plt_print(" CPT_LF_Q_SIZE:\t%016lx", reg_val);
363 : :
364 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_Q_INST_PTR);
365 : 0 : plt_print(" CPT_LF_Q_INST_PTR:\t%016lx", reg_val);
366 : :
367 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_Q_GRP_PTR);
368 : 0 : plt_print(" CPT_LF_Q_GRP_PTR:\t%016lx", reg_val);
369 : :
370 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTL);
371 : 0 : plt_print(" CPT_LF_CTL:\t%016lx", reg_val);
372 : :
373 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_MISC_INT_ENA_W1S);
374 : 0 : plt_print(" CPT_LF_MISC_INT_ENA_W1S:\t%016lx", reg_val);
375 : :
376 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_MISC_INT);
377 : 0 : plt_print(" CPT_LF_MISC_INT:\t%016lx", reg_val);
378 : :
379 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_INPROG);
380 : 0 : plt_print(" CPT_LF_INPROG:\t%016lx", reg_val);
381 : :
382 [ # # ]: 0 : if (roc_model_is_cn9k())
383 : : return;
384 : :
385 : 0 : plt_print("Count registers for CPT LF%d:", lf->lf_id);
386 : :
387 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTX_ENC_BYTE_CNT);
388 : 0 : plt_print(" Encrypted byte count:\t%" PRIu64, reg_val);
389 : :
390 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTX_ENC_PKT_CNT);
391 : 0 : plt_print(" Encrypted packet count:\t%" PRIu64, reg_val);
392 : :
393 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTX_DEC_BYTE_CNT);
394 : 0 : plt_print(" Decrypted byte count:\t%" PRIu64, reg_val);
395 : :
396 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTX_DEC_PKT_CNT);
397 : 0 : plt_print(" Decrypted packet count:\t%" PRIu64, reg_val);
398 : : }
399 : :
400 : : int
401 : 0 : roc_cpt_lfs_print(struct roc_cpt *roc_cpt)
402 : : {
403 : : struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
404 : : struct roc_cpt_lf *lf;
405 : : int lf_id;
406 : :
407 : : if (cpt == NULL)
408 : : return -EINVAL;
409 : :
410 [ # # ]: 0 : for (lf_id = 0; lf_id < roc_cpt->nb_lf; lf_id++) {
411 : 0 : lf = roc_cpt->lf[lf_id];
412 [ # # ]: 0 : if (lf == NULL)
413 : 0 : continue;
414 : :
415 : 0 : cpt_lf_print(lf);
416 : : }
417 : :
418 : : return 0;
419 : : }
|