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 : : struct cpt_frag_info_s *frag_info;
20 : : 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 = (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 : : struct cpt_cn10k_frag_info_s *frag_info;
129 : : uint32_t offset;
130 : : 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 = (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 : : static int
195 : 0 : cpt_af_reg_read(struct roc_cpt *roc_cpt, uint64_t reg, uint64_t *val)
196 : : {
197 : : struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
198 : : struct cpt_rd_wr_reg_msg *msg;
199 : : struct dev *dev = &cpt->dev;
200 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
201 : : int ret;
202 : :
203 : 0 : msg = mbox_alloc_msg_cpt_rd_wr_register(mbox);
204 [ # # ]: 0 : if (msg == NULL) {
205 : : ret = -EIO;
206 : 0 : goto exit;
207 : : }
208 : :
209 : 0 : msg->hdr.pcifunc = dev->pf_func;
210 : :
211 : 0 : msg->is_write = 0;
212 : 0 : msg->reg_offset = reg;
213 : 0 : msg->ret_val = val;
214 : :
215 : 0 : ret = mbox_process_msg(dev->mbox, (void *)&msg);
216 [ # # ]: 0 : if (ret) {
217 : : ret = -EIO;
218 : 0 : goto exit;
219 : : }
220 : :
221 : 0 : *val = msg->val;
222 : :
223 : : ret = 0;
224 : 0 : exit:
225 : : mbox_put(mbox);
226 : 0 : return ret;
227 : : }
228 : :
229 : : static int
230 : 0 : cpt_sts_print(struct roc_cpt *roc_cpt)
231 : : {
232 : : struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
233 : : struct dev *dev = &cpt->dev;
234 : : struct cpt_sts_req *req;
235 : : struct cpt_sts_rsp *rsp;
236 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
237 : : int ret;
238 : :
239 : 0 : req = mbox_alloc_msg_cpt_sts_get(mbox);
240 [ # # ]: 0 : if (req == NULL) {
241 : : ret = -EIO;
242 : 0 : goto exit;
243 : : }
244 : :
245 : 0 : req->blkaddr = 0;
246 : 0 : ret = mbox_process_msg(dev->mbox, (void *)&rsp);
247 [ # # ]: 0 : if (ret) {
248 : : ret = -EIO;
249 : 0 : goto exit;
250 : : }
251 : :
252 : 0 : plt_print(" %s:\t0x%016" PRIx64, "inst_req_pc", rsp->inst_req_pc);
253 : 0 : plt_print(" %s:\t0x%016" PRIx64, "inst_lat_pc", rsp->inst_lat_pc);
254 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "rd_req_pc", rsp->rd_req_pc);
255 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "rd_lat_pc", rsp->rd_lat_pc);
256 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "rd_uc_pc", rsp->rd_uc_pc);
257 : 0 : plt_print(" %s:\t0x%016" PRIx64, "active_cycles_pc",
258 : : rsp->active_cycles_pc);
259 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_mis_pc", rsp->ctx_mis_pc);
260 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_hit_pc", rsp->ctx_hit_pc);
261 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_aop_pc", rsp->ctx_aop_pc);
262 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_aop_lat_pc",
263 : : rsp->ctx_aop_lat_pc);
264 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_ifetch_pc",
265 : : rsp->ctx_ifetch_pc);
266 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_ifetch_lat_pc",
267 : : rsp->ctx_ifetch_lat_pc);
268 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_ffetch_pc",
269 : : rsp->ctx_ffetch_pc);
270 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_ffetch_lat_pc",
271 : : rsp->ctx_ffetch_lat_pc);
272 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_wback_pc", rsp->ctx_wback_pc);
273 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_wback_lat_pc",
274 : : rsp->ctx_wback_lat_pc);
275 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_psh_pc", rsp->ctx_psh_pc);
276 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_psh_lat_pc",
277 : : rsp->ctx_psh_lat_pc);
278 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_err", rsp->ctx_err);
279 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "ctx_enc_id", rsp->ctx_enc_id);
280 : 0 : plt_print(" %s:\t0x%016" PRIx64, "ctx_flush_timer",
281 : : rsp->ctx_flush_timer);
282 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "rxc_time", rsp->rxc_time);
283 : 0 : plt_print(" %s:\t0x%016" PRIx64, "rxc_time_cfg", rsp->rxc_time_cfg);
284 : 0 : plt_print(" %s:\t0x%016" PRIx64, "rxc_active_sts",
285 : : rsp->rxc_active_sts);
286 : 0 : plt_print(" %s:\t0x%016" PRIx64, "rxc_zombie_sts",
287 : : rsp->rxc_zombie_sts);
288 : 0 : plt_print(" %s:\t0x%016" PRIx64, "rxc_dfrg", rsp->rxc_dfrg);
289 : 0 : plt_print(" %s:\t0x%016" PRIx64, "x2p_link_cfg0",
290 : : rsp->x2p_link_cfg0);
291 : 0 : plt_print(" %s:\t0x%016" PRIx64, "x2p_link_cfg1",
292 : : rsp->x2p_link_cfg1);
293 : 0 : plt_print(" %s:\t0x%016" PRIx64, "busy_sts_ae", rsp->busy_sts_ae);
294 : 0 : plt_print(" %s:\t0x%016" PRIx64, "free_sts_ae", rsp->free_sts_ae);
295 : 0 : plt_print(" %s:\t0x%016" PRIx64, "busy_sts_se", rsp->busy_sts_se);
296 : 0 : plt_print(" %s:\t0x%016" PRIx64, "free_sts_se", rsp->free_sts_se);
297 : 0 : plt_print(" %s:\t0x%016" PRIx64, "busy_sts_ie", rsp->busy_sts_ie);
298 : 0 : plt_print(" %s:\t0x%016" PRIx64, "free_sts_ie", rsp->free_sts_ie);
299 : 0 : plt_print(" %s:\t0x%016" PRIx64, "exe_err_info", rsp->exe_err_info);
300 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "cptclk_cnt", rsp->cptclk_cnt);
301 : 0 : plt_print(" %s:\t\t0x%016" PRIx64, "diag", rsp->diag);
302 : :
303 : : ret = 0;
304 : 0 : exit:
305 : : mbox_put(mbox);
306 : 0 : return ret;
307 : : }
308 : :
309 : : int
310 : 0 : roc_cpt_afs_print(struct roc_cpt *roc_cpt)
311 : : {
312 : : uint64_t reg_val;
313 : :
314 : 0 : plt_print("CPT AF registers:");
315 : :
316 [ # # ]: 0 : if (cpt_af_reg_read(roc_cpt, CPT_AF_LFX_CTL(0), ®_val))
317 : : return -EIO;
318 : :
319 : 0 : plt_print(" CPT_AF_LF0_CTL:\t0x%016" PRIx64, reg_val);
320 : :
321 [ # # ]: 0 : if (cpt_af_reg_read(roc_cpt, CPT_AF_LFX_CTL2(0), ®_val))
322 : : return -EIO;
323 : :
324 : 0 : plt_print(" CPT_AF_LF0_CTL2:\t0x%016" PRIx64, reg_val);
325 : :
326 : 0 : cpt_sts_print(roc_cpt);
327 : :
328 : 0 : return 0;
329 : : }
330 : :
331 : : void
332 : 0 : cpt_lf_print(struct roc_cpt_lf *lf)
333 : : {
334 : : uint64_t reg_val;
335 : :
336 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_Q_BASE);
337 : 0 : plt_print(" CPT_LF_Q_BASE:\t%016lx", reg_val);
338 : :
339 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_Q_SIZE);
340 : 0 : plt_print(" CPT_LF_Q_SIZE:\t%016lx", reg_val);
341 : :
342 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_Q_INST_PTR);
343 : 0 : plt_print(" CPT_LF_Q_INST_PTR:\t%016lx", reg_val);
344 : :
345 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_Q_GRP_PTR);
346 : 0 : plt_print(" CPT_LF_Q_GRP_PTR:\t%016lx", reg_val);
347 : :
348 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTL);
349 : 0 : plt_print(" CPT_LF_CTL:\t%016lx", reg_val);
350 : :
351 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_MISC_INT_ENA_W1S);
352 : 0 : plt_print(" CPT_LF_MISC_INT_ENA_W1S:\t%016lx", reg_val);
353 : :
354 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_MISC_INT);
355 : 0 : plt_print(" CPT_LF_MISC_INT:\t%016lx", reg_val);
356 : :
357 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_INPROG);
358 : 0 : plt_print(" CPT_LF_INPROG:\t%016lx", reg_val);
359 : :
360 [ # # ]: 0 : if (roc_model_is_cn9k())
361 : : return;
362 : :
363 : 0 : plt_print("Count registers for CPT LF%d:", lf->lf_id);
364 : :
365 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTX_ENC_BYTE_CNT);
366 : 0 : plt_print(" Encrypted byte count:\t%" PRIu64, reg_val);
367 : :
368 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTX_ENC_PKT_CNT);
369 : 0 : plt_print(" Encrypted packet count:\t%" PRIu64, reg_val);
370 : :
371 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTX_DEC_BYTE_CNT);
372 : 0 : plt_print(" Decrypted byte count:\t%" PRIu64, reg_val);
373 : :
374 : 0 : reg_val = plt_read64(lf->rbase + CPT_LF_CTX_DEC_PKT_CNT);
375 : 0 : plt_print(" Decrypted packet count:\t%" PRIu64, reg_val);
376 : : }
377 : :
378 : : int
379 : 0 : roc_cpt_lfs_print(struct roc_cpt *roc_cpt)
380 : : {
381 : : struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
382 : : struct roc_cpt_lf *lf;
383 : : int lf_id;
384 : :
385 : : if (cpt == NULL)
386 : : return -EINVAL;
387 : :
388 [ # # ]: 0 : for (lf_id = 0; lf_id < roc_cpt->nb_lf; lf_id++) {
389 : 0 : lf = roc_cpt->lf[lf_id];
390 [ # # ]: 0 : if (lf == NULL)
391 : 0 : continue;
392 : :
393 : 0 : cpt_lf_print(lf);
394 : : }
395 : :
396 : : return 0;
397 : : }
|