LCOV - code coverage report
Current view: top level - drivers/common/cnxk - roc_nix_debug.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 910 0.0 %
Date: 2024-12-01 18:57:19 Functions: 0 28 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 1195 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                 :            : 
       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         [ #  # ]:          0 :         nix_dump(file, "W0: sqe_way_mask \t\t%d\nW0: cq \t\t\t\t%d",
     544                 :            :                  ctx->sqe_way_mask, ctx->cq);
     545         [ #  # ]:          0 :         nix_dump(file, "W0: sdp_mcast \t\t\t%d\nW0: substream \t\t\t0x%03x",
     546                 :            :                  ctx->sdp_mcast, ctx->substream);
     547         [ #  # ]:          0 :         nix_dump(file, "W0: qint_idx \t\t\t%d\nW0: ena \t\t\t%d\n", ctx->qint_idx,
     548                 :            :                  ctx->ena);
     549                 :            : 
     550         [ #  # ]:          0 :         nix_dump(file, "W1: sqb_count \t\t\t%d\nW1: default_chan \t\t%d",
     551                 :            :                  ctx->sqb_count, ctx->default_chan);
     552         [ #  # ]:          0 :         nix_dump(file, "W1: smq_rr_weight \t\t%d\nW1: sso_ena \t\t\t%d",
     553                 :            :                  ctx->smq_rr_weight, ctx->sso_ena);
     554         [ #  # ]:          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",
     555                 :            :                  ctx->xoff, ctx->cq_ena, ctx->smq);
     556                 :            : 
     557         [ #  # ]:          0 :         nix_dump(file, "W2: sqe_stype \t\t\t%d\nW2: sq_int_ena \t\t\t%d",
     558                 :            :                  ctx->sqe_stype, ctx->sq_int_ena);
     559         [ #  # ]:          0 :         nix_dump(file, "W2: sq_int  \t\t\t%d\nW2: sqb_aura \t\t\t%d", ctx->sq_int,
     560                 :            :                  ctx->sqb_aura);
     561         [ #  # ]:          0 :         nix_dump(file, "W2: smq_rr_count[ub:lb] \t\t%x:%x\n", ctx->smq_rr_count_ub,
     562                 :            :                  ctx->smq_rr_count_lb);
     563                 :            : 
     564         [ #  # ]:          0 :         nix_dump(file, "W3: smq_next_sq_vld\t\t%d\nW3: smq_pend\t\t\t%d",
     565                 :            :                  ctx->smq_next_sq_vld, ctx->smq_pend);
     566         [ #  # ]:          0 :         nix_dump(file, "W3: smenq_next_sqb_vld  \t%d\nW3: head_offset\t\t\t%d",
     567                 :            :                  ctx->smenq_next_sqb_vld, ctx->head_offset);
     568         [ #  # ]:          0 :         nix_dump(file, "W3: smenq_offset\t\t%d\nW3: tail_offset \t\t%d",
     569                 :            :                  ctx->smenq_offset, ctx->tail_offset);
     570         [ #  # ]:          0 :         nix_dump(file, "W3: smq_lso_segnum \t\t%d\nW3: smq_next_sq \t\t%d",
     571                 :            :                  ctx->smq_lso_segnum, ctx->smq_next_sq);
     572         [ #  # ]:          0 :         nix_dump(file, "W3: mnq_dis \t\t\t%d\nW3: lmt_dis \t\t\t%d", ctx->mnq_dis,
     573                 :            :                  ctx->lmt_dis);
     574         [ #  # ]:          0 :         nix_dump(file, "W3: cq_limit\t\t\t%d\nW3: max_sqe_size\t\t%d\n",
     575                 :            :                  ctx->cq_limit, ctx->max_sqe_size);
     576                 :            : 
     577         [ #  # ]:          0 :         nix_dump(file, "W4: next_sqb \t\t\t0x%" PRIx64 "", ctx->next_sqb);
     578         [ #  # ]:          0 :         nix_dump(file, "W5: tail_sqb \t\t\t0x%" PRIx64 "", ctx->tail_sqb);
     579         [ #  # ]:          0 :         nix_dump(file, "W6: smenq_sqb \t\t\t0x%" PRIx64 "", ctx->smenq_sqb);
     580         [ #  # ]:          0 :         nix_dump(file, "W7: smenq_next_sqb \t\t0x%" PRIx64 "", ctx->smenq_next_sqb);
     581         [ #  # ]:          0 :         nix_dump(file, "W8: head_sqb \t\t\t0x%" PRIx64 "", ctx->head_sqb);
     582                 :            : 
     583         [ #  # ]:          0 :         nix_dump(file, "W9: vfi_lso_vld \t\t%d\nW9: vfi_lso_vlan1_ins_ena\t%d", ctx->vfi_lso_vld,
     584                 :            :                  ctx->vfi_lso_vlan1_ins_ena);
     585         [ #  # ]:          0 :         nix_dump(file, "W9: vfi_lso_vlan0_ins_ena\t%d\nW9: vfi_lso_mps\t\t\t%d",
     586                 :            :                  ctx->vfi_lso_vlan0_ins_ena, ctx->vfi_lso_mps);
     587         [ #  # ]:          0 :         nix_dump(file, "W9: vfi_lso_sb \t\t\t%d\nW9: vfi_lso_sizem1\t\t%d", ctx->vfi_lso_sb,
     588                 :            :                  ctx->vfi_lso_sizem1);
     589         [ #  # ]:          0 :         nix_dump(file, "W9: vfi_lso_total\t\t%d", ctx->vfi_lso_total);
     590                 :            : 
     591         [ #  # ]:          0 :         nix_dump(file, "W10: scm_lso_rem \t\t0x%" PRIx64 "", (uint64_t)ctx->scm_lso_rem);
     592         [ #  # ]:          0 :         nix_dump(file, "W11: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
     593         [ #  # ]:          0 :         nix_dump(file, "W12: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
     594         [ #  # ]:          0 :         nix_dump(file, "W13: aged_drop_pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->aged_drop_pkts);
     595         [ #  # ]:          0 :         nix_dump(file, "W13: aged_drop_octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->aged_drop_octs);
     596         [ #  # ]:          0 :         nix_dump(file, "W14: dropped_octs \t\t0x%" PRIx64 "", (uint64_t)ctx->drop_octs);
     597         [ #  # ]:          0 :         nix_dump(file, "W15: dropped_pkts \t\t0x%" PRIx64 "", (uint64_t)ctx->drop_pkts);
     598                 :            : 
     599                 :          0 :         *sqb_aura_p = ctx->sqb_aura;
     600                 :          0 : }
     601                 :            : 
     602                 :            : static inline void
     603                 :          0 : nix_cn9k_lf_rq_dump(__io struct nix_rq_ctx_s *ctx, FILE *file)
     604                 :            : {
     605         [ #  # ]:          0 :         nix_dump(file, "W0: wqe_aura \t\t\t%d\nW0: substream \t\t\t0x%03x",
     606                 :            :                  ctx->wqe_aura, ctx->substream);
     607         [ #  # ]:          0 :         nix_dump(file, "W0: cq \t\t\t\t%d\nW0: ena_wqwd \t\t\t%d", ctx->cq,
     608                 :            :                  ctx->ena_wqwd);
     609         [ #  # ]:          0 :         nix_dump(file, "W0: ipsech_ena \t\t\t%d\nW0: sso_ena \t\t\t%d",
     610                 :            :                  ctx->ipsech_ena, ctx->sso_ena);
     611         [ #  # ]:          0 :         nix_dump(file, "W0: ena \t\t\t%d\n", ctx->ena);
     612                 :            : 
     613         [ #  # ]:          0 :         nix_dump(file, "W1: lpb_drop_ena \t\t%d\nW1: spb_drop_ena \t\t%d",
     614                 :            :                  ctx->lpb_drop_ena, ctx->spb_drop_ena);
     615         [ #  # ]:          0 :         nix_dump(file, "W1: xqe_drop_ena \t\t%d\nW1: wqe_caching \t\t%d",
     616                 :            :                  ctx->xqe_drop_ena, ctx->wqe_caching);
     617         [ #  # ]:          0 :         nix_dump(file, "W1: pb_caching \t\t\t%d\nW1: sso_tt \t\t\t%d",
     618                 :            :                  ctx->pb_caching, ctx->sso_tt);
     619         [ #  # ]:          0 :         nix_dump(file, "W1: sso_grp \t\t\t%d\nW1: lpb_aura \t\t\t%d", ctx->sso_grp,
     620                 :            :                  ctx->lpb_aura);
     621         [ #  # ]:          0 :         nix_dump(file, "W1: spb_aura \t\t\t%d\n", ctx->spb_aura);
     622                 :            : 
     623         [ #  # ]:          0 :         nix_dump(file, "W2: xqe_hdr_split \t\t%d\nW2: xqe_imm_copy \t\t%d",
     624                 :            :                  ctx->xqe_hdr_split, ctx->xqe_imm_copy);
     625         [ #  # ]:          0 :         nix_dump(file, "W2: xqe_imm_size \t\t%d\nW2: later_skip \t\t\t%d",
     626                 :            :                  ctx->xqe_imm_size, ctx->later_skip);
     627         [ #  # ]:          0 :         nix_dump(file, "W2: first_skip \t\t\t%d\nW2: lpb_sizem1 \t\t\t%d",
     628                 :            :                  ctx->first_skip, ctx->lpb_sizem1);
     629         [ #  # ]:          0 :         nix_dump(file, "W2: spb_ena \t\t\t%d\nW2: wqe_skip \t\t\t%d", ctx->spb_ena,
     630                 :            :                  ctx->wqe_skip);
     631         [ #  # ]:          0 :         nix_dump(file, "W2: spb_sizem1 \t\t\t%d\n", ctx->spb_sizem1);
     632                 :            : 
     633         [ #  # ]:          0 :         nix_dump(file, "W3: spb_pool_pass \t\t%d\nW3: spb_pool_drop \t\t%d",
     634                 :            :                  ctx->spb_pool_pass, ctx->spb_pool_drop);
     635         [ #  # ]:          0 :         nix_dump(file, "W3: spb_aura_pass \t\t%d\nW3: spb_aura_drop \t\t%d",
     636                 :            :                  ctx->spb_aura_pass, ctx->spb_aura_drop);
     637         [ #  # ]:          0 :         nix_dump(file, "W3: wqe_pool_pass \t\t%d\nW3: wqe_pool_drop \t\t%d",
     638                 :            :                  ctx->wqe_pool_pass, ctx->wqe_pool_drop);
     639         [ #  # ]:          0 :         nix_dump(file, "W3: xqe_pass \t\t\t%d\nW3: xqe_drop \t\t\t%d\n",
     640                 :            :                  ctx->xqe_pass, ctx->xqe_drop);
     641                 :            : 
     642         [ #  # ]:          0 :         nix_dump(file, "W4: qint_idx \t\t\t%d\nW4: rq_int_ena \t\t\t%d",
     643                 :            :                  ctx->qint_idx, ctx->rq_int_ena);
     644         [ #  # ]:          0 :         nix_dump(file, "W4: rq_int \t\t\t%d\nW4: lpb_pool_pass \t\t%d", ctx->rq_int,
     645                 :            :                  ctx->lpb_pool_pass);
     646         [ #  # ]:          0 :         nix_dump(file, "W4: lpb_pool_drop \t\t%d\nW4: lpb_aura_pass \t\t%d",
     647                 :            :                  ctx->lpb_pool_drop, ctx->lpb_aura_pass);
     648         [ #  # ]:          0 :         nix_dump(file, "W4: lpb_aura_drop \t\t%d\n", ctx->lpb_aura_drop);
     649                 :            : 
     650         [ #  # ]:          0 :         nix_dump(file, "W5: flow_tagw \t\t\t%d\nW5: bad_utag \t\t\t%d",
     651                 :            :                  ctx->flow_tagw, ctx->bad_utag);
     652         [ #  # ]:          0 :         nix_dump(file, "W5: good_utag \t\t\t%d\nW5: ltag \t\t\t%d\n", ctx->good_utag,
     653                 :            :                  ctx->ltag);
     654                 :            : 
     655         [ #  # ]:          0 :         nix_dump(file, "W6: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
     656         [ #  # ]:          0 :         nix_dump(file, "W7: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
     657         [ #  # ]:          0 :         nix_dump(file, "W8: drop_octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_octs);
     658         [ #  # ]:          0 :         nix_dump(file, "W9: drop_pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_pkts);
     659         [ #  # ]:          0 :         nix_dump(file, "W10: re_pkts \t\t\t0x%" PRIx64 "\n", (uint64_t)ctx->re_pkts);
     660                 :          0 : }
     661                 :            : 
     662                 :            : void
     663                 :          0 : nix_cn10k_lf_rq_dump(__io struct nix_cn10k_rq_ctx_s *ctx, FILE *file)
     664                 :            : {
     665         [ #  # ]:          0 :         nix_dump(file, "W0: wqe_aura \t\t\t%d\nW0: len_ol3_dis \t\t\t%d",
     666                 :            :                  ctx->wqe_aura, ctx->len_ol3_dis);
     667         [ #  # ]:          0 :         nix_dump(file, "W0: len_ol4_dis \t\t\t%d\nW0: len_il3_dis \t\t\t%d",
     668                 :            :                  ctx->len_ol4_dis, ctx->len_il3_dis);
     669         [ #  # ]:          0 :         nix_dump(file, "W0: len_il4_dis \t\t\t%d\nW0: csum_ol4_dis \t\t\t%d",
     670                 :            :                  ctx->len_il4_dis, ctx->csum_ol4_dis);
     671         [ #  # ]:          0 :         nix_dump(file, "W0: csum_ol3_dis \t\t\t%d\nW0: lenerr_dis \t\t\t%d",
     672                 :            :                  ctx->csum_ol4_dis, ctx->lenerr_dis);
     673         [ #  # ]:          0 :         nix_dump(file, "W0: cq \t\t\t\t%d\nW0: ena_wqwd \t\t\t%d", ctx->cq,
     674                 :            :                  ctx->ena_wqwd);
     675         [ #  # ]:          0 :         nix_dump(file, "W0: ipsech_ena \t\t\t%d\nW0: sso_ena \t\t\t%d",
     676                 :            :                  ctx->ipsech_ena, ctx->sso_ena);
     677         [ #  # ]:          0 :         nix_dump(file, "W0: ena \t\t\t%d\n", ctx->ena);
     678                 :            : 
     679         [ #  # ]:          0 :         nix_dump(file, "W1: chi_ena \t\t%d\nW1: ipsecd_drop_en \t\t%d", ctx->chi_ena,
     680                 :            :                  ctx->ipsecd_drop_en);
     681         [ #  # ]:          0 :         nix_dump(file, "W1: pb_stashing \t\t\t%d", ctx->pb_stashing);
     682         [ #  # ]:          0 :         nix_dump(file, "W1: lpb_drop_ena \t\t%d\nW1: spb_drop_ena \t\t%d",
     683                 :            :                  ctx->lpb_drop_ena, ctx->spb_drop_ena);
     684         [ #  # ]:          0 :         nix_dump(file, "W1: xqe_drop_ena \t\t%d\nW1: wqe_caching \t\t%d",
     685                 :            :                  ctx->xqe_drop_ena, ctx->wqe_caching);
     686         [ #  # ]:          0 :         nix_dump(file, "W1: pb_caching \t\t\t%d\nW1: sso_tt \t\t\t%d",
     687                 :            :                  ctx->pb_caching, ctx->sso_tt);
     688         [ #  # ]:          0 :         nix_dump(file, "W1: sso_grp \t\t\t%d\nW1: lpb_aura \t\t\t%d", ctx->sso_grp,
     689                 :            :                  ctx->lpb_aura);
     690         [ #  # ]:          0 :         nix_dump(file, "W1: spb_aura \t\t\t%d\n", ctx->spb_aura);
     691                 :            : 
     692         [ #  # ]:          0 :         nix_dump(file, "W2: xqe_hdr_split \t\t%d\nW2: xqe_imm_copy \t\t%d",
     693                 :            :                  ctx->xqe_hdr_split, ctx->xqe_imm_copy);
     694         [ #  # ]:          0 :         nix_dump(file, "W2: xqe_imm_size \t\t%d\nW2: later_skip \t\t\t%d",
     695                 :            :                  ctx->xqe_imm_size, ctx->later_skip);
     696         [ #  # ]:          0 :         nix_dump(file, "W2: first_skip \t\t\t%d\nW2: lpb_sizem1 \t\t\t%d",
     697                 :            :                  ctx->first_skip, ctx->lpb_sizem1);
     698         [ #  # ]:          0 :         nix_dump(file, "W2: spb_ena \t\t\t%d\nW2: wqe_skip \t\t\t%d", ctx->spb_ena,
     699                 :            :                  ctx->wqe_skip);
     700         [ #  # ]:          0 :         nix_dump(file, "W2: spb_sizem1 \t\t\t%d\nW2: policer_ena \t\t\t%d",
     701                 :            :                  ctx->spb_sizem1, ctx->policer_ena);
     702         [ #  # ]:          0 :         nix_dump(file, "W2: band_prof_id \t\t\t%d", ctx->band_prof_id);
     703                 :            : 
     704         [ #  # ]:          0 :         nix_dump(file, "W3: spb_pool_pass \t\t%d\nW3: spb_pool_drop \t\t%d",
     705                 :            :                  ctx->spb_pool_pass, ctx->spb_pool_drop);
     706         [ #  # ]:          0 :         nix_dump(file, "W3: spb_aura_pass \t\t%d\nW3: spb_aura_drop \t\t%d",
     707                 :            :                  ctx->spb_aura_pass, ctx->spb_aura_drop);
     708         [ #  # ]:          0 :         nix_dump(file, "W3: wqe_pool_pass \t\t%d\nW3: wqe_pool_drop \t\t%d",
     709                 :            :                  ctx->wqe_pool_pass, ctx->wqe_pool_drop);
     710         [ #  # ]:          0 :         nix_dump(file, "W3: xqe_pass \t\t\t%d\nW3: xqe_drop \t\t\t%d\n",
     711                 :            :                  ctx->xqe_pass, ctx->xqe_drop);
     712                 :            : 
     713         [ #  # ]:          0 :         nix_dump(file, "W4: qint_idx \t\t\t%d\nW4: rq_int_ena \t\t\t%d",
     714                 :            :                  ctx->qint_idx, ctx->rq_int_ena);
     715         [ #  # ]:          0 :         nix_dump(file, "W4: rq_int \t\t\t%d\nW4: lpb_pool_pass \t\t%d", ctx->rq_int,
     716                 :            :                  ctx->lpb_pool_pass);
     717         [ #  # ]:          0 :         nix_dump(file, "W4: lpb_pool_drop \t\t%d\nW4: lpb_aura_pass \t\t%d",
     718                 :            :                  ctx->lpb_pool_drop, ctx->lpb_aura_pass);
     719         [ #  # ]:          0 :         nix_dump(file, "W4: lpb_aura_drop \t\t%d\n", ctx->lpb_aura_drop);
     720                 :            : 
     721         [ #  # ]:          0 :         nix_dump(file, "W5: vwqe_skip \t\t\t%d\nW5: max_vsize_exp \t\t\t%d",
     722                 :            :                  ctx->vwqe_skip, ctx->max_vsize_exp);
     723         [ #  # ]:          0 :         nix_dump(file, "W5: vtime_wait \t\t\t%d\nW5: vwqe_ena \t\t\t%d",
     724                 :            :                  ctx->vtime_wait, ctx->max_vsize_exp);
     725         [ #  # ]:          0 :         nix_dump(file, "W5: ipsec_vwqe \t\t\t%d", ctx->ipsec_vwqe);
     726         [ #  # ]:          0 :         nix_dump(file, "W5: flow_tagw \t\t\t%d\nW5: bad_utag \t\t\t%d",
     727                 :            :                  ctx->flow_tagw, ctx->bad_utag);
     728         [ #  # ]:          0 :         nix_dump(file, "W5: good_utag \t\t\t%d\nW5: ltag \t\t\t%d\n", ctx->good_utag,
     729                 :            :                  ctx->ltag);
     730                 :            : 
     731         [ #  # ]:          0 :         nix_dump(file, "W6: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
     732         [ #  # ]:          0 :         nix_dump(file, "W7: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
     733         [ #  # ]:          0 :         nix_dump(file, "W8: drop_octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_octs);
     734         [ #  # ]:          0 :         nix_dump(file, "W9: drop_pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_pkts);
     735         [ #  # ]:          0 :         nix_dump(file, "W10: re_pkts \t\t\t0x%" PRIx64 "\n", (uint64_t)ctx->re_pkts);
     736                 :          0 : }
     737                 :            : 
     738                 :            : void
     739                 :          0 : nix_lf_rq_dump(__io struct nix_cn20k_rq_ctx_s *ctx, FILE *file)
     740                 :            : {
     741         [ #  # ]:          0 :         nix_dump(file, "W0: wqe_aura \t\t\t%d\nW0: len_ol3_dis \t\t\t%d",
     742                 :            :                  ctx->wqe_aura, ctx->len_ol3_dis);
     743         [ #  # ]:          0 :         nix_dump(file, "W0: len_ol4_dis \t\t\t%d\nW0: len_il3_dis \t\t\t%d",
     744                 :            :                  ctx->len_ol4_dis, ctx->len_il3_dis);
     745         [ #  # ]:          0 :         nix_dump(file, "W0: len_il4_dis \t\t\t%d\nW0: csum_ol4_dis \t\t\t%d",
     746                 :            :                  ctx->len_il4_dis, ctx->csum_ol4_dis);
     747         [ #  # ]:          0 :         nix_dump(file, "W0: csum_il4_dis \t\t\t%d\nW0: lenerr_dis \t\t\t%d",
     748                 :            :                  ctx->csum_il4_dis, ctx->lenerr_dis);
     749         [ #  # ]:          0 :         nix_dump(file, "W0: port_ol4_dis \t\t\t%d\nW0: port_il4_dis\t\t\t%d",
     750                 :            :                  ctx->port_ol4_dis, ctx->port_il4_dis);
     751         [ #  # ]:          0 :         nix_dump(file, "W0: cq \t\t\t\t%d\nW0: ena_wqwd \t\t\t%d", ctx->cq,
     752                 :            :                  ctx->ena_wqwd);
     753         [ #  # ]:          0 :         nix_dump(file, "W0: ipsech_ena \t\t\t%d\nW0: sso_ena \t\t\t%d",
     754                 :            :                  ctx->ipsech_ena, ctx->sso_ena);
     755         [ #  # ]:          0 :         nix_dump(file, "W0: ena \t\t\t%d\n", ctx->ena);
     756                 :            : 
     757         [ #  # ]:          0 :         nix_dump(file, "W1: chi_ena \t\t%d\nW1: ipsecd_drop_en \t\t%d", ctx->chi_ena,
     758                 :            :                  ctx->ipsecd_drop_en);
     759         [ #  # ]:          0 :         nix_dump(file, "W1: pb_stashing \t\t\t%d", ctx->pb_stashing);
     760         [ #  # ]:          0 :         nix_dump(file, "W1: lpb_drop_ena \t\t%d\nW1: spb_drop_ena \t\t%d",
     761                 :            :                  ctx->lpb_drop_ena, ctx->spb_drop_ena);
     762         [ #  # ]:          0 :         nix_dump(file, "W1: xqe_drop_ena \t\t%d\nW1: wqe_caching \t\t%d",
     763                 :            :                  ctx->xqe_drop_ena, ctx->wqe_caching);
     764         [ #  # ]:          0 :         nix_dump(file, "W1: pb_caching \t\t\t%d\nW1: sso_tt \t\t\t%d",
     765                 :            :                  ctx->pb_caching, ctx->sso_tt);
     766         [ #  # ]:          0 :         nix_dump(file, "W1: sso_grp \t\t\t%d\nW1: lpb_aura \t\t\t%d", ctx->sso_grp,
     767                 :            :                  ctx->lpb_aura);
     768         [ #  # ]:          0 :         nix_dump(file, "W1: spb_aura \t\t\t%d\n", ctx->spb_aura);
     769                 :            : 
     770         [ #  # ]:          0 :         nix_dump(file, "W2: xqe_hdr_split \t\t%d\nW2: xqe_imm_copy \t\t%d",
     771                 :            :                  ctx->xqe_hdr_split, ctx->xqe_imm_copy);
     772         [ #  # ]:          0 :         nix_dump(file, "W2: band_prof_id\t\t%d\n",
     773                 :            :                  ((ctx->band_prof_id_h << 10) | ctx->band_prof_id_l));
     774         [ #  # ]:          0 :         nix_dump(file, "W2: xqe_imm_size \t\t%d\nW2: later_skip \t\t\t%d",
     775                 :            :                  ctx->xqe_imm_size, ctx->later_skip);
     776         [ #  # ]:          0 :         nix_dump(file, "W2: sso_bp_ena\t\t%d\n", ctx->sso_bp_ena);
     777         [ #  # ]:          0 :         nix_dump(file, "W2: first_skip \t\t\t%d\nW2: lpb_sizem1 \t\t\t%d",
     778                 :            :                  ctx->first_skip, ctx->lpb_sizem1);
     779         [ #  # ]:          0 :         nix_dump(file, "W2: spb_ena \t\t\t%d\nW2: spb_high_sizem1 \t\t\t%d", ctx->spb_ena,
     780                 :            :                  ctx->spb_high_sizem1);
     781         [ #  # ]:          0 :         nix_dump(file, "W2: wqe_skip \t\t\t%d", ctx->wqe_skip);
     782         [ #  # ]:          0 :         nix_dump(file, "W2: spb_sizem1 \t\t\t%d\nW2: policer_ena \t\t\t%d",
     783                 :            :                  ctx->spb_sizem1, ctx->policer_ena);
     784         [ #  # ]:          0 :         nix_dump(file, "W2: sso_fc_ena \t\t\t%d\n", ctx->sso_fc_ena);
     785                 :            : 
     786         [ #  # ]:          0 :         nix_dump(file, "W3: spb_pool_pass \t\t%d\nW3: spb_pool_drop \t\t%d",
     787                 :            :                  ctx->spb_pool_pass, ctx->spb_pool_drop);
     788         [ #  # ]:          0 :         nix_dump(file, "W3: spb_aura_pass \t\t%d\nW3: spb_aura_drop \t\t%d",
     789                 :            :                  ctx->spb_aura_pass, ctx->spb_aura_drop);
     790         [ #  # ]:          0 :         nix_dump(file, "W3: wqe_pool_pass \t\t%d\nW3: wqe_pool_drop \t\t%d",
     791                 :            :                  ctx->wqe_pool_pass, ctx->wqe_pool_drop);
     792         [ #  # ]:          0 :         nix_dump(file, "W3: xqe_pass \t\t\t%d\nW3: xqe_drop \t\t\t%d\n",
     793                 :            :                  ctx->xqe_pass, ctx->xqe_drop);
     794                 :            : 
     795         [ #  # ]:          0 :         nix_dump(file, "W4: qint_idx \t\t\t%d\nW4: rq_int_ena \t\t\t%d",
     796                 :            :                  ctx->qint_idx, ctx->rq_int_ena);
     797         [ #  # ]:          0 :         nix_dump(file, "W4: rq_int \t\t\t%d\nW4: lpb_pool_pass \t\t%d", ctx->rq_int,
     798                 :            :                  ctx->lpb_pool_pass);
     799         [ #  # ]:          0 :         nix_dump(file, "W4: lpb_pool_drop \t\t%d\nW4: lpb_aura_pass \t\t%d",
     800                 :            :                  ctx->lpb_pool_drop, ctx->lpb_aura_pass);
     801         [ #  # ]:          0 :         nix_dump(file, "W4: lpb_aura_drop \t\t%d\n", ctx->lpb_aura_drop);
     802                 :            : 
     803         [ #  # ]:          0 :         nix_dump(file, "W5: flow_tagw \t\t\t%d\nW5: bad_utag \t\t\t%d",
     804                 :            :                  ctx->flow_tagw, ctx->bad_utag);
     805         [ #  # ]:          0 :         nix_dump(file, "W5: good_utag \t\t\t%d\nW5: ltag \t\t\t%d\n", ctx->good_utag,
     806                 :            :                  ctx->ltag);
     807                 :            : 
     808         [ #  # ]:          0 :         nix_dump(file, "W6: octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->octs);
     809         [ #  # ]:          0 :         nix_dump(file, "W7: pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->pkts);
     810         [ #  # ]:          0 :         nix_dump(file, "W8: drop_octs \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_octs);
     811         [ #  # ]:          0 :         nix_dump(file, "W9: drop_pkts \t\t\t0x%" PRIx64 "", (uint64_t)ctx->drop_pkts);
     812         [ #  # ]:          0 :         nix_dump(file, "W10: re_pkts \t\t\t0x%" PRIx64 "\n", (uint64_t)ctx->re_pkts);
     813                 :          0 : }
     814                 :            : 
     815                 :            : static inline void
     816                 :          0 : nix_cn20k_lf_cq_dump(__io struct nix_cn20k_cq_ctx_s *ctx, FILE *file)
     817                 :            : {
     818         [ #  # ]:          0 :         nix_dump(file, "W0: base \t\t\t0x%" PRIx64 "\n", ctx->base);
     819                 :            : 
     820         [ #  # ]:          0 :         nix_dump(file, "W1: wrptr \t\t\t%" PRIx64 "", (uint64_t)ctx->wrptr);
     821         [ #  # ]:          0 :         nix_dump(file, "W1: avg_con \t\t\t%d\nW1: cint_idx \t\t\t%d", ctx->avg_con,
     822                 :            :                  ctx->cint_idx);
     823         [ #  # ]:          0 :         nix_dump(file, "W1: cq_err \t\t\t%d\nW1: qint_idx \t\t\t%d", ctx->cq_err,
     824                 :            :                  ctx->qint_idx);
     825         [ #  # ]:          0 :         nix_dump(file, "W1: bpid  \t\t\t%d\nW1: bp_ena \t\t\t%d\n", ctx->bpid,
     826                 :            :                  ctx->bp_ena);
     827         [ #  # ]:          0 :         nix_dump(file,
     828                 :            :                  "W1: lbpid_high \t\t\t0x%03x\nW1: lbpid_med \t\t\t0x%03x\n"
     829                 :            :                  "W1: lbpid_low \t\t\t0x%03x\n(W1: lbpid) \t\t\t0x%03x\n",
     830                 :            :                  ctx->lbpid_high, ctx->lbpid_med, ctx->lbpid_low, (unsigned int)
     831                 :            :                  (ctx->lbpid_high << 6 | ctx->lbpid_med << 3 | ctx->lbpid_low));
     832         [ #  # ]:          0 :         nix_dump(file, "W1: lbp_ena \t\t\t\t%d\n", ctx->lbp_ena);
     833                 :            : 
     834         [ #  # ]:          0 :         nix_dump(file, "W2: update_time \t\t%d\nW2: avg_level \t\t\t%d",
     835                 :            :                  ctx->update_time, ctx->avg_level);
     836         [ #  # ]:          0 :         nix_dump(file, "W2: head \t\t\t%d\nW2: tail \t\t\t%d\n", ctx->head,
     837                 :            :                  ctx->tail);
     838                 :            : 
     839         [ #  # ]:          0 :         nix_dump(file, "W3: cq_err_int_ena \t\t%d\nW3: cq_err_int \t\t\t%d",
     840                 :            :                  ctx->cq_err_int_ena, ctx->cq_err_int);
     841         [ #  # ]:          0 :         nix_dump(file, "W3: qsize \t\t\t%d\nW3: stashing \t\t\t%d", ctx->qsize,
     842                 :            :                  ctx->stashing);
     843         [ #  # ]:          0 :         nix_dump(file, "W3: caching \t\t\t%d\nW3: lbp_frac \t\t\t%d", ctx->caching, ctx->lbp_frac);
     844         [ #  # ]:          0 :         nix_dump(file, "W3: stash_thresh \t\t\t%d\nW3: msh_valid\t\t\t%d", ctx->stash_thresh,
     845                 :            :                  ctx->msh_valid);
     846         [ #  # ]:          0 :         nix_dump(file, "W3: msh_dst \t\t\t0x%03x\nW3: cpt_drop_err_en \t\t\t%d\n",
     847                 :            :                  ctx->msh_dst, ctx->cpt_drop_err_en);
     848         [ #  # ]:          0 :         nix_dump(file, "W3: ena \t\t\t%d\n", ctx->ena);
     849         [ #  # ]:          0 :         nix_dump(file, "W3: drop_ena \t\t\t%d\nW3: drop \t\t\t%d", ctx->drop_ena,
     850                 :            :                  ctx->drop);
     851         [ #  # ]:          0 :         nix_dump(file, "W3: bp \t\t\t\t%d\n", ctx->bp);
     852         [ #  # ]:          0 :         nix_dump(file, "W4: lbpid_ext \t\t\t%d\nW3: bpid_ext \t\t\t%d", ctx->lbpid_ext,
     853                 :            :                  ctx->bpid_ext);
     854                 :          0 : }
     855                 :            : 
     856                 :            : static inline void
     857                 :          0 : nix_lf_cq_dump(__io struct nix_cq_ctx_s *ctx, FILE *file)
     858                 :            : {
     859         [ #  # ]:          0 :         nix_dump(file, "W0: base \t\t\t0x%" PRIx64 "\n", ctx->base);
     860                 :            : 
     861         [ #  # ]:          0 :         nix_dump(file, "W1: wrptr \t\t\t%" PRIx64 "", (uint64_t)ctx->wrptr);
     862         [ #  # ]:          0 :         nix_dump(file, "W1: avg_con \t\t\t%d\nW1: cint_idx \t\t\t%d", ctx->avg_con,
     863                 :            :                  ctx->cint_idx);
     864         [ #  # ]:          0 :         nix_dump(file, "W1: cq_err \t\t\t%d\nW1: qint_idx \t\t\t%d", ctx->cq_err,
     865                 :            :                  ctx->qint_idx);
     866         [ #  # ]:          0 :         nix_dump(file, "W1: bpid  \t\t\t%d\nW1: bp_ena \t\t\t%d\n", ctx->bpid,
     867                 :            :                  ctx->bp_ena);
     868         [ #  # ]:          0 :         nix_dump(file,
     869                 :            :                  "W1: lbpid_high \t\t\t0x%03x\nW1: lbpid_med \t\t\t0x%03x\n"
     870                 :            :                  "W1: lbpid_low \t\t\t0x%03x\n(W1: lbpid) \t\t\t0x%03x\n",
     871                 :            :                  ctx->lbpid_high, ctx->lbpid_med, ctx->lbpid_low, (unsigned int)
     872                 :            :                  (ctx->lbpid_high << 6 | ctx->lbpid_med << 3 | ctx->lbpid_low));
     873         [ #  # ]:          0 :         nix_dump(file, "W1: lbp_ena \t\t\t\t%d\n", ctx->lbp_ena);
     874                 :            : 
     875         [ #  # ]:          0 :         nix_dump(file, "W2: update_time \t\t%d\nW2: avg_level \t\t\t%d",
     876                 :            :                  ctx->update_time, ctx->avg_level);
     877         [ #  # ]:          0 :         nix_dump(file, "W2: head \t\t\t%d\nW2: tail \t\t\t%d\n", ctx->head,
     878                 :            :                  ctx->tail);
     879                 :            : 
     880         [ #  # ]:          0 :         nix_dump(file, "W3: cq_err_int_ena \t\t%d\nW3: cq_err_int \t\t\t%d",
     881                 :            :                  ctx->cq_err_int_ena, ctx->cq_err_int);
     882         [ #  # ]:          0 :         nix_dump(file, "W3: qsize \t\t\t%d\nW3: caching \t\t\t%d", ctx->qsize,
     883                 :            :                  ctx->caching);
     884         [ #  # ]:          0 :         nix_dump(file, "W3: lbp_frac \t\t\t%d\n", ctx->lbp_frac);
     885         [ #  # ]:          0 :         nix_dump(file, "W3: substream \t\t\t0x%03x\nW3: cpt_drop_err_en \t\t\t%d\n",
     886                 :            :                  ctx->substream, ctx->cpt_drop_err_en);
     887         [ #  # ]:          0 :         nix_dump(file, "W3: ena \t\t\t%d\n", ctx->ena);
     888         [ #  # ]:          0 :         nix_dump(file, "W3: drop_ena \t\t\t%d\nW3: drop \t\t\t%d", ctx->drop_ena,
     889                 :            :                  ctx->drop);
     890         [ #  # ]:          0 :         nix_dump(file, "W3: bp \t\t\t\t%d\n", ctx->bp);
     891                 :          0 : }
     892                 :            : 
     893                 :            : int
     894                 :          0 : roc_nix_queues_ctx_dump(struct roc_nix *roc_nix, FILE *file)
     895                 :            : {
     896                 :            :         struct nix *nix = roc_nix_to_nix_priv(roc_nix);
     897                 :            :         struct npa_cn20k_aq_enq_req *npa_aq_cn20k;
     898                 :          0 :         int rc = -1, q, rq = nix->nb_rx_queues;
     899                 :            :         struct npa_aq_enq_rsp *npa_rsp;
     900                 :            :         struct npa_aq_enq_req *npa_aq;
     901                 :          0 :         struct dev *dev = &nix->dev;
     902                 :          0 :         int sq = nix->nb_tx_queues;
     903                 :            :         struct roc_nix_rq *inl_rq;
     904                 :            :         struct npa_lf *npa_lf;
     905                 :            :         volatile void *ctx;
     906                 :            :         uint32_t sqb_aura;
     907                 :            : 
     908                 :          0 :         npa_lf = idev_npa_obj_get();
     909         [ #  # ]:          0 :         if (npa_lf == NULL)
     910                 :            :                 return NPA_ERR_DEVICE_NOT_BOUNDED;
     911                 :            : 
     912         [ #  # ]:          0 :         for (q = 0; q < rq; q++) {
     913                 :          0 :                 rc = nix_q_ctx_get(dev, NIX_AQ_CTYPE_CQ, q, &ctx);
     914         [ #  # ]:          0 :                 if (rc) {
     915                 :          0 :                         plt_err("Failed to get cq context");
     916                 :          0 :                         goto fail;
     917                 :            :                 }
     918         [ #  # ]:          0 :                 nix_dump(file, "============== port=%d cq=%d ===============",
     919                 :            :                          roc_nix->port_id, q);
     920         [ #  # ]:          0 :                 if (roc_model_is_cn20k())
     921                 :          0 :                         nix_cn20k_lf_cq_dump(ctx, file);
     922                 :            :                 else
     923                 :          0 :                         nix_lf_cq_dump(ctx, file);
     924                 :            :         }
     925                 :            : 
     926         [ #  # ]:          0 :         for (q = 0; q < rq; q++) {
     927                 :          0 :                 rc = nix_q_ctx_get(dev, NIX_AQ_CTYPE_RQ, q, &ctx);
     928         [ #  # ]:          0 :                 if (rc) {
     929                 :          0 :                         plt_err("Failed to get rq context");
     930                 :          0 :                         goto fail;
     931                 :            :                 }
     932         [ #  # ]:          0 :                 nix_dump(file, "============== port=%d rq=%d ===============",
     933                 :            :                          roc_nix->port_id, q);
     934         [ #  # ]:          0 :                 if (roc_model_is_cn9k())
     935                 :          0 :                         nix_cn9k_lf_rq_dump(ctx, file);
     936         [ #  # ]:          0 :                 else if (roc_model_is_cn10k())
     937                 :          0 :                         nix_cn10k_lf_rq_dump(ctx, file);
     938                 :            :                 else
     939                 :          0 :                         nix_lf_rq_dump(ctx, file);
     940                 :            :         }
     941                 :            : 
     942                 :            :         /* Dump inline dev RQ for this port */
     943                 :          0 :         inl_rq = roc_nix_inl_dev_rq(roc_nix);
     944         [ #  # ]:          0 :         if (inl_rq) {
     945                 :          0 :                 struct idev_cfg *idev = idev_get_cfg();
     946                 :            :                 struct nix_inl_dev *inl_dev = NULL;
     947                 :            : 
     948   [ #  #  #  # ]:          0 :                 if (idev && idev->nix_inl_dev)
     949                 :            :                         inl_dev = idev->nix_inl_dev;
     950                 :            : 
     951                 :            :                 if (!inl_dev)
     952                 :            :                         return -EINVAL;
     953                 :            : 
     954                 :          0 :                 rc = nix_q_ctx_get(&inl_dev->dev, NIX_AQ_CTYPE_RQ, inl_rq->qid, &ctx);
     955         [ #  # ]:          0 :                 if (rc) {
     956                 :          0 :                         plt_err("Failed to get rq context");
     957                 :          0 :                         goto fail;
     958                 :            :                 }
     959         [ #  # ]:          0 :                 nix_dump(file, "============== port=%d inl_rq=%d ===============", roc_nix->port_id,
     960                 :            :                          inl_rq->qid);
     961         [ #  # ]:          0 :                 if (roc_model_is_cn9k())
     962                 :          0 :                         nix_cn9k_lf_rq_dump(ctx, file);
     963         [ #  # ]:          0 :                 else if (roc_model_is_cn10k())
     964                 :          0 :                         nix_cn10k_lf_rq_dump(ctx, file);
     965                 :            :                 else
     966                 :          0 :                         nix_lf_rq_dump(ctx, file);
     967                 :            :         }
     968                 :            : 
     969         [ #  # ]:          0 :         for (q = 0; q < sq; q++) {
     970                 :          0 :                 rc = nix_q_ctx_get(dev, NIX_AQ_CTYPE_SQ, q, &ctx);
     971         [ #  # ]:          0 :                 if (rc) {
     972                 :          0 :                         plt_err("Failed to get sq context");
     973                 :          0 :                         goto fail;
     974                 :            :                 }
     975         [ #  # ]:          0 :                 nix_dump(file, "============== port=%d sq=%d ===============",
     976                 :            :                          roc_nix->port_id, q);
     977         [ #  # ]:          0 :                 if (roc_model_is_cn9k())
     978                 :          0 :                         nix_cn9k_lf_sq_dump(ctx, &sqb_aura, file);
     979         [ #  # ]:          0 :                 else if (roc_model_is_cn10k())
     980                 :          0 :                         nix_cn10k_lf_sq_dump(ctx, &sqb_aura, file);
     981                 :            :                 else
     982                 :          0 :                         nix_lf_sq_dump(ctx, &sqb_aura, file);
     983                 :            : 
     984                 :            :                 if (!npa_lf) {
     985                 :            :                         plt_err("NPA LF does not exist");
     986                 :            :                         continue;
     987                 :            :                 }
     988                 :            : 
     989         [ #  # ]:          0 :                 if (roc_model_is_cn20k()) {
     990                 :          0 :                         npa_aq_cn20k = mbox_alloc_msg_npa_cn20k_aq_enq(mbox_get(npa_lf->mbox));
     991                 :            :                         npa_aq = (struct npa_aq_enq_req *)npa_aq_cn20k; /* Common fields */
     992                 :            :                 } else {
     993                 :          0 :                         npa_aq = mbox_alloc_msg_npa_aq_enq(mbox_get(npa_lf->mbox));
     994                 :            :                 }
     995         [ #  # ]:          0 :                 if (npa_aq == NULL) {
     996                 :            :                         rc = -ENOSPC;
     997                 :          0 :                         mbox_put(npa_lf->mbox);
     998                 :          0 :                         goto fail;
     999                 :            :                 }
    1000                 :          0 :                 npa_aq->aura_id = sqb_aura;
    1001                 :          0 :                 npa_aq->ctype = NPA_AQ_CTYPE_AURA;
    1002                 :          0 :                 npa_aq->op = NPA_AQ_INSTOP_READ;
    1003                 :            : 
    1004                 :          0 :                 rc = mbox_process_msg(npa_lf->mbox, (void *)&npa_rsp);
    1005                 :          0 :                 mbox_put(npa_lf->mbox);
    1006         [ #  # ]:          0 :                 if (rc) {
    1007                 :          0 :                         plt_err("Failed to get sq's sqb_aura context");
    1008                 :          0 :                         continue;
    1009                 :            :                 }
    1010                 :            : 
    1011         [ #  # ]:          0 :                 nix_dump(file, "\nSQB Aura W0: Pool addr\t\t0x%" PRIx64 "",
    1012                 :            :                          npa_rsp->aura.pool_addr);
    1013         [ #  # ]:          0 :                 nix_dump(file, "SQB Aura W1: ena\t\t\t%d", npa_rsp->aura.ena);
    1014         [ #  # ]:          0 :                 nix_dump(file, "SQB Aura W2: count\t\t%" PRIx64 "",
    1015                 :            :                          (uint64_t)npa_rsp->aura.count);
    1016         [ #  # ]:          0 :                 nix_dump(file, "SQB Aura W3: limit\t\t%" PRIx64 "",
    1017                 :            :                          (uint64_t)npa_rsp->aura.limit);
    1018         [ #  # ]:          0 :                 nix_dump(file, "SQB Aura W3: fc_ena\t\t%d", npa_rsp->aura.fc_ena);
    1019         [ #  # ]:          0 :                 nix_dump(file, "SQB Aura W4: fc_addr\t\t0x%" PRIx64 "\n",
    1020                 :            :                          npa_rsp->aura.fc_addr);
    1021                 :            :         }
    1022                 :            : 
    1023                 :          0 : fail:
    1024                 :            :         return rc;
    1025                 :            : }
    1026                 :            : 
    1027                 :            : /* Dumps struct nix_cqe_hdr_s and union nix_rx_parse_u */
    1028                 :            : void
    1029                 :          0 : roc_nix_cqe_dump(FILE *file, const struct nix_cqe_hdr_s *cq)
    1030                 :            : {
    1031                 :            :         const union nix_rx_parse_u *rx =
    1032                 :            :                 (const union nix_rx_parse_u *)((const uint64_t *)cq + 1);
    1033                 :          0 :         const uint64_t *sgs = (const uint64_t *)(rx + 1);
    1034                 :            :         int i;
    1035                 :            : 
    1036         [ #  # ]:          0 :         nix_dump(file, "tag \t\t0x%x\tq \t\t%d\t\tnode \t\t%d\tcqe_type \t%d",
    1037                 :            :                  cq->tag, cq->q, cq->node, cq->cqe_type);
    1038                 :            : 
    1039         [ #  # ]:          0 :         nix_dump(file, "W0: chan \t0x%x\t\tdesc_sizem1 \t%d", rx->chan,
    1040                 :            :                  rx->desc_sizem1);
    1041         [ #  # ]:          0 :         nix_dump(file, "W0: imm_copy \t%d\t\texpress \t%d", rx->imm_copy,
    1042                 :            :                  rx->express);
    1043         [ #  # ]:          0 :         nix_dump(file, "W0: wqwd \t%d\t\terrlev \t\t%d\t\terrcode \t%d", rx->wqwd,
    1044                 :            :                  rx->errlev, rx->errcode);
    1045         [ #  # ]:          0 :         nix_dump(file, "W0: latype \t%d\t\tlbtype \t\t%d\t\tlctype \t\t%d",
    1046                 :            :                  rx->latype, rx->lbtype, rx->lctype);
    1047         [ #  # ]:          0 :         nix_dump(file, "W0: ldtype \t%d\t\tletype \t\t%d\t\tlftype \t\t%d",
    1048                 :            :                  rx->ldtype, rx->letype, rx->lftype);
    1049         [ #  # ]:          0 :         nix_dump(file, "W0: lgtype \t%d \t\tlhtype \t\t%d", rx->lgtype, rx->lhtype);
    1050                 :            : 
    1051         [ #  # ]:          0 :         nix_dump(file, "W1: pkt_lenm1 \t%d", rx->pkt_lenm1);
    1052         [ #  # ]:          0 :         nix_dump(file, "W1: l2m \t%d\t\tl2b \t\t%d\t\tl3m \t\t%d\tl3b \t\t%d",
    1053                 :            :                  rx->l2m, rx->l2b, rx->l3m, rx->l3b);
    1054         [ #  # ]:          0 :         nix_dump(file, "W1: vtag0_valid %d\t\tvtag0_gone \t%d", rx->vtag0_valid,
    1055                 :            :                  rx->vtag0_gone);
    1056         [ #  # ]:          0 :         nix_dump(file, "W1: vtag1_valid %d\t\tvtag1_gone \t%d", rx->vtag1_valid,
    1057                 :            :                  rx->vtag1_gone);
    1058         [ #  # ]:          0 :         nix_dump(file, "W1: pkind \t%d", rx->pkind);
    1059         [ #  # ]:          0 :         nix_dump(file, "W1: vtag0_tci \t%d\t\tvtag1_tci \t%d", rx->vtag0_tci,
    1060                 :            :                  rx->vtag1_tci);
    1061                 :            : 
    1062         [ #  # ]:          0 :         nix_dump(file, "W2: laflags \t%d\t\tlbflags\t\t%d\t\tlcflags \t%d",
    1063                 :            :                  rx->laflags, rx->lbflags, rx->lcflags);
    1064         [ #  # ]:          0 :         nix_dump(file, "W2: ldflags \t%d\t\tleflags\t\t%d\t\tlfflags \t%d",
    1065                 :            :                  rx->ldflags, rx->leflags, rx->lfflags);
    1066         [ #  # ]:          0 :         nix_dump(file, "W2: lgflags \t%d\t\tlhflags \t%d", rx->lgflags, rx->lhflags);
    1067                 :            : 
    1068         [ #  # ]:          0 :         nix_dump(file, "W3: eoh_ptr \t%d\t\twqe_aura \t%d\t\tpb_aura \t%d",
    1069                 :            :                  rx->eoh_ptr, rx->wqe_aura, rx->pb_aura);
    1070         [ #  # ]:          0 :         nix_dump(file, "W3: match_id \t%d", rx->match_id);
    1071                 :            : 
    1072         [ #  # ]:          0 :         nix_dump(file, "W4: laptr \t%d\t\tlbptr \t\t%d\t\tlcptr \t\t%d", rx->laptr,
    1073                 :            :                  rx->lbptr, rx->lcptr);
    1074         [ #  # ]:          0 :         nix_dump(file, "W4: ldptr \t%d\t\tleptr \t\t%d\t\tlfptr \t\t%d", rx->ldptr,
    1075                 :            :                  rx->leptr, rx->lfptr);
    1076         [ #  # ]:          0 :         nix_dump(file, "W4: lgptr \t%d\t\tlhptr \t\t%d", rx->lgptr, rx->lhptr);
    1077                 :            : 
    1078         [ #  # ]:          0 :         nix_dump(file, "W5: vtag0_ptr \t%d\t\tvtag1_ptr \t%d\t\tflow_key_alg \t%d",
    1079                 :            :                  rx->vtag0_ptr, rx->vtag1_ptr, rx->flow_key_alg);
    1080                 :            : 
    1081         [ #  # ]:          0 :         for (i = 0; i < (rx->desc_sizem1 + 1) << 1; i++)
    1082         [ #  # ]:          0 :                 nix_dump(file, "sg[%u] = %p", i, (void *)sgs[i]);
    1083                 :          0 : }
    1084                 :            : 
    1085                 :            : void
    1086                 :          0 : roc_nix_rq_dump(struct roc_nix_rq *rq, FILE *file)
    1087                 :            : {
    1088         [ #  # ]:          0 :         nix_dump(file, "nix_rq@%p", rq);
    1089         [ #  # ]:          0 :         nix_dump(file, "  qid = %d", rq->qid);
    1090         [ #  # ]:          0 :         nix_dump(file, "  aura_handle = 0x%" PRIx64 "", rq->aura_handle);
    1091         [ #  # ]:          0 :         nix_dump(file, "  ipsec_ena = %d", rq->ipsech_ena);
    1092         [ #  # ]:          0 :         nix_dump(file, "  first_skip = %d", rq->first_skip);
    1093         [ #  # ]:          0 :         nix_dump(file, "  later_skip = %d", rq->later_skip);
    1094         [ #  # ]:          0 :         nix_dump(file, "  lpb_size = %d", rq->lpb_size);
    1095         [ #  # ]:          0 :         nix_dump(file, "  sso_ena = %d", rq->sso_ena);
    1096         [ #  # ]:          0 :         nix_dump(file, "  tag_mask = %d", rq->tag_mask);
    1097         [ #  # ]:          0 :         nix_dump(file, "  flow_tag_width = %d", rq->flow_tag_width);
    1098         [ #  # ]:          0 :         nix_dump(file, "  tt = %d", rq->tt);
    1099         [ #  # ]:          0 :         nix_dump(file, "  hwgrp = %d", rq->hwgrp);
    1100         [ #  # ]:          0 :         nix_dump(file, "  vwqe_ena = %d", rq->vwqe_ena);
    1101         [ #  # ]:          0 :         nix_dump(file, "  vwqe_first_skip = %d", rq->vwqe_first_skip);
    1102         [ #  # ]:          0 :         nix_dump(file, "  vwqe_max_sz_exp = %d", rq->vwqe_max_sz_exp);
    1103         [ #  # ]:          0 :         nix_dump(file, "  vwqe_wait_tmo = %ld", rq->vwqe_wait_tmo);
    1104         [ #  # ]:          0 :         nix_dump(file, "  vwqe_aura_handle = %ld", rq->vwqe_aura_handle);
    1105         [ #  # ]:          0 :         nix_dump(file, "  roc_nix = %p", rq->roc_nix);
    1106         [ #  # ]:          0 :         nix_dump(file, "  inl_dev_refs = %d", rq->inl_dev_refs);
    1107         [ #  # ]:          0 :         nix_dump(file, "  tc = %d", rq->tc);
    1108                 :          0 : }
    1109                 :            : 
    1110                 :            : void
    1111                 :          0 : roc_nix_cq_dump(struct roc_nix_cq *cq, FILE *file)
    1112                 :            : {
    1113         [ #  # ]:          0 :         nix_dump(file, "nix_cq@%p", cq);
    1114         [ #  # ]:          0 :         nix_dump(file, "  qid = %d", cq->qid);
    1115         [ #  # ]:          0 :         nix_dump(file, "  qnb_desc = %d", cq->nb_desc);
    1116         [ #  # ]:          0 :         nix_dump(file, "  roc_nix = %p", cq->roc_nix);
    1117         [ #  # ]:          0 :         nix_dump(file, "  door = 0x%" PRIx64 "", cq->door);
    1118         [ #  # ]:          0 :         nix_dump(file, "  status = %p", cq->status);
    1119         [ #  # ]:          0 :         nix_dump(file, "  wdata = 0x%" PRIx64 "", cq->wdata);
    1120         [ #  # ]:          0 :         nix_dump(file, "  desc_base = %p", cq->desc_base);
    1121         [ #  # ]:          0 :         nix_dump(file, "  qmask = 0x%" PRIx32 "", cq->qmask);
    1122                 :          0 : }
    1123                 :            : 
    1124                 :            : void
    1125                 :          0 : roc_nix_sq_dump(struct roc_nix_sq *sq, FILE *file)
    1126                 :            : {
    1127         [ #  # ]:          0 :         nix_dump(file, "nix_sq@%p", sq);
    1128         [ #  # ]:          0 :         nix_dump(file, "  qid = %d", sq->qid);
    1129         [ #  # ]:          0 :         nix_dump(file, "  max_sqe_sz = %d", sq->max_sqe_sz);
    1130         [ #  # ]:          0 :         nix_dump(file, "  nb_desc = %d", sq->nb_desc);
    1131         [ #  # ]:          0 :         nix_dump(file, "  sqes_per_sqb_log2 = %d", sq->sqes_per_sqb_log2);
    1132         [ #  # ]:          0 :         nix_dump(file, "  roc_nix= %p", sq->roc_nix);
    1133         [ #  # ]:          0 :         nix_dump(file, "  aura_handle = 0x%" PRIx64 "", sq->aura_handle);
    1134         [ #  # ]:          0 :         nix_dump(file, "  nb_sqb_bufs_adj = %d", sq->nb_sqb_bufs_adj);
    1135         [ #  # ]:          0 :         nix_dump(file, "  nb_sqb_bufs = %d", sq->nb_sqb_bufs);
    1136         [ #  # ]:          0 :         nix_dump(file, "  io_addr = 0x%" PRIx64 "", sq->io_addr);
    1137         [ #  # ]:          0 :         nix_dump(file, "  lmt_addr = %p", sq->lmt_addr);
    1138         [ #  # ]:          0 :         nix_dump(file, "  sqe_mem = %p", sq->sqe_mem);
    1139         [ #  # ]:          0 :         nix_dump(file, "  fc = %p", sq->fc);
    1140         [ #  # ]:          0 :         nix_dump(file, "  tc = %d", sq->tc);
    1141                 :          0 : };
    1142                 :            : 
    1143                 :            : static uint8_t
    1144                 :          0 : nix_tm_reg_dump_prep(uint16_t hw_lvl, uint16_t schq, uint16_t link,
    1145                 :            :                      uint64_t *reg, char regstr[][NIX_REG_NAME_SZ])
    1146                 :            : {
    1147                 :            :         FILE *file = NULL;
    1148                 :            :         uint8_t k = 0;
    1149                 :            : 
    1150   [ #  #  #  #  :          0 :         switch (hw_lvl) {
                   #  # ]
    1151                 :          0 :         case NIX_TXSCH_LVL_SMQ:
    1152                 :          0 :                 reg[k] = NIX_AF_SMQX_CFG(schq);
    1153                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_SMQ[%u]_CFG",
    1154                 :            :                          schq);
    1155                 :            : 
    1156                 :          0 :                 reg[k] = NIX_AF_MDQX_PARENT(schq);
    1157                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_PARENT",
    1158                 :            :                          schq);
    1159                 :            : 
    1160                 :          0 :                 reg[k] = NIX_AF_MDQX_SCHEDULE(schq);
    1161                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1162                 :            :                          "NIX_AF_MDQ[%u]_SCHEDULE", schq);
    1163                 :            : 
    1164                 :          0 :                 reg[k] = NIX_AF_MDQX_PIR(schq);
    1165                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_PIR",
    1166                 :            :                          schq);
    1167                 :            : 
    1168                 :          0 :                 reg[k] = NIX_AF_MDQX_CIR(schq);
    1169                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_CIR",
    1170                 :            :                          schq);
    1171                 :            : 
    1172                 :          0 :                 reg[k] = NIX_AF_MDQX_SHAPE(schq);
    1173                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_SHAPE",
    1174                 :            :                          schq);
    1175                 :            : 
    1176                 :          0 :                 reg[k] = NIX_AF_MDQX_SW_XOFF(schq);
    1177                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_MDQ[%u]_SW_XOFF",
    1178                 :            :                          schq);
    1179                 :            :                 break;
    1180                 :          0 :         case NIX_TXSCH_LVL_TL4:
    1181                 :          0 :                 reg[k] = NIX_AF_TL4X_PARENT(schq);
    1182                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_PARENT",
    1183                 :            :                          schq);
    1184                 :            : 
    1185                 :          0 :                 reg[k] = NIX_AF_TL4X_TOPOLOGY(schq);
    1186                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1187                 :            :                          "NIX_AF_TL4[%u]_TOPOLOGY", schq);
    1188                 :            : 
    1189                 :          0 :                 reg[k] = NIX_AF_TL4X_SDP_LINK_CFG(schq);
    1190                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1191                 :            :                          "NIX_AF_TL4[%u]_SDP_LINK_CFG", schq);
    1192                 :            : 
    1193                 :          0 :                 reg[k] = NIX_AF_TL4X_SCHEDULE(schq);
    1194                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1195                 :            :                          "NIX_AF_TL4[%u]_SCHEDULE", schq);
    1196                 :            : 
    1197                 :          0 :                 reg[k] = NIX_AF_TL4X_PIR(schq);
    1198                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_PIR",
    1199                 :            :                          schq);
    1200                 :            : 
    1201                 :          0 :                 reg[k] = NIX_AF_TL4X_CIR(schq);
    1202                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_CIR",
    1203                 :            :                          schq);
    1204                 :            : 
    1205                 :          0 :                 reg[k] = NIX_AF_TL4X_SHAPE(schq);
    1206                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_SHAPE",
    1207                 :            :                          schq);
    1208                 :            : 
    1209                 :          0 :                 reg[k] = NIX_AF_TL4X_SW_XOFF(schq);
    1210                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL4[%u]_SW_XOFF",
    1211                 :            :                          schq);
    1212                 :            :                 break;
    1213                 :          0 :         case NIX_TXSCH_LVL_TL3:
    1214                 :          0 :                 reg[k] = NIX_AF_TL3X_PARENT(schq);
    1215                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_PARENT",
    1216                 :            :                          schq);
    1217                 :            : 
    1218                 :          0 :                 reg[k] = NIX_AF_TL3X_TOPOLOGY(schq);
    1219                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1220                 :            :                          "NIX_AF_TL3[%u]_TOPOLOGY", schq);
    1221                 :            : 
    1222                 :          0 :                 reg[k] = NIX_AF_TL3_TL2X_LINKX_CFG(schq, link);
    1223                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1224                 :            :                          "NIX_AF_TL3_TL2[%u]_LINK[%u]_CFG", schq, link);
    1225                 :            : 
    1226                 :          0 :                 reg[k] = NIX_AF_TL3X_SCHEDULE(schq);
    1227                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1228                 :            :                          "NIX_AF_TL3[%u]_SCHEDULE", schq);
    1229                 :            : 
    1230                 :          0 :                 reg[k] = NIX_AF_TL3X_PIR(schq);
    1231                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_PIR",
    1232                 :            :                          schq);
    1233                 :            : 
    1234                 :          0 :                 reg[k] = NIX_AF_TL3X_CIR(schq);
    1235                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_CIR",
    1236                 :            :                          schq);
    1237                 :            : 
    1238                 :          0 :                 reg[k] = NIX_AF_TL3X_SHAPE(schq);
    1239                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_SHAPE",
    1240                 :            :                          schq);
    1241                 :            : 
    1242                 :          0 :                 reg[k] = NIX_AF_TL3X_SW_XOFF(schq);
    1243                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL3[%u]_SW_XOFF",
    1244                 :            :                          schq);
    1245                 :            :                 break;
    1246                 :          0 :         case NIX_TXSCH_LVL_TL2:
    1247                 :          0 :                 reg[k] = NIX_AF_TL2X_PARENT(schq);
    1248                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_PARENT",
    1249                 :            :                          schq);
    1250                 :            : 
    1251                 :          0 :                 reg[k] = NIX_AF_TL2X_TOPOLOGY(schq);
    1252                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1253                 :            :                          "NIX_AF_TL2[%u]_TOPOLOGY", schq);
    1254                 :            : 
    1255                 :          0 :                 reg[k] = NIX_AF_TL3_TL2X_LINKX_CFG(schq, link);
    1256                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1257                 :            :                          "NIX_AF_TL3_TL2[%u]_LINK[%u]_CFG", schq, link);
    1258                 :            : 
    1259                 :          0 :                 reg[k] = NIX_AF_TL2X_SCHEDULE(schq);
    1260                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1261                 :            :                          "NIX_AF_TL2[%u]_SCHEDULE", schq);
    1262                 :            : 
    1263                 :          0 :                 reg[k] = NIX_AF_TL2X_PIR(schq);
    1264                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_PIR",
    1265                 :            :                          schq);
    1266                 :            : 
    1267                 :          0 :                 reg[k] = NIX_AF_TL2X_CIR(schq);
    1268                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_CIR",
    1269                 :            :                          schq);
    1270                 :            : 
    1271                 :          0 :                 reg[k] = NIX_AF_TL2X_SHAPE(schq);
    1272                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_SHAPE",
    1273                 :            :                          schq);
    1274                 :            : 
    1275                 :          0 :                 reg[k] = NIX_AF_TL2X_SW_XOFF(schq);
    1276                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL2[%u]_SW_XOFF",
    1277                 :            :                          schq);
    1278                 :            :                 break;
    1279                 :          0 :         case NIX_TXSCH_LVL_TL1:
    1280                 :            : 
    1281                 :          0 :                 reg[k] = NIX_AF_TL1X_TOPOLOGY(schq);
    1282                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1283                 :            :                          "NIX_AF_TL1[%u]_TOPOLOGY", schq);
    1284                 :            : 
    1285                 :          0 :                 reg[k] = NIX_AF_TL1X_SCHEDULE(schq);
    1286                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1287                 :            :                          "NIX_AF_TL1[%u]_SCHEDULE", schq);
    1288                 :            : 
    1289                 :          0 :                 reg[k] = NIX_AF_TL1X_CIR(schq);
    1290                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL1[%u]_CIR",
    1291                 :            :                          schq);
    1292                 :            : 
    1293                 :          0 :                 reg[k] = NIX_AF_TL1X_SW_XOFF(schq);
    1294                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ, "NIX_AF_TL1[%u]_SW_XOFF",
    1295                 :            :                          schq);
    1296                 :            : 
    1297                 :          0 :                 reg[k] = NIX_AF_TL1X_DROPPED_PACKETS(schq);
    1298                 :          0 :                 snprintf(regstr[k++], NIX_REG_NAME_SZ,
    1299                 :            :                          "NIX_AF_TL1[%u]_DROPPED_PACKETS", schq);
    1300                 :            :                 break;
    1301                 :            :         default:
    1302                 :            :                 break;
    1303                 :            :         }
    1304                 :            : 
    1305                 :            :         if (k > MAX_REGS_PER_MBOX_MSG) {
    1306                 :            :                 nix_dump(file, "\t!!!NIX TM Registers request overflow!!!");
    1307                 :            :                 return 0;
    1308                 :            :         }
    1309                 :            :         return k;
    1310                 :            : }
    1311                 :            : 
    1312                 :            : static void
    1313                 :          0 : nix_tm_dump_lvl(struct nix *nix, struct nix_tm_node_list *list, uint8_t hw_lvl)
    1314                 :            : {
    1315                 :            :         char regstr[MAX_REGS_PER_MBOX_MSG * 2][NIX_REG_NAME_SZ];
    1316                 :            :         uint64_t reg[MAX_REGS_PER_MBOX_MSG * 2];
    1317                 :          0 :         struct mbox *mbox = (&nix->dev)->mbox;
    1318                 :            :         struct nix_txschq_config *req, *rsp;
    1319                 :            :         const char *lvlstr, *parent_lvlstr;
    1320                 :            :         struct nix_tm_node *node, *parent;
    1321                 :            :         struct nix_tm_node *root = NULL;
    1322                 :            :         uint32_t schq, parent_schq;
    1323                 :            :         bool found = false;
    1324                 :            :         FILE *file = NULL;
    1325                 :            :         uint8_t j, k, rc;
    1326                 :            : 
    1327         [ #  # ]:          0 :         TAILQ_FOREACH(node, list, node) {
    1328         [ #  # ]:          0 :                 if (node->hw_lvl != hw_lvl)
    1329                 :          0 :                         continue;
    1330                 :            : 
    1331                 :            :                 found = true;
    1332                 :          0 :                 parent = node->parent;
    1333         [ #  # ]:          0 :                 if (hw_lvl == NIX_TXSCH_LVL_CNT) {
    1334                 :            :                         lvlstr = "SQ";
    1335                 :          0 :                         schq = node->id;
    1336                 :            :                 } else {
    1337                 :            :                         lvlstr = nix_tm_hwlvl2str(node->hw_lvl);
    1338                 :          0 :                         schq = node->hw_id;
    1339                 :            :                 }
    1340                 :            : 
    1341         [ #  # ]:          0 :                 if (parent) {
    1342                 :          0 :                         parent_schq = parent->hw_id;
    1343   [ #  #  #  #  :          0 :                         parent_lvlstr = nix_tm_hwlvl2str(parent->hw_lvl);
                   #  # ]
    1344         [ #  # ]:          0 :                 } else if (node->hw_lvl == NIX_TXSCH_LVL_TL1) {
    1345                 :          0 :                         parent_schq = nix->tx_link;
    1346                 :            :                         parent_lvlstr = "LINK";
    1347                 :            :                 } else {
    1348                 :          0 :                         parent_schq = node->parent_hw_id;
    1349   [ #  #  #  #  :          0 :                         parent_lvlstr = nix_tm_hwlvl2str(node->hw_lvl + 1);
                      # ]
    1350                 :            :                 }
    1351                 :            : 
    1352         [ #  # ]:          0 :                 nix_dump(file, "\t(%p%s) %s_%d->%s_%d", node,
    1353                 :            :                          node->child_realloc ? "[CR]" : "", lvlstr, schq,
    1354                 :            :                          parent_lvlstr, parent_schq);
    1355                 :            : 
    1356         [ #  # ]:          0 :                 if (!(node->flags & NIX_TM_NODE_HWRES))
    1357                 :          0 :                         continue;
    1358                 :            : 
    1359                 :            :                 /* Need to dump TL1 when root is TL2 */
    1360         [ #  # ]:          0 :                 if (node->hw_lvl == nix->tm_root_lvl)
    1361                 :            :                         root = node;
    1362                 :            : 
    1363                 :            :                 /* Dump registers only when HWRES is present */
    1364                 :          0 :                 k = nix_tm_reg_dump_prep(node->hw_lvl, schq, nix->tx_link, reg,
    1365                 :            :                                          regstr);
    1366         [ #  # ]:          0 :                 if (!k)
    1367                 :          0 :                         continue;
    1368                 :            : 
    1369                 :          0 :                 req = mbox_alloc_msg_nix_txschq_cfg(mbox_get(mbox));
    1370                 :          0 :                 req->read = 1;
    1371                 :          0 :                 req->lvl = node->hw_lvl;
    1372                 :          0 :                 req->num_regs = k;
    1373                 :          0 :                 mbox_memcpy(req->reg, reg, sizeof(uint64_t) * k);
    1374                 :          0 :                 rc = mbox_process_msg(mbox, (void **)&rsp);
    1375         [ #  # ]:          0 :                 if (!rc) {
    1376         [ #  # ]:          0 :                         for (j = 0; j < k; j++)
    1377                 :          0 :                                 nix_dump(file, "\t\t%s=0x%016" PRIx64, regstr[j],
    1378                 :            :                                          rsp->regval[j]);
    1379                 :            :                 } else {
    1380                 :          0 :                         nix_dump(file, "\t!!!Failed to dump registers!!!");
    1381                 :            :                 }
    1382                 :            :                 mbox_put(mbox);
    1383                 :            :         }
    1384                 :            : 
    1385         [ #  # ]:          0 :         if (found)
    1386                 :          0 :                 nix_dump(file, "\n");
    1387                 :            : 
    1388                 :            :         /* Dump TL1 node data when root level is TL2 */
    1389   [ #  #  #  # ]:          0 :         if (root && root->hw_lvl == NIX_TXSCH_LVL_TL2) {
    1390                 :          0 :                 k = nix_tm_reg_dump_prep(NIX_TXSCH_LVL_TL1, root->parent_hw_id,
    1391                 :          0 :                                          nix->tx_link, reg, regstr);
    1392         [ #  # ]:          0 :                 if (!k)
    1393                 :          0 :                         return;
    1394                 :            : 
    1395                 :          0 :                 req = mbox_alloc_msg_nix_txschq_cfg(mbox_get(mbox));
    1396                 :          0 :                 req->read = 1;
    1397                 :          0 :                 req->lvl = NIX_TXSCH_LVL_TL1;
    1398                 :          0 :                 req->num_regs = k;
    1399                 :          0 :                 mbox_memcpy(req->reg, reg, sizeof(uint64_t) * k);
    1400                 :          0 :                 rc = mbox_process_msg(mbox, (void **)&rsp);
    1401         [ #  # ]:          0 :                 if (!rc) {
    1402         [ #  # ]:          0 :                         for (j = 0; j < k; j++)
    1403                 :          0 :                                 nix_dump(file, "\t\t%s=0x%016" PRIx64, regstr[j],
    1404                 :            :                                          rsp->regval[j]);
    1405                 :            :                 } else {
    1406                 :          0 :                         nix_dump(file, "\t!!!Failed to dump registers!!!");
    1407                 :            :                 }
    1408                 :            :                 mbox_put(mbox);
    1409                 :          0 :                 nix_dump(file, "\n");
    1410                 :            :         }
    1411                 :            : }
    1412                 :            : 
    1413                 :            : void
    1414         [ #  # ]:          0 : roc_nix_tm_dump(struct roc_nix *roc_nix, FILE *file)
    1415                 :            : {
    1416                 :            :         struct nix *nix = roc_nix_to_nix_priv(roc_nix);
    1417                 :            :         struct dev *dev = &nix->dev;
    1418                 :            :         uint8_t hw_lvl, i;
    1419                 :            : 
    1420   [ #  #  #  #  :          0 :         nix_dump(file, "===TM hierarchy and registers dump of %s (pf:vf) (%d:%d)===",
                   #  # ]
    1421                 :            :                  nix->pci_dev->name, dev_get_pf(dev->pf_func),
    1422                 :            :                  dev_get_vf(dev->pf_func));
    1423                 :            : 
    1424                 :            :         /* Dump all trees */
    1425         [ #  # ]:          0 :         for (i = 0; i < ROC_NIX_TM_TREE_MAX; i++) {
    1426   [ #  #  #  #  :          0 :                 nix_dump(file, "\tTM %s:", nix_tm_tree2str(i));
                   #  # ]
    1427         [ #  # ]:          0 :                 for (hw_lvl = 0; hw_lvl <= NIX_TXSCH_LVL_CNT; hw_lvl++)
    1428                 :          0 :                         nix_tm_dump_lvl(nix, &nix->trees[i], hw_lvl);
    1429                 :            :         }
    1430                 :            : 
    1431                 :            :         /* Dump unused resources */
    1432         [ #  # ]:          0 :         nix_dump(file, "\tTM unused resources:");
    1433                 :            :         hw_lvl = NIX_TXSCH_LVL_SMQ;
    1434         [ #  # ]:          0 :         for (; hw_lvl < NIX_TXSCH_LVL_CNT; hw_lvl++) {
    1435   [ #  #  #  #  :          0 :                 nix_dump(file, "\t\ttxschq        %7s num = %d",
          #  #  #  #  #  
                #  #  # ]
    1436                 :            :                          nix_tm_hwlvl2str(hw_lvl),
    1437                 :            :                          nix_tm_resource_avail(nix, hw_lvl, false));
    1438                 :            : 
    1439                 :          0 :                 nix_bitmap_dump(nix->schq_bmp[hw_lvl], file);
    1440         [ #  # ]:          0 :                 nix_dump(file, "\n");
    1441                 :            : 
    1442   [ #  #  #  #  :          0 :                 nix_dump(file, "\t\ttxschq_contig %7s num = %d",
          #  #  #  #  #  
                #  #  # ]
    1443                 :            :                          nix_tm_hwlvl2str(hw_lvl),
    1444                 :            :                          nix_tm_resource_avail(nix, hw_lvl, true));
    1445                 :          0 :                 nix_bitmap_dump(nix->schq_contig_bmp[hw_lvl], file);
    1446         [ #  # ]:          0 :                 nix_dump(file, "\n");
    1447                 :            :         }
    1448                 :          0 : }
    1449                 :            : 
    1450                 :            : void
    1451         [ #  # ]:          0 : roc_nix_dump(struct roc_nix *roc_nix, FILE *file)
    1452                 :            : {
    1453                 :            :         struct nix *nix = roc_nix_to_nix_priv(roc_nix);
    1454                 :            :         struct dev *dev = &nix->dev;
    1455                 :            :         int i;
    1456                 :            : 
    1457         [ #  # ]:          0 :         nix_dump(file, "nix@%p", nix);
    1458   [ #  #  #  #  :          0 :         nix_dump(file, "  pf = %d", dev_get_pf(dev->pf_func));
                   #  # ]
    1459   [ #  #  #  #  :          0 :         nix_dump(file, "  vf = %d", dev_get_vf(dev->pf_func));
                   #  # ]
    1460         [ #  # ]:          0 :         nix_dump(file, "  bar2 = 0x%" PRIx64, dev->bar2);
    1461         [ #  # ]:          0 :         nix_dump(file, "  bar4 = 0x%" PRIx64, dev->bar4);
    1462         [ #  # ]:          0 :         nix_dump(file, "  port_id = %d", roc_nix->port_id);
    1463         [ #  # ]:          0 :         nix_dump(file, "  rss_tag_as_xor = %d", roc_nix->rss_tag_as_xor);
    1464         [ #  # ]:          0 :         nix_dump(file, "  rss_tag_as_xor = %d", roc_nix->max_sqb_count);
    1465         [ #  # ]:          0 :         nix_dump(file, "  outb_nb_desc = %u", roc_nix->outb_nb_desc);
    1466                 :            : 
    1467         [ #  # ]:          0 :         nix_dump(file, "  \tpci_dev = %p", nix->pci_dev);
    1468         [ #  # ]:          0 :         nix_dump(file, "  \tbase = 0x%" PRIxPTR "", nix->base);
    1469         [ #  # ]:          0 :         nix_dump(file, "  \tlmt_base = 0x%" PRIxPTR "", nix->lmt_base);
    1470         [ #  # ]:          0 :         nix_dump(file, "  \treta_size = %d", nix->reta_sz);
    1471         [ #  # ]:          0 :         nix_dump(file, "  \ttx_chan_base = %d", nix->tx_chan_base);
    1472         [ #  # ]:          0 :         nix_dump(file, "  \trx_chan_base = %d", nix->rx_chan_base);
    1473         [ #  # ]:          0 :         nix_dump(file, "  \tnb_rx_queues = %d", nix->nb_rx_queues);
    1474         [ #  # ]:          0 :         nix_dump(file, "  \tnb_tx_queues = %d", nix->nb_tx_queues);
    1475         [ #  # ]:          0 :         nix_dump(file, "  \tlso_tsov6_idx = %d", nix->lso_tsov6_idx);
    1476         [ #  # ]:          0 :         nix_dump(file, "  \tlso_tsov4_idx = %d", nix->lso_tsov4_idx);
    1477         [ #  # ]:          0 :         nix_dump(file, "  \tlso_udp_tun_v4v4 = %d",
    1478                 :            :                  nix->lso_udp_tun_idx[ROC_NIX_LSO_TUN_V4V4]);
    1479         [ #  # ]:          0 :         nix_dump(file, "  \tlso_udp_tun_v4v6 = %d",
    1480                 :            :                  nix->lso_udp_tun_idx[ROC_NIX_LSO_TUN_V4V6]);
    1481         [ #  # ]:          0 :         nix_dump(file, "  \tlso_udp_tun_v6v4 = %d",
    1482                 :            :                  nix->lso_udp_tun_idx[ROC_NIX_LSO_TUN_V6V4]);
    1483         [ #  # ]:          0 :         nix_dump(file, "  \tlso_udp_tun_v6v6 = %d",
    1484                 :            :                  nix->lso_udp_tun_idx[ROC_NIX_LSO_TUN_V6V6]);
    1485         [ #  # ]:          0 :         nix_dump(file, "  \tlso_tun_v4v4 = %d",
    1486                 :            :                  nix->lso_tun_idx[ROC_NIX_LSO_TUN_V4V4]);
    1487         [ #  # ]:          0 :         nix_dump(file, "  \tlso_tun_v4v6 = %d",
    1488                 :            :                  nix->lso_tun_idx[ROC_NIX_LSO_TUN_V4V6]);
    1489         [ #  # ]:          0 :         nix_dump(file, "  \tlso_tun_v6v4 = %d",
    1490                 :            :                  nix->lso_tun_idx[ROC_NIX_LSO_TUN_V6V4]);
    1491         [ #  # ]:          0 :         nix_dump(file, "  \tlso_tun_v6v6 = %d",
    1492                 :            :                  nix->lso_tun_idx[ROC_NIX_LSO_TUN_V6V6]);
    1493         [ #  # ]:          0 :         nix_dump(file, "  \tlf_rx_stats = %d", nix->lf_rx_stats);
    1494         [ #  # ]:          0 :         nix_dump(file, "  \tlf_tx_stats = %d", nix->lf_tx_stats);
    1495         [ #  # ]:          0 :         nix_dump(file, "  \trx_chan_cnt = %d", nix->rx_chan_cnt);
    1496         [ #  # ]:          0 :         nix_dump(file, "  \ttx_chan_cnt = %d", nix->tx_chan_cnt);
    1497         [ #  # ]:          0 :         nix_dump(file, "  \tcgx_links = %d", nix->cgx_links);
    1498         [ #  # ]:          0 :         nix_dump(file, "  \tlbk_links = %d", nix->lbk_links);
    1499         [ #  # ]:          0 :         nix_dump(file, "  \tsdp_links = %d", nix->sdp_links);
    1500         [ #  # ]:          0 :         nix_dump(file, "  \ttx_link = %d", nix->tx_link);
    1501         [ #  # ]:          0 :         nix_dump(file, "  \tsqb_size = %d", nix->sqb_size);
    1502         [ #  # ]:          0 :         nix_dump(file, "  \tmsixoff = %d", nix->msixoff);
    1503         [ #  # ]:          0 :         for (i = 0; i < nix->nb_cpt_lf; i++)
    1504         [ #  # ]:          0 :                 nix_dump(file, "  \tcpt_msixoff[%d] = %d", i, nix->cpt_msixoff[i]);
    1505         [ #  # ]:          0 :         nix_dump(file, "  \tcints = %d", nix->cints);
    1506         [ #  # ]:          0 :         nix_dump(file, "  \tqints = %d", nix->qints);
    1507         [ #  # ]:          0 :         nix_dump(file, "  \tsdp_link = %d", nix->sdp_link);
    1508         [ #  # ]:          0 :         nix_dump(file, "  \tptp_en = %d", nix->ptp_en);
    1509         [ #  # ]:          0 :         nix_dump(file, "  \trss_alg_idx = %d", nix->rss_alg_idx);
    1510         [ #  # ]:          0 :         nix_dump(file, "  \ttx_pause = %d", nix->tx_pause);
    1511         [ #  # ]:          0 :         nix_dump(file, "  \tinl_inb_ena = %d", nix->inl_inb_ena);
    1512         [ #  # ]:          0 :         nix_dump(file, "  \tinl_outb_ena = %d", nix->inl_outb_ena);
    1513         [ #  # ]:          0 :         nix_dump(file, "  \tinb_sa_base = 0x%p", nix->inb_sa_base);
    1514         [ #  # ]:          0 :         nix_dump(file, "  \tinb_sa_sz = %" PRIu64, nix->inb_sa_sz);
    1515         [ #  # ]:          0 :         nix_dump(file, "  \toutb_sa_base = 0x%p", nix->outb_sa_base);
    1516         [ #  # ]:          0 :         nix_dump(file, "  \toutb_sa_sz = %" PRIu64, nix->outb_sa_sz);
    1517         [ #  # ]:          0 :         nix_dump(file, "  \toutb_err_sso_pffunc = 0x%x", nix->outb_err_sso_pffunc);
    1518         [ #  # ]:          0 :         nix_dump(file, "  \tcpt_lf_base = 0x%p", nix->cpt_lf_base);
    1519         [ #  # ]:          0 :         nix_dump(file, "  \tnb_cpt_lf = %d", nix->nb_cpt_lf);
    1520         [ #  # ]:          0 :         nix_dump(file, "  \tinb_inl_dev = %d", nix->inb_inl_dev);
    1521                 :            : 
    1522                 :          0 : }
    1523                 :            : 
    1524                 :            : void
    1525                 :          0 : roc_nix_inl_dev_dump(struct roc_nix_inl_dev *roc_inl_dev, FILE *file)
    1526                 :            : {
    1527                 :          0 :         struct idev_cfg *idev = idev_get_cfg();
    1528                 :            :         struct nix_inl_dev *inl_dev = NULL;
    1529                 :            :         struct dev *dev = NULL;
    1530                 :            :         int i;
    1531                 :            : 
    1532         [ #  # ]:          0 :         if (roc_inl_dev) {
    1533                 :          0 :                 inl_dev = (struct nix_inl_dev *)&roc_inl_dev->reserved;
    1534                 :            :         } else {
    1535   [ #  #  #  # ]:          0 :                 if (idev && idev->nix_inl_dev)
    1536                 :            :                         inl_dev = idev->nix_inl_dev;
    1537                 :            :                 else
    1538                 :            :                         return;
    1539                 :            :         }
    1540                 :            : 
    1541                 :            :         dev = &inl_dev->dev;
    1542         [ #  # ]:          0 :         nix_dump(file, "nix_inl_dev@%p", inl_dev);
    1543   [ #  #  #  #  :          0 :         nix_dump(file, "  pf = %d", dev_get_pf(dev->pf_func));
                   #  # ]
    1544   [ #  #  #  #  :          0 :         nix_dump(file, "  vf = %d", dev_get_vf(dev->pf_func));
                   #  # ]
    1545         [ #  # ]:          0 :         nix_dump(file, "  bar2 = 0x%" PRIx64, dev->bar2);
    1546         [ #  # ]:          0 :         nix_dump(file, "  bar4 = 0x%" PRIx64, dev->bar4);
    1547                 :            : 
    1548         [ #  # ]:          0 :         nix_dump(file, "  \tpci_dev = %p", inl_dev->pci_dev);
    1549         [ #  # ]:          0 :         nix_dump(file, "  \tnix_base = 0x%" PRIxPTR "", inl_dev->nix_base);
    1550         [ #  # ]:          0 :         nix_dump(file, "  \tsso_base = 0x%" PRIxPTR "", inl_dev->sso_base);
    1551         [ #  # ]:          0 :         nix_dump(file, "  \tssow_base = 0x%" PRIxPTR "", inl_dev->ssow_base);
    1552         [ #  # ]:          0 :         nix_dump(file, "  \tnix_msixoff = %d", inl_dev->nix_msixoff);
    1553         [ #  # ]:          0 :         nix_dump(file, "  \tsso_msixoff = %d", inl_dev->sso_msixoff);
    1554         [ #  # ]:          0 :         nix_dump(file, "  \tssow_msixoff = %d", inl_dev->ssow_msixoff);
    1555         [ #  # ]:          0 :         nix_dump(file, "  \tnix_cints = %d", inl_dev->cints);
    1556         [ #  # ]:          0 :         nix_dump(file, "  \tnix_qints = %d", inl_dev->qints);
    1557         [ #  # ]:          0 :         nix_dump(file, "  \tinb_sa_base = 0x%p", inl_dev->inb_sa_base);
    1558         [ #  # ]:          0 :         nix_dump(file, "  \tinb_sa_sz = %d", inl_dev->inb_sa_sz);
    1559         [ #  # ]:          0 :         nix_dump(file, "  \txaq_buf_size = %u", inl_dev->xaq_buf_size);
    1560         [ #  # ]:          0 :         nix_dump(file, "  \txae_waes = %u", inl_dev->xae_waes);
    1561         [ #  # ]:          0 :         nix_dump(file, "  \tiue = %u", inl_dev->iue);
    1562         [ #  # ]:          0 :         nix_dump(file, "  \txaq_aura = 0x%" PRIx64, inl_dev->xaq.aura_handle);
    1563         [ #  # ]:          0 :         nix_dump(file, "  \txaq_mem = 0x%p", inl_dev->xaq.mem);
    1564                 :            : 
    1565         [ #  # ]:          0 :         nix_dump(file, "  \tinl_dev_rq:");
    1566         [ #  # ]:          0 :         for (i = 0; i < inl_dev->nb_rqs; i++)
    1567                 :          0 :                 roc_nix_rq_dump(&inl_dev->rqs[i], file);
    1568                 :            : }
    1569                 :            : 
    1570                 :            : void
    1571         [ #  # ]:          0 : roc_nix_inl_outb_cpt_lfs_dump(struct roc_nix *roc_nix, FILE *file)
    1572                 :            : {
    1573                 :            :         struct nix *nix = roc_nix_to_nix_priv(roc_nix);
    1574                 :          0 :         struct roc_cpt_lf *lf_base = nix->cpt_lf_base;
    1575                 :            :         int i;
    1576                 :            : 
    1577         [ #  # ]:          0 :         nix_dump(file, "nix@%p", nix);
    1578         [ #  # ]:          0 :         for (i = 0; i < nix->nb_cpt_lf; i++) {
    1579         [ #  # ]:          0 :                 nix_dump(file, "NIX inline dev outbound CPT LFs:");
    1580                 :          0 :                 cpt_lf_print(&lf_base[i]);
    1581                 :            :         }
    1582                 :          0 : }
    1583                 :            : 
    1584                 :            : static void
    1585                 :          0 : nix_tm_sqe_dump(uint64_t *sqe, int head_off, int end_off, int instr_sz, FILE *file, int full,
    1586                 :            :                 uint16_t *num)
    1587                 :            : {
    1588                 :          0 :         int i, j, inc = (8 * (0x2 >> instr_sz)), segs;
    1589                 :            :         uint64_t *ptr;
    1590                 :            : 
    1591   [ #  #  #  # ]:          0 :         if (!sqe || !(*num))
    1592                 :            :                 return;
    1593                 :            : 
    1594                 :            :         ptr = sqe + (head_off * inc);
    1595         [ #  # ]:          0 :         for (i = head_off; i < end_off; i++) {
    1596         [ #  # ]:          0 :                 if (!(*num))
    1597                 :            :                         return;
    1598                 :          0 :                 ptr = sqe + (i * inc);
    1599         [ #  # ]:          0 :                 nix_dump(file, "Entry : %d >>>>>\n", i);
    1600         [ #  # ]:          0 :                 nix_dump(file, "\t\tSEND_HDR[0]: 0x%016lx SEND_HDR[1]: 0x%016lx\n", *ptr,
    1601                 :            :                          *(ptr + 1));
    1602                 :          0 :                 *num = *num - 1;
    1603         [ #  # ]:          0 :                 if (!full)
    1604                 :          0 :                         continue;
    1605                 :          0 :                 ptr += 2;
    1606         [ #  # ]:          0 :                 if (((*ptr >> 60) & 0xF) == NIX_SUBDC_EXT) {
    1607         [ #  # ]:          0 :                         nix_dump(file, "\t\tSUBDC_EXT[0]: 0x%016lx DUBDC_EXT[1]: 0x%016lx\n", *ptr,
    1608                 :            :                                  *(ptr + 1));
    1609                 :          0 :                         ptr += 2;
    1610                 :            :                 }
    1611         [ #  # ]:          0 :                 if (((*ptr >> 60) & 0xF) == NIX_SUBDC_AGE_AND_STATS) {
    1612         [ #  # ]:          0 :                         nix_dump(file,
    1613                 :            :                                  "\t\tSUBDC_AGE_STATS[0]: 0x%016lx SUBDC_AGE_STATS[1]: 0x%016lx\n",
    1614                 :            :                                  *ptr, *(ptr + 1));
    1615                 :          0 :                         ptr += 2;
    1616                 :            :                 }
    1617         [ #  # ]:          0 :                 if (((*ptr >> 60) & 0xF) == NIX_SUBDC_JUMP) {
    1618         [ #  # ]:          0 :                         nix_dump(file, "\t\tSUBDC_JUMP: 0x%016lx\n", *ptr);
    1619                 :            :                         ptr += 1;
    1620                 :          0 :                         ptr = (uint64_t *)*ptr;
    1621                 :            :                 }
    1622         [ #  # ]:          0 :                 if (((*ptr >> 60) & 0xF) == NIX_SUBDC_CRC) {
    1623         [ #  # ]:          0 :                         nix_dump(file, "\t\tSUBDC_CRC[0]: 0x%016lx SUBDC_CRC[1]: 0x%016lx\n", *ptr,
    1624                 :            :                                  *(ptr + 1));
    1625                 :          0 :                         ptr += 2;
    1626                 :            :                 }
    1627                 :            :                 /* We are not parsing immediate send descriptor */
    1628         [ #  # ]:          0 :                 if (((*ptr >> 60) & 0xF) == NIX_SUBDC_IMM) {
    1629         [ #  # ]:          0 :                         nix_dump(file, "\t\tSUBDC_IMM: 0x%016lx ", *ptr);
    1630                 :          0 :                         continue;
    1631                 :            :                 }
    1632                 :            :                 while (1) {
    1633         [ #  # ]:          0 :                         if (((*ptr >> 60) & 0xF) == NIX_SUBDC_SG) {
    1634         [ #  # ]:          0 :                                 nix_dump(file, "\t\tSUBDC_SG: 0x%016lx   ", *ptr);
    1635                 :          0 :                                 segs = (*ptr >> 48) & 0x3;
    1636                 :          0 :                                 ptr += 1;
    1637         [ #  # ]:          0 :                                 for (j = 0; j < segs; j++) {
    1638         [ #  # ]:          0 :                                         nix_dump(file, "\t\t\t  0x%016lx   ", *ptr);
    1639                 :          0 :                                         ptr += 1;
    1640                 :            :                                 }
    1641         [ #  # ]:          0 :                                 if (segs == 2)
    1642                 :          0 :                                         ptr += 1;
    1643         [ #  # ]:          0 :                         } else if (((*ptr >> 60) & 0xF) == NIX_SUBDC_SG2) {
    1644         [ #  # ]:          0 :                                 nix_dump(file, "\t\tSUBDC_SG2: 0x%016lx   ", *ptr);
    1645                 :            :                                 ptr += 1;
    1646         [ #  # ]:          0 :                                 nix_dump(file, "\t\t\t  0x%016lx   ", *ptr);
    1647                 :          0 :                                 ptr += 1;
    1648                 :            :                         } else
    1649                 :            :                                 break;
    1650                 :            :                 }
    1651                 :            :         }
    1652                 :            : }
    1653                 :            : 
    1654                 :            : int
    1655                 :          0 : roc_nix_sq_desc_dump(struct roc_nix *roc_nix, uint16_t q, uint16_t offset, uint16_t num, FILE *file)
    1656                 :            : {
    1657                 :            :         int head_off, count, rc = 0, tail_off, full = 0;
    1658                 :            :         struct nix *nix = roc_nix_to_nix_priv(roc_nix);
    1659                 :          0 :         struct roc_nix_sq *sq = nix->sqs[q];
    1660                 :            :         void *sqb_buf, *dat, *tail_sqb;
    1661                 :            :         struct ndc_sync_op *ndc_req;
    1662                 :          0 :         struct dev *dev = &nix->dev;
    1663                 :            :         uint16_t sqes_per_sqb;
    1664                 :            :         struct mbox *mbox;
    1665                 :            : 
    1666                 :          0 :         mbox = dev->mbox;
    1667                 :            :         /* Sync NDC-NIX-TX for LF */
    1668                 :          0 :         ndc_req = mbox_alloc_msg_ndc_sync_op(mbox_get(mbox));
    1669         [ #  # ]:          0 :         if (ndc_req == NULL) {
    1670                 :            :                 mbox_put(mbox);
    1671                 :          0 :                 return -EFAULT;
    1672                 :            :         }
    1673                 :            : 
    1674                 :          0 :         ndc_req->nix_lf_tx_sync = 1;
    1675         [ #  # ]:          0 :         if (mbox_process(mbox))
    1676                 :            :                 rc |= NIX_ERR_NDC_SYNC;
    1677                 :            :         mbox_put(mbox);
    1678                 :            : 
    1679         [ #  # ]:          0 :         if (rc)
    1680                 :          0 :                 plt_err("NDC_SYNC failed rc %d", rc);
    1681                 :            : 
    1682                 :          0 :         rc = nix_q_ctx_get(dev, NIX_AQ_CTYPE_SQ, q, (void *)&dat);
    1683         [ #  # ]:          0 :         if (rc)
    1684                 :            :                 return rc;
    1685         [ #  # ]:          0 :         if (roc_model_is_cn9k()) {
    1686                 :          0 :                 volatile struct nix_sq_ctx_s *ctx = (struct nix_sq_ctx_s *)dat;
    1687                 :            : 
    1688   [ #  #  #  # ]:          0 :                 if (ctx->mnq_dis || ctx->lmt_dis)
    1689                 :            :                         full = 1;
    1690                 :            : 
    1691                 :          0 :                 count = ctx->sqb_count;
    1692                 :          0 :                 sqb_buf = (void *)ctx->head_sqb;
    1693                 :          0 :                 tail_sqb = (void *)ctx->tail_sqb;
    1694                 :          0 :                 head_off = ctx->head_offset;
    1695                 :          0 :                 tail_off = ctx->tail_offset;
    1696         [ #  # ]:          0 :         } else if (roc_model_is_cn10k()) {
    1697                 :          0 :                 volatile struct nix_cn10k_sq_ctx_s *ctx = (struct nix_cn10k_sq_ctx_s *)dat;
    1698                 :            : 
    1699   [ #  #  #  # ]:          0 :                 if (ctx->mnq_dis || ctx->lmt_dis)
    1700                 :            :                         full = 1;
    1701                 :            : 
    1702                 :          0 :                 count = ctx->sqb_count;
    1703                 :          0 :                 sqb_buf = (void *)ctx->head_sqb;
    1704                 :          0 :                 tail_sqb = (void *)ctx->tail_sqb;
    1705                 :          0 :                 head_off = ctx->head_offset;
    1706                 :          0 :                 tail_off = ctx->tail_offset;
    1707                 :            :         } else {
    1708                 :          0 :                 volatile struct nix_cn20k_sq_ctx_s *ctx = (struct nix_cn20k_sq_ctx_s *)dat;
    1709                 :            : 
    1710   [ #  #  #  # ]:          0 :                 if (ctx->mnq_dis || ctx->lmt_dis)
    1711                 :            :                         full = 1;
    1712                 :            : 
    1713                 :          0 :                 count = ctx->sqb_count;
    1714                 :          0 :                 sqb_buf = (void *)ctx->head_sqb;
    1715                 :          0 :                 tail_sqb = (void *)ctx->tail_sqb;
    1716                 :          0 :                 head_off = ctx->head_offset;
    1717                 :          0 :                 tail_off = ctx->tail_offset;
    1718                 :            :         }
    1719                 :          0 :         sqes_per_sqb = 1 << sq->sqes_per_sqb_log2;
    1720         [ #  # ]:          0 :         while (count) {
    1721                 :            :                 void *next_sqb;
    1722                 :            : 
    1723         [ #  # ]:          0 :                 if (sqb_buf == tail_sqb) {
    1724         [ #  # ]:          0 :                         if ((head_off + offset) >= tail_off) /* Nothing to be dump */
    1725                 :            :                                 return 0;
    1726                 :          0 :                         head_off += tail_off;
    1727                 :          0 :                         break;
    1728         [ #  # ]:          0 :                 } else if ((head_off + offset) >= sqes_per_sqb) {
    1729                 :          0 :                         next_sqb = *(void **)((uint64_t *)sqb_buf +
    1730                 :          0 :                                               (uint32_t)((sqes_per_sqb - 1) *
    1731                 :          0 :                                                          (0x2 >> sq->max_sqe_sz) * 8));
    1732                 :            :                         /* While traffic running HW may freed/reused this SQE */
    1733         [ #  # ]:          0 :                         if (!next_sqb)
    1734                 :            :                                 return 0;
    1735                 :            :                         sqb_buf = next_sqb;
    1736                 :            :                         head_off = 0;
    1737                 :          0 :                         count--;
    1738                 :            :                 } else {
    1739                 :            :                         head_off += offset;
    1740                 :            :                         break;
    1741                 :            :                 }
    1742                 :            :         }
    1743         [ #  # ]:          0 :         while (count) {
    1744                 :            :                 void *next_sqb;
    1745                 :            : 
    1746         [ #  # ]:          0 :                 if (sqb_buf == tail_sqb)
    1747                 :          0 :                         nix_tm_sqe_dump(sqb_buf, head_off, tail_off, sq->max_sqe_sz, file, full,
    1748                 :            :                                         &num);
    1749                 :            :                 else
    1750                 :          0 :                         nix_tm_sqe_dump(sqb_buf, head_off, (sqes_per_sqb - 1), sq->max_sqe_sz, file,
    1751                 :            :                                         full, &num);
    1752         [ #  # ]:          0 :                 if (!num)
    1753                 :            :                         break;
    1754                 :          0 :                 next_sqb = *(void **)((uint64_t *)sqb_buf +
    1755                 :          0 :                                       (uint32_t)((sqes_per_sqb - 1) * (0x2 >> sq->max_sqe_sz) * 8));
    1756                 :            :                 /* While traffic running HW may freed/reused this SQE */
    1757         [ #  # ]:          0 :                 if (!next_sqb)
    1758                 :            :                         return 0;
    1759                 :            :                 sqb_buf = next_sqb;
    1760                 :            :                 head_off = 0;
    1761                 :          0 :                 count--;
    1762                 :            :         }
    1763                 :            : 
    1764                 :            :         return 0;
    1765                 :            : }

Generated by: LCOV version 1.14