LCOV - code coverage report
Current view: top level - drivers/common/cnxk - roc_cpt_debug.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 192 0.0 %
Date: 2025-04-03 19:37:06 Functions: 0 8 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 176 0.0 %

           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%016lx\t", cpth->wqe_ptr);
      37                 :            : 
      38                 :            :         /* W2 */
      39         [ #  # ]:          0 :         cpt_dump(file, "W2: pkt_inline \t0x%x\t\tnew_pkt_aura \t0x%x\t\torig_pkt_aura \t0x%x",
      40                 :            :                  cpth->w2.pkt_inline, cpth->w2.new_pkt_aura, 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*8B */
      57                 :          0 :         offset = cpth->w2.ptr_offset;
      58                 :          0 :         offset = (((offset - 1) & 0x1f) + 1) * 8;
      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_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",
     139                 :            :                   cpth->w0.reas_sts, 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",
     141                 :            :                   cpth->w0.pad_len, cpth->w0.num_frags, cpth->w0.pkt_out);
     142                 :            : 
     143                 :            :         /* W1 */
     144   [ #  #  #  #  :          0 :         cpt_dump(file, "W1: wqe_ptr \t0x%016lx\t",
                   #  # ]
     145                 :            :                         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",
     149                 :            :                   cpth->w2.frag_age, cpth->w2.orig_pf_func);
     150         [ #  # ]:          0 :         cpt_dump(file, "W2: il3_off \t0x%x\t\tfi_pad \t0x%x \t",
     151                 :            :                   cpth->w2.il3_off, cpth->w2.fi_pad);
     152         [ #  # ]:          0 :         cpt_dump(file, "W2: fi_offset \t0x%x \t", cpth->w2.fi_offset);
     153                 :            : 
     154                 :            :         /* W3 */
     155         [ #  # ]:          0 :         cpt_dump(file, "W3: hw_ccode \t0x%x\t\tuc_ccode \t0x%x\t\tspi \t0x%08x",
     156                 :            :                   cpth->w3.hw_ccode, cpth->w3.uc_ccode, cpth->w3.spi);
     157                 :            : 
     158                 :            :         /* W4 */
     159   [ #  #  #  #  :          0 :         cpt_dump(file, "W4: esn \t%" PRIx64 " \t OR frag1_wqe_ptr \t0x%" PRIx64,
                   #  # ]
     160                 :            :                   cpth->esn, plt_be_to_cpu_64(cpth->frag1_wqe_ptr));
     161                 :            : 
     162                 :            :         /* offset of 0 implies 256B, otherwise it implies offset*8B */
     163                 :          0 :         offset = cpth->w2.fi_offset;
     164                 :          0 :         offset = (((offset - 1) & 0x1f) + 1) * 8;
     165                 :          0 :         frag_info = PLT_PTR_ADD(cpth, offset);
     166                 :            : 
     167         [ #  # ]:          0 :         cpt_dump(file, "CPT Fraginfo \t0x%p:", frag_info);
     168                 :            : 
     169                 :            :         /* W0 */
     170         [ #  # ]:          0 :         cpt_dump(file, "W0: f0.info \t0x%x", frag_info->w0.f0.info);
     171         [ #  # ]:          0 :         cpt_dump(file, "W0: f1.info \t0x%x", frag_info->w0.f1.info);
     172         [ #  # ]:          0 :         cpt_dump(file, "W0: f2.info \t0x%x", frag_info->w0.f2.info);
     173         [ #  # ]:          0 :         cpt_dump(file, "W0: f3.info \t0x%x", frag_info->w0.f3.info);
     174                 :            : 
     175                 :            :         /* W1 */
     176         [ #  # ]:          0 :         cpt_dump(file, "W1: frag_size0 \t0x%x", frag_info->w1.frag_size0);
     177         [ #  # ]:          0 :         cpt_dump(file, "W1: frag_size1 \t0x%x", frag_info->w1.frag_size1);
     178         [ #  # ]:          0 :         cpt_dump(file, "W1: frag_size2 \t0x%x", frag_info->w1.frag_size2);
     179         [ #  # ]:          0 :         cpt_dump(file, "W1: frag_size3 \t0x%x", frag_info->w1.frag_size3);
     180                 :            : 
     181                 :            :         slot = (uint64_t *)(frag_info + 1);
     182   [ #  #  #  #  :          0 :         cpt_dump(file, "Frag Slot2:  WQE ptr \t%p", (void *)plt_be_to_cpu_64(slot[0]));
                   #  # ]
     183   [ #  #  #  #  :          0 :         cpt_dump(file, "Frag Slot3:  WQE ptr \t%p", (void *)plt_be_to_cpu_64(slot[1]));
                   #  # ]
     184                 :          0 : }
     185                 :            : 
     186                 :            : void
     187         [ #  # ]:          0 : roc_cpt_parse_hdr_dump(FILE *file, const union cpt_parse_hdr_u *cpth)
     188                 :            : {
     189         [ #  # ]:          0 :         if (roc_model_is_cn10k())
     190                 :          0 :                 cpt_cn10k_parse_hdr_dump(file, &cpth->cn10k);
     191                 :            :         else
     192                 :          0 :                 cpt_cnxk_parse_hdr_dump(file, &cpth->s);
     193                 :          0 : }
     194                 :            : 
     195                 :            : static int
     196                 :          0 : cpt_af_reg_read(struct roc_cpt *roc_cpt, uint64_t reg, uint64_t *val)
     197                 :            : {
     198                 :            :         struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
     199                 :            :         struct cpt_rd_wr_reg_msg *msg;
     200                 :            :         struct dev *dev = &cpt->dev;
     201                 :          0 :         struct mbox *mbox = mbox_get(dev->mbox);
     202                 :            :         int ret;
     203                 :            : 
     204                 :          0 :         msg = mbox_alloc_msg_cpt_rd_wr_register(mbox);
     205         [ #  # ]:          0 :         if (msg == NULL) {
     206                 :            :                 ret = -EIO;
     207                 :          0 :                 goto exit;
     208                 :            :         }
     209                 :            : 
     210                 :          0 :         msg->hdr.pcifunc = dev->pf_func;
     211                 :            : 
     212                 :          0 :         msg->is_write = 0;
     213                 :          0 :         msg->reg_offset = reg;
     214                 :          0 :         msg->ret_val = val;
     215                 :            : 
     216                 :          0 :         ret = mbox_process_msg(dev->mbox, (void *)&msg);
     217         [ #  # ]:          0 :         if (ret) {
     218                 :            :                 ret =  -EIO;
     219                 :          0 :                 goto exit;
     220                 :            :         }
     221                 :            : 
     222                 :          0 :         *val = msg->val;
     223                 :            : 
     224                 :            :         ret = 0;
     225                 :          0 : exit:
     226                 :            :         mbox_put(mbox);
     227                 :          0 :         return ret;
     228                 :            : }
     229                 :            : 
     230                 :            : static int
     231                 :          0 : cpt_sts_print(struct roc_cpt *roc_cpt)
     232                 :            : {
     233                 :            :         struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
     234                 :            :         struct dev *dev = &cpt->dev;
     235                 :            :         struct cpt_sts_req *req;
     236                 :            :         struct cpt_sts_rsp *rsp;
     237                 :          0 :         struct mbox *mbox = mbox_get(dev->mbox);
     238                 :            :         int ret;
     239                 :            : 
     240                 :          0 :         req = mbox_alloc_msg_cpt_sts_get(mbox);
     241         [ #  # ]:          0 :         if (req == NULL) {
     242                 :            :                 ret = -EIO;
     243                 :          0 :                 goto exit;
     244                 :            :         }
     245                 :            : 
     246                 :          0 :         req->blkaddr = 0;
     247                 :          0 :         ret = mbox_process_msg(dev->mbox, (void *)&rsp);
     248         [ #  # ]:          0 :         if (ret) {
     249                 :            :                 ret = -EIO;
     250                 :          0 :                 goto exit;
     251                 :            :         }
     252                 :            : 
     253                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "inst_req_pc", rsp->inst_req_pc);
     254                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "inst_lat_pc", rsp->inst_lat_pc);
     255                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "rd_req_pc", rsp->rd_req_pc);
     256                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "rd_lat_pc", rsp->rd_lat_pc);
     257                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "rd_uc_pc", rsp->rd_uc_pc);
     258                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "active_cycles_pc",
     259                 :            :                   rsp->active_cycles_pc);
     260                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "ctx_mis_pc", rsp->ctx_mis_pc);
     261                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "ctx_hit_pc", rsp->ctx_hit_pc);
     262                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "ctx_aop_pc", rsp->ctx_aop_pc);
     263                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "ctx_aop_lat_pc",
     264                 :            :                   rsp->ctx_aop_lat_pc);
     265                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "ctx_ifetch_pc",
     266                 :            :                   rsp->ctx_ifetch_pc);
     267                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "ctx_ifetch_lat_pc",
     268                 :            :                   rsp->ctx_ifetch_lat_pc);
     269                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "ctx_ffetch_pc",
     270                 :            :                   rsp->ctx_ffetch_pc);
     271                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "ctx_ffetch_lat_pc",
     272                 :            :                   rsp->ctx_ffetch_lat_pc);
     273                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "ctx_wback_pc", rsp->ctx_wback_pc);
     274                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "ctx_wback_lat_pc",
     275                 :            :                   rsp->ctx_wback_lat_pc);
     276                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "ctx_psh_pc", rsp->ctx_psh_pc);
     277                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "ctx_psh_lat_pc",
     278                 :            :                   rsp->ctx_psh_lat_pc);
     279                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "ctx_err", rsp->ctx_err);
     280                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "ctx_enc_id", rsp->ctx_enc_id);
     281                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "ctx_flush_timer",
     282                 :            :                   rsp->ctx_flush_timer);
     283                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "rxc_time", rsp->rxc_time);
     284                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "rxc_time_cfg", rsp->rxc_time_cfg);
     285                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "rxc_active_sts",
     286                 :            :                   rsp->rxc_active_sts);
     287                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "rxc_zombie_sts",
     288                 :            :                   rsp->rxc_zombie_sts);
     289                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "rxc_dfrg", rsp->rxc_dfrg);
     290                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "x2p_link_cfg0",
     291                 :            :                   rsp->x2p_link_cfg0);
     292                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "x2p_link_cfg1",
     293                 :            :                   rsp->x2p_link_cfg1);
     294                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "busy_sts_ae", rsp->busy_sts_ae);
     295                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "free_sts_ae", rsp->free_sts_ae);
     296                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "busy_sts_se", rsp->busy_sts_se);
     297                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "free_sts_se", rsp->free_sts_se);
     298                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "busy_sts_ie", rsp->busy_sts_ie);
     299                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "free_sts_ie", rsp->free_sts_ie);
     300                 :          0 :         plt_print("    %s:\t0x%016" PRIx64, "exe_err_info", rsp->exe_err_info);
     301                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "cptclk_cnt", rsp->cptclk_cnt);
     302                 :          0 :         plt_print("    %s:\t\t0x%016" PRIx64, "diag", rsp->diag);
     303                 :            : 
     304                 :            :         ret = 0;
     305                 :          0 : exit:
     306                 :            :         mbox_put(mbox);
     307                 :          0 :         return ret;
     308                 :            : }
     309                 :            : 
     310                 :            : int
     311                 :          0 : roc_cpt_afs_print(struct roc_cpt *roc_cpt)
     312                 :            : {
     313                 :            :         uint64_t reg_val;
     314                 :            : 
     315                 :          0 :         plt_print("CPT AF registers:");
     316                 :            : 
     317         [ #  # ]:          0 :         if (cpt_af_reg_read(roc_cpt, CPT_AF_LFX_CTL(0), &reg_val))
     318                 :            :                 return -EIO;
     319                 :            : 
     320                 :          0 :         plt_print("    CPT_AF_LF0_CTL:\t0x%016" PRIx64, reg_val);
     321                 :            : 
     322         [ #  # ]:          0 :         if (cpt_af_reg_read(roc_cpt, CPT_AF_LFX_CTL2(0), &reg_val))
     323                 :            :                 return -EIO;
     324                 :            : 
     325                 :          0 :         plt_print("    CPT_AF_LF0_CTL2:\t0x%016" PRIx64, reg_val);
     326                 :            : 
     327                 :          0 :         cpt_sts_print(roc_cpt);
     328                 :            : 
     329                 :          0 :         return 0;
     330                 :            : }
     331                 :            : 
     332                 :            : void
     333                 :          0 : cpt_lf_print(struct roc_cpt_lf *lf)
     334                 :            : {
     335                 :            :         uint64_t reg_val;
     336                 :            : 
     337                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_Q_BASE);
     338                 :          0 :         plt_print("    CPT_LF_Q_BASE:\t%016lx", reg_val);
     339                 :            : 
     340                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_Q_SIZE);
     341                 :          0 :         plt_print("    CPT_LF_Q_SIZE:\t%016lx", reg_val);
     342                 :            : 
     343                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_Q_INST_PTR);
     344                 :          0 :         plt_print("    CPT_LF_Q_INST_PTR:\t%016lx", reg_val);
     345                 :            : 
     346                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_Q_GRP_PTR);
     347                 :          0 :         plt_print("    CPT_LF_Q_GRP_PTR:\t%016lx", reg_val);
     348                 :            : 
     349                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_CTL);
     350                 :          0 :         plt_print("    CPT_LF_CTL:\t%016lx", reg_val);
     351                 :            : 
     352                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_MISC_INT_ENA_W1S);
     353                 :          0 :         plt_print("    CPT_LF_MISC_INT_ENA_W1S:\t%016lx", reg_val);
     354                 :            : 
     355                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_MISC_INT);
     356                 :          0 :         plt_print("    CPT_LF_MISC_INT:\t%016lx", reg_val);
     357                 :            : 
     358                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_INPROG);
     359                 :          0 :         plt_print("    CPT_LF_INPROG:\t%016lx", reg_val);
     360                 :            : 
     361         [ #  # ]:          0 :         if (roc_model_is_cn9k())
     362                 :            :                 return;
     363                 :            : 
     364                 :          0 :         plt_print("Count registers for CPT LF%d:", lf->lf_id);
     365                 :            : 
     366                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_CTX_ENC_BYTE_CNT);
     367                 :          0 :         plt_print("    Encrypted byte count:\t%" PRIu64, reg_val);
     368                 :            : 
     369                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_CTX_ENC_PKT_CNT);
     370                 :          0 :         plt_print("    Encrypted packet count:\t%" PRIu64, reg_val);
     371                 :            : 
     372                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_CTX_DEC_BYTE_CNT);
     373                 :          0 :         plt_print("    Decrypted byte count:\t%" PRIu64, reg_val);
     374                 :            : 
     375                 :          0 :         reg_val = plt_read64(lf->rbase + CPT_LF_CTX_DEC_PKT_CNT);
     376                 :          0 :         plt_print("    Decrypted packet count:\t%" PRIu64, reg_val);
     377                 :            : }
     378                 :            : 
     379                 :            : int
     380                 :          0 : roc_cpt_lfs_print(struct roc_cpt *roc_cpt)
     381                 :            : {
     382                 :            :         struct cpt *cpt = roc_cpt_to_cpt_priv(roc_cpt);
     383                 :            :         struct roc_cpt_lf *lf;
     384                 :            :         int lf_id;
     385                 :            : 
     386                 :            :         if (cpt == NULL)
     387                 :            :                 return -EINVAL;
     388                 :            : 
     389         [ #  # ]:          0 :         for (lf_id = 0; lf_id < roc_cpt->nb_lf; lf_id++) {
     390                 :          0 :                 lf = roc_cpt->lf[lf_id];
     391         [ #  # ]:          0 :                 if (lf == NULL)
     392                 :          0 :                         continue;
     393                 :            : 
     394                 :          0 :                 cpt_lf_print(lf);
     395                 :            :         }
     396                 :            : 
     397                 :            :         return 0;
     398                 :            : }

Generated by: LCOV version 1.14