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

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright(C) 2021 Marvell.
       3                 :            :  */
       4                 :            : 
       5                 :            : #ifndef _ROC_NIX_PRIV_H_
       6                 :            : #define _ROC_NIX_PRIV_H_
       7                 :            : 
       8                 :            : /* Constants */
       9                 :            : #define NIX_CQ_ENTRY_SZ      128
      10                 :            : #define NIX_CQ_ENTRY64_SZ    512
      11                 :            : #define NIX_CQ_ALIGN         ((uint16_t)512)
      12                 :            : #define NIX_MAX_SQB          ((uint16_t)512)
      13                 :            : #define NIX_DEF_SQB          ((uint16_t)16)
      14                 :            : #define NIX_MIN_SQB          ((uint16_t)8)
      15                 :            : #define NIX_SQB_PREFETCH     ((uint16_t)1)
      16                 :            : 
      17                 :            : /* Apply BP/DROP when CQ is 95% full */
      18                 :            : #define NIX_CQ_THRESH_LEVEL     (5 * 256 / 100)
      19                 :            : #define NIX_CQ_SEC_THRESH_LEVEL (25 * 256 / 100)
      20                 :            : /* Apply LBP at 75% of actual BP */
      21                 :            : #define NIX_CQ_LPB_THRESH_FRAC  (75 * 16 / 100)
      22                 :            : #define NIX_CQ_FULL_ERRATA_SKID (1024ull * 256)
      23                 :            : #define NIX_RQ_AURA_BP_THRESH(percent, limit, shift) ((((limit) * (percent)) / 100) >> (shift))
      24                 :            : 
      25                 :            : /* IRQ triggered when NIX_LF_CINTX_CNT[QCOUNT] crosses this value */
      26                 :            : #define CQ_CQE_THRESH_DEFAULT   0x1ULL
      27                 :            : #define CQ_TIMER_THRESH_DEFAULT 0xAULL /* ~1usec i.e (0xA * 100nsec) */
      28                 :            : #define CQ_TIMER_THRESH_MAX     255
      29                 :            : 
      30                 :            : struct nix_qint {
      31                 :            :         struct nix *nix;
      32                 :            :         uint8_t qintx;
      33                 :            : };
      34                 :            : 
      35                 :            : /* Traffic Manager */
      36                 :            : #define NIX_TM_MAX_HW_TXSCHQ 1024
      37                 :            : #define NIX_TM_HW_ID_INVALID UINT32_MAX
      38                 :            : #define NIX_TM_CHAN_INVALID UINT16_MAX
      39                 :            : 
      40                 :            : /* TM flags */
      41                 :            : #define NIX_TM_HIERARCHY_ENA    BIT_ULL(0)
      42                 :            : #define NIX_TM_TL1_NO_SP        BIT_ULL(1)
      43                 :            : #define NIX_TM_TL1_ACCESS       BIT_ULL(2)
      44                 :            : #define NIX_TM_MARK_VLAN_DEI_EN BIT_ULL(3)
      45                 :            : #define NIX_TM_MARK_IP_DSCP_EN  BIT_ULL(4)
      46                 :            : #define NIX_TM_MARK_IP_ECN_EN   BIT_ULL(5)
      47                 :            : 
      48                 :            : #define NIX_TM_MARK_EN_MASK                                                    \
      49                 :            :         (NIX_TM_MARK_IP_DSCP_EN | NIX_TM_MARK_IP_ECN_EN |                      \
      50                 :            :          NIX_TM_MARK_VLAN_DEI_EN)
      51                 :            : 
      52                 :            : #define NIX_TM_MARK_VLAN_DEI_SHIFT  0 /* Leave 16b for VLAN for FP logic */
      53                 :            : #define NIX_TM_MARK_IPV4_DSCP_SHIFT 16
      54                 :            : #define NIX_TM_MARK_IPV6_DSCP_SHIFT 24
      55                 :            : #define NIX_TM_MARK_IPV4_ECN_SHIFT  32
      56                 :            : #define NIX_TM_MARK_IPV6_ECN_SHIFT  40
      57                 :            : 
      58                 :            : #define ROC_NIX_INL_PROFILE_CNT 8
      59                 :            : 
      60                 :            : struct nix_tm_tb {
      61                 :            :         /** Token bucket rate (bytes per second) */
      62                 :            :         uint64_t rate;
      63                 :            : 
      64                 :            :         /** Token bucket size (bytes), a.k.a. max burst size */
      65                 :            :         uint64_t size;
      66                 :            : };
      67                 :            : 
      68                 :            : struct nix_tm_node {
      69                 :            :         TAILQ_ENTRY(nix_tm_node) node;
      70                 :            : 
      71                 :            :         /* Input params */
      72                 :            :         enum roc_nix_tm_tree tree;
      73                 :            :         uint32_t id;
      74                 :            :         uint32_t priority;
      75                 :            :         uint32_t weight;
      76                 :            :         uint16_t lvl;
      77                 :            :         uint16_t rel_chan;
      78                 :            :         uint32_t parent_id;
      79                 :            :         uint32_t shaper_profile_id;
      80                 :            :         void (*free_fn)(void *node);
      81                 :            : 
      82                 :            :         /* Derived params */
      83                 :            :         uint32_t hw_id;
      84                 :            :         uint16_t hw_lvl;
      85                 :            :         uint32_t rr_prio;
      86                 :            :         uint32_t rr_num;
      87                 :            :         uint32_t max_prio;
      88                 :            :         uint32_t parent_hw_id;
      89                 :            :         uint32_t flags : 16;
      90                 :            : #define NIX_TM_NODE_HWRES   BIT_ULL(0)
      91                 :            : #define NIX_TM_NODE_ENABLED BIT_ULL(1)
      92                 :            :         /* Shaper algorithm for RED state @NIX_REDALG_E */
      93                 :            :         uint32_t red_algo : 2;
      94                 :            :         uint32_t pkt_mode : 1;
      95                 :            :         uint32_t pkt_mode_set : 1;
      96                 :            :         uint32_t bp_capa : 1;
      97                 :            : 
      98                 :            :         bool child_realloc;
      99                 :            :         struct nix_tm_node *parent;
     100                 :            : 
     101                 :            :         /* Non-leaf node sp count */
     102                 :            :         uint32_t n_sp_priorities;
     103                 :            : 
     104                 :            :         /* Last stats */
     105                 :            :         uint64_t last_pkts;
     106                 :            :         uint64_t last_bytes;
     107                 :            : };
     108                 :            : 
     109                 :            : struct nix_tm_shaper_profile {
     110                 :            :         TAILQ_ENTRY(nix_tm_shaper_profile) shaper;
     111                 :            :         struct nix_tm_tb commit;
     112                 :            :         struct nix_tm_tb peak;
     113                 :            :         int32_t pkt_len_adj;
     114                 :            :         int32_t pkt_mode_adj;
     115                 :            :         bool pkt_mode;
     116                 :            :         uint32_t id;
     117                 :            :         int8_t accuracy;
     118                 :            :         void (*free_fn)(void *profile);
     119                 :            : 
     120                 :            :         uint32_t ref_cnt;
     121                 :            : };
     122                 :            : 
     123                 :            : TAILQ_HEAD(nix_tm_node_list, nix_tm_node);
     124                 :            : TAILQ_HEAD(nix_tm_shaper_profile_list, nix_tm_shaper_profile);
     125                 :            : 
     126                 :            : struct nix {
     127                 :            :         uint16_t reta[ROC_NIX_RSS_GRPS][ROC_NIX_RSS_RETA_MAX];
     128                 :            :         enum roc_nix_rss_reta_sz reta_sz;
     129                 :            :         struct plt_pci_device *pci_dev;
     130                 :            :         uint16_t bpid[NIX_MAX_CHAN];
     131                 :            :         struct nix_qint *qints_mem;
     132                 :            :         struct nix_qint *cints_mem;
     133                 :            :         uint8_t configured_qints;
     134                 :            :         uint8_t configured_cints;
     135                 :            :         uint8_t exact_match_ena;
     136                 :            :         struct roc_nix_rq **rqs;
     137                 :            :         struct roc_nix_sq **sqs;
     138                 :            :         uint16_t vwqe_interval;
     139                 :            :         uint16_t tx_chan_base;
     140                 :            :         uint16_t rx_chan_base;
     141                 :            :         uint16_t nb_rx_queues;
     142                 :            :         uint16_t nb_tx_queues;
     143                 :            :         uint8_t lso_tsov6_idx;
     144                 :            :         uint8_t lso_tsov4_idx;
     145                 :            :         uint8_t lso_udp_tun_idx[ROC_NIX_LSO_TUN_MAX];
     146                 :            :         uint8_t lso_tun_idx[ROC_NIX_LSO_TUN_MAX];
     147                 :            :         uint8_t lf_rx_stats;
     148                 :            :         uint8_t lf_tx_stats;
     149                 :            :         uint8_t rx_chan_cnt;
     150                 :            :         uint8_t rss_alg_idx;
     151                 :            :         uint8_t tx_chan_cnt;
     152                 :            :         uintptr_t lmt_base;
     153                 :            :         uint8_t cgx_links;
     154                 :            :         uint8_t lbk_links;
     155                 :            :         uint8_t sdp_links;
     156                 :            :         uint8_t tx_link;
     157                 :            :         uint16_t sqb_size;
     158                 :            :         uint32_t dmac_flt_idx;
     159                 :            :         /* Without FCS, with L2 overhead */
     160                 :            :         uint16_t mtu;
     161                 :            :         uint16_t chan_cnt;
     162                 :            :         uint16_t msixoff;
     163                 :            :         uint8_t rx_pause;
     164                 :            :         uint8_t tx_pause;
     165                 :            :         uint8_t pfc_rx_pause;
     166                 :            :         uint8_t pfc_tx_pause;
     167                 :            :         uint16_t cev;
     168                 :            :         uint64_t rx_cfg;
     169                 :            :         struct dev dev;
     170                 :            :         uint16_t cints;
     171                 :            :         uint16_t qints;
     172                 :            :         uintptr_t base;
     173                 :            :         bool sdp_link;
     174                 :            :         bool lbk_link;
     175                 :            :         bool esw_link;
     176                 :            :         bool ptp_en;
     177                 :            :         bool is_nix1;
     178                 :            : 
     179                 :            :         /* Traffic manager info */
     180                 :            : 
     181                 :            :         /* Contiguous resources per lvl */
     182                 :            :         struct plt_bitmap *schq_contig_bmp[NIX_TXSCH_LVL_CNT];
     183                 :            :         /* Dis-contiguous resources per lvl */
     184                 :            :         struct plt_bitmap *schq_bmp[NIX_TXSCH_LVL_CNT];
     185                 :            :         void *schq_bmp_mem;
     186                 :            : 
     187                 :            :         struct nix_tm_shaper_profile_list shaper_profile_list;
     188                 :            :         struct nix_tm_node_list trees[ROC_NIX_TM_TREE_MAX];
     189                 :            :         enum roc_nix_tm_tree tm_tree;
     190                 :            :         uint64_t tm_rate_min;
     191                 :            :         uint16_t tm_root_lvl;
     192                 :            :         uint16_t tm_flags;
     193                 :            :         uint16_t tm_link_cfg_lvl;
     194                 :            :         uint8_t tm_aggr_lvl_rr_prio;
     195                 :            :         uint16_t contig_rsvd[NIX_TXSCH_LVL_CNT];
     196                 :            :         uint16_t discontig_rsvd[NIX_TXSCH_LVL_CNT];
     197                 :            :         uint64_t tm_markfmt_en;
     198                 :            :         uint8_t tm_markfmt_null;
     199                 :            :         uint8_t tm_markfmt[ROC_NIX_TM_MARK_MAX][ROC_NIX_TM_MARK_COLOR_MAX];
     200                 :            : 
     201                 :            :         /* Ipsec info */
     202                 :            :         uint16_t cpt_msixoff[MAX_RVU_BLKLF_CNT];
     203                 :            :         bool inl_inb_ena;
     204                 :            :         bool inl_outb_ena;
     205                 :            :         void *inb_sa_base[ROC_NIX_INL_PROFILE_CNT];
     206                 :            :         size_t inb_sa_sz[ROC_NIX_INL_PROFILE_CNT];
     207                 :            :         uint32_t inb_sa_max[ROC_NIX_INL_PROFILE_CNT];
     208                 :            :         uint32_t ipsec_in_max_spi;
     209                 :            :         uint16_t ipsec_prof_id;
     210                 :            :         uint8_t reass_prof_id;
     211                 :            :         uint64_t rx_inline_cfg0;
     212                 :            :         uint64_t rx_inline_cfg1;
     213                 :            :         uint32_t inb_spi_mask;
     214                 :            :         void *outb_sa_base;
     215                 :            :         size_t outb_sa_sz;
     216                 :            :         uint16_t outb_err_sso_pffunc;
     217                 :            :         struct roc_cpt_lf *cpt_lf_base;
     218                 :            :         uint16_t nb_cpt_lf;
     219                 :            :         uint16_t outb_se_ring_cnt;
     220                 :            :         uint16_t outb_se_ring_base;
     221                 :            :         uint16_t cpt_lbpid;
     222                 :            :         uint16_t cpt_nixbpid;
     223                 :            :         uint64_t cpt_eng_caps;
     224                 :            :         bool need_meta_aura;
     225                 :            :         /* Mode provided by driver */
     226                 :            :         bool inb_inl_dev;
     227                 :            : 
     228                 :            : } __plt_cache_aligned;
     229                 :            : 
     230                 :            : enum nix_err_status {
     231                 :            :         NIX_ERR_PARAM = -2048,
     232                 :            :         NIX_ERR_NO_MEM,
     233                 :            :         NIX_ERR_INVALID_RANGE,
     234                 :            :         NIX_ERR_INTERNAL,
     235                 :            :         NIX_ERR_OP_NOTSUP,
     236                 :            :         NIX_ERR_HW_NOTSUP,
     237                 :            :         NIX_ERR_QUEUE_INVALID_RANGE,
     238                 :            :         NIX_ERR_AQ_READ_FAILED,
     239                 :            :         NIX_ERR_AQ_WRITE_FAILED,
     240                 :            :         NIX_ERR_TM_LEAF_NODE_GET,
     241                 :            :         NIX_ERR_TM_INVALID_LVL,
     242                 :            :         NIX_ERR_TM_INVALID_PRIO,
     243                 :            :         NIX_ERR_TM_INVALID_PARENT,
     244                 :            :         NIX_ERR_TM_NODE_EXISTS,
     245                 :            :         NIX_ERR_TM_INVALID_NODE,
     246                 :            :         NIX_ERR_TM_INVALID_SHAPER_PROFILE,
     247                 :            :         NIX_ERR_TM_PKT_MODE_MISMATCH,
     248                 :            :         NIX_ERR_TM_WEIGHT_EXCEED,
     249                 :            :         NIX_ERR_TM_CHILD_EXISTS,
     250                 :            :         NIX_ERR_TM_INVALID_PEAK_SZ,
     251                 :            :         NIX_ERR_TM_INVALID_PEAK_RATE,
     252                 :            :         NIX_ERR_TM_INVALID_COMMIT_SZ,
     253                 :            :         NIX_ERR_TM_INVALID_COMMIT_RATE,
     254                 :            :         NIX_ERR_TM_SHAPER_PROFILE_IN_USE,
     255                 :            :         NIX_ERR_TM_SHAPER_PROFILE_EXISTS,
     256                 :            :         NIX_ERR_TM_SHAPER_PKT_LEN_ADJUST,
     257                 :            :         NIX_ERR_TM_INVALID_TREE,
     258                 :            :         NIX_ERR_TM_PARENT_PRIO_UPDATE,
     259                 :            :         NIX_ERR_TM_PRIO_EXCEEDED,
     260                 :            :         NIX_ERR_TM_PRIO_ORDER,
     261                 :            :         NIX_ERR_TM_MULTIPLE_RR_GROUPS,
     262                 :            :         NIX_ERR_TM_SQ_UPDATE_FAIL,
     263                 :            :         NIX_ERR_NDC_SYNC,
     264                 :            : };
     265                 :            : 
     266                 :            : enum nix_q_size {
     267                 :            :         nix_q_size_16, /* 16 entries */
     268                 :            :         nix_q_size_64, /* 64 entries */
     269                 :            :         nix_q_size_256,
     270                 :            :         nix_q_size_1K,
     271                 :            :         nix_q_size_4K,
     272                 :            :         nix_q_size_16K,
     273                 :            :         nix_q_size_64K,
     274                 :            :         nix_q_size_256K,
     275                 :            :         nix_q_size_1M, /* Million entries */
     276                 :            :         nix_q_size_max
     277                 :            : };
     278                 :            : 
     279                 :            : static inline struct nix *
     280                 :            : roc_nix_to_nix_priv(struct roc_nix *roc_nix)
     281                 :            : {
     282   [ #  #  #  #  :          0 :         return (struct nix *)&roc_nix->reserved[0];
          #  #  #  #  #  
             #  #  #  #  
                      # ]
     283                 :            : }
     284                 :            : 
     285                 :            : static inline struct roc_nix *
     286                 :            : nix_priv_to_roc_nix(struct nix *nix)
     287                 :            : {
     288         [ #  # ]:          0 :         return (struct roc_nix *)((char *)nix -
     289                 :            :                                   offsetof(struct roc_nix, reserved));
     290                 :            : }
     291                 :            : 
     292                 :            : /* IRQ */
     293                 :            : int nix_register_irqs(struct nix *nix);
     294                 :            : void nix_unregister_irqs(struct nix *nix);
     295                 :            : 
     296                 :            : /* TM */
     297                 :            : #define NIX_TM_TREE_MASK_ALL                                                   \
     298                 :            :         (BIT(ROC_NIX_TM_DEFAULT) | BIT(ROC_NIX_TM_RLIMIT) |                    \
     299                 :            :          BIT(ROC_NIX_TM_USER))
     300                 :            : 
     301                 :            : /* NIX_MAX_HW_FRS ==
     302                 :            :  * NIX_TM_DFLT_RR_WT * NIX_TM_RR_QUANTUM_MAX / ROC_NIX_TM_MAX_SCHED_WT
     303                 :            :  */
     304                 :            : #define NIX_TM_DFLT_RR_WT 71
     305                 :            : 
     306                 :            : /* Default TL1 priority and Quantum from AF */
     307                 :            : #define NIX_TM_TL1_DFLT_RR_QTM  ((1 << 24) - 1)
     308                 :            : 
     309                 :            : struct nix_tm_shaper_data {
     310                 :            :         uint64_t burst_exponent;
     311                 :            :         uint64_t burst_mantissa;
     312                 :            :         uint64_t div_exp;
     313                 :            :         uint64_t exponent;
     314                 :            :         uint64_t mantissa;
     315                 :            :         uint64_t burst;
     316                 :            :         uint64_t rate;
     317                 :            : };
     318                 :            : 
     319                 :            : static inline uint64_t
     320                 :            : nix_tm_weight_to_rr_quantum(uint64_t weight)
     321                 :            : {
     322                 :            :         uint64_t max = NIX_CN9K_TM_RR_QUANTUM_MAX;
     323                 :            : 
     324                 :            :         /* From CN10K onwards, we only configure RR weight */
     325   [ #  #  #  # ]:          0 :         if (!roc_model_is_cn9k())
     326                 :            :                 return weight;
     327                 :            : 
     328                 :          0 :         weight &= (uint64_t)max;
     329                 :          0 :         return (weight * max) / ROC_NIX_CN9K_TM_RR_WEIGHT_MAX;
     330                 :            : }
     331                 :            : 
     332                 :            : static inline bool
     333                 :            : nix_tm_have_tl1_access(struct nix *nix)
     334                 :            : {
     335   [ #  #  #  #  :          0 :         return !!(nix->tm_flags & NIX_TM_TL1_ACCESS);
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                #  #  # ]
     336                 :            : }
     337                 :            : 
     338                 :            : static inline bool
     339                 :            : nix_tm_is_leaf(struct nix *nix, int lvl)
     340                 :            : {
     341   [ #  #  #  #  :          0 :         if (nix_tm_have_tl1_access(nix))
          #  #  #  #  #  
             #  #  #  #  
                      # ]
     342                 :          0 :                 return (lvl == ROC_TM_LVL_QUEUE);
     343                 :          0 :         return (lvl == ROC_TM_LVL_SCH4);
     344                 :            : }
     345                 :            : 
     346                 :            : static inline struct nix_tm_node_list *
     347                 :            : nix_tm_node_list(struct nix *nix, enum roc_nix_tm_tree tree)
     348                 :            : {
     349                 :          0 :         return &nix->trees[tree];
     350                 :            : }
     351                 :            : 
     352                 :            : static inline const char *
     353                 :            : nix_tm_hwlvl2str(uint32_t hw_lvl)
     354                 :            : {
     355   [ #  #  #  #  :          0 :         switch (hw_lvl) {
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
          #  #  #  #  #  
                   #  # ]
     356                 :            :         case NIX_TXSCH_LVL_MDQ:
     357                 :            :                 return "SMQ/MDQ";
     358                 :          0 :         case NIX_TXSCH_LVL_TL4:
     359                 :          0 :                 return "TL4";
     360                 :          0 :         case NIX_TXSCH_LVL_TL3:
     361                 :          0 :                 return "TL3";
     362                 :          0 :         case NIX_TXSCH_LVL_TL2:
     363                 :          0 :                 return "TL2";
     364                 :          0 :         case NIX_TXSCH_LVL_TL1:
     365                 :          0 :                 return "TL1";
     366                 :            :         default:
     367                 :            :                 break;
     368                 :            :         }
     369                 :            : 
     370                 :          0 :         return "???";
     371                 :            : }
     372                 :            : 
     373                 :            : static inline const char *
     374                 :            : nix_tm_tree2str(enum roc_nix_tm_tree tree)
     375                 :            : {
     376   [ #  #  #  # ]:          0 :         if (tree == ROC_NIX_TM_DEFAULT)
     377                 :            :                 return "Default Tree";
     378   [ #  #  #  # ]:          0 :         else if (tree == ROC_NIX_TM_RLIMIT)
     379                 :            :                 return "Rate Limit Tree";
     380   [ #  #  #  # ]:          0 :         else if (tree == ROC_NIX_TM_PFC)
     381                 :            :                 return "PFC Tree";
     382                 :            :         else if (tree == ROC_NIX_TM_USER)
     383                 :          0 :                 return "User Tree";
     384                 :            :         return "???";
     385                 :            : }
     386                 :            : 
     387                 :            : /*
     388                 :            :  * TM priv ops.
     389                 :            :  */
     390                 :            : 
     391                 :            : int nix_tm_conf_init(struct roc_nix *roc_nix);
     392                 :            : void nix_tm_conf_fini(struct roc_nix *roc_nix);
     393                 :            : int nix_tm_leaf_data_get(struct nix *nix, uint16_t sq, uint32_t *rr_quantum,
     394                 :            :                          uint16_t *smq);
     395                 :            : int nix_tm_sq_flush_pre(struct roc_nix_sq *sq);
     396                 :            : int nix_tm_sq_flush_post(struct roc_nix_sq *sq);
     397                 :            : int nix_tm_smq_xoff(struct nix *nix, struct nix_tm_node *node, bool enable);
     398                 :            : int nix_tm_prepare_default_tree(struct roc_nix *roc_nix);
     399                 :            : int nix_tm_node_add(struct roc_nix *roc_nix, struct nix_tm_node *node);
     400                 :            : int nix_tm_node_delete(struct roc_nix *roc_nix, uint32_t node_id,
     401                 :            :                        enum roc_nix_tm_tree tree, bool free);
     402                 :            : int nix_tm_free_node_resource(struct nix *nix, struct nix_tm_node *node);
     403                 :            : int nix_tm_free_resources(struct roc_nix *roc_nix, uint32_t tree_mask,
     404                 :            :                           bool hw_only);
     405                 :            : int nix_tm_clear_path_xoff(struct nix *nix, struct nix_tm_node *node);
     406                 :            : void nix_tm_clear_shaper_profiles(struct nix *nix);
     407                 :            : int nix_tm_alloc_txschq(struct nix *nix, enum roc_nix_tm_tree tree);
     408                 :            : int nix_tm_assign_resources(struct nix *nix, enum roc_nix_tm_tree tree);
     409                 :            : int nix_tm_release_resources(struct nix *nix, uint8_t hw_lvl, bool contig,
     410                 :            :                              bool above_thresh);
     411                 :            : void nix_tm_copy_rsp_to_nix(struct nix *nix, struct nix_txsch_alloc_rsp *rsp);
     412                 :            : 
     413                 :            : int nix_tm_txsch_reg_config(struct nix *nix, enum roc_nix_tm_tree tree);
     414                 :            : int nix_tm_update_parent_info(struct nix *nix, enum roc_nix_tm_tree tree);
     415                 :            : int nix_tm_sq_sched_conf(struct nix *nix, struct nix_tm_node *node,
     416                 :            :                          bool rr_quantum_only);
     417                 :            : 
     418                 :            : int nix_rq_cn9k_cfg(struct dev *dev, struct roc_nix_rq *rq, uint16_t qints,
     419                 :            :                     bool cfg, bool ena);
     420                 :            : int nix_rq_cn10k_cfg(struct dev *dev, struct roc_nix_rq *rq, uint16_t qints, bool cfg, bool ena);
     421                 :            : int nix_rq_cfg(struct dev *dev, struct roc_nix_rq *rq, uint16_t qints, bool cfg,
     422                 :            :                bool ena);
     423                 :            : int nix_rq_ena_dis(struct dev *dev, struct roc_nix_rq *rq, bool enable);
     424                 :            : int nix_tm_bp_config_get(struct roc_nix *roc_nix, bool *is_enabled);
     425                 :            : int nix_tm_bp_config_set(struct roc_nix *roc_nix, uint16_t sq, uint16_t tc,
     426                 :            :                          bool enable);
     427                 :            : void nix_rq_vwqe_flush(struct roc_nix_rq *rq, uint16_t vwqe_interval);
     428                 :            : int nix_tm_mark_init(struct nix *nix);
     429                 :            : void nix_tm_sq_free_sqe_buffer(uint64_t *sqe, int head_off, int end_off, int instr_sz);
     430                 :            : int roc_nix_tm_sq_free_pending_sqe(struct nix *nix, int q);
     431                 :            : 
     432                 :            : /*
     433                 :            :  * TM priv utils.
     434                 :            :  */
     435                 :            : uint16_t nix_tm_lvl2nix(struct nix *nix, uint32_t lvl);
     436                 :            : uint16_t nix_tm_lvl2nix_tl1_root(uint32_t lvl);
     437                 :            : uint16_t nix_tm_lvl2nix_tl2_root(uint32_t lvl);
     438                 :            : uint16_t nix_tm_resource_avail(struct nix *nix, uint8_t hw_lvl, bool contig);
     439                 :            : int nix_tm_validate_prio(struct nix *nix, uint32_t lvl, uint32_t parent_id,
     440                 :            :                          uint32_t priority, enum roc_nix_tm_tree tree);
     441                 :            : struct nix_tm_node *nix_tm_node_search(struct nix *nix, uint32_t node_id,
     442                 :            :                                        enum roc_nix_tm_tree tree);
     443                 :            : struct nix_tm_shaper_profile *nix_tm_shaper_profile_search(struct nix *nix,
     444                 :            :                                                            uint32_t id);
     445                 :            : uint8_t nix_tm_sw_xoff_prep(struct nix_tm_node *node, bool enable,
     446                 :            :                             volatile uint64_t *reg, volatile uint64_t *regval);
     447                 :            : uint32_t nix_tm_check_rr(struct nix *nix, uint32_t parent_id,
     448                 :            :                          enum roc_nix_tm_tree tree, uint32_t *rr_prio,
     449                 :            :                          uint32_t *max_prio);
     450                 :            : uint64_t nix_tm_shaper_profile_rate_min(struct nix *nix);
     451                 :            : uint64_t nix_tm_shaper_rate_conv(uint64_t value, uint64_t *exponent_p,
     452                 :            :                                  uint64_t *mantissa_p, uint64_t *div_exp_p,
     453                 :            :                                  int8_t accuracy);
     454                 :            : uint64_t nix_tm_shaper_burst_conv(uint64_t value, uint64_t *exponent_p,
     455                 :            :                                   uint64_t *mantissa_p);
     456                 :            : bool nix_tm_child_res_valid(struct nix_tm_node_list *list,
     457                 :            :                             struct nix_tm_node *parent);
     458                 :            : uint16_t nix_tm_resource_estimate(struct nix *nix, uint16_t *schq_contig,
     459                 :            :                                   uint16_t *schq, enum roc_nix_tm_tree tree);
     460                 :            : uint8_t nix_tm_tl1_default_prep(struct nix *nix, uint32_t schq,
     461                 :            :                                 volatile uint64_t *reg,
     462                 :            :                                 volatile uint64_t *regval);
     463                 :            : uint8_t nix_tm_topology_reg_prep(struct nix *nix, struct nix_tm_node *node,
     464                 :            :                                  volatile uint64_t *reg,
     465                 :            :                                  volatile uint64_t *regval,
     466                 :            :                                  volatile uint64_t *regval_mask);
     467                 :            : uint8_t nix_tm_sched_reg_prep(struct nix *nix, struct nix_tm_node *node,
     468                 :            :                               volatile uint64_t *reg,
     469                 :            :                               volatile uint64_t *regval);
     470                 :            : uint8_t nix_tm_shaper_reg_prep(struct nix_tm_node *node,
     471                 :            :                                struct nix_tm_shaper_profile *profile,
     472                 :            :                                volatile uint64_t *reg,
     473                 :            :                                volatile uint64_t *regval);
     474                 :            : struct nix_tm_node *nix_tm_node_alloc(void);
     475                 :            : void nix_tm_node_free(struct nix_tm_node *node);
     476                 :            : struct nix_tm_shaper_profile *nix_tm_shaper_profile_alloc(void);
     477                 :            : void nix_tm_shaper_profile_free(struct nix_tm_shaper_profile *profile);
     478                 :            : 
     479                 :            : uint64_t nix_get_blkaddr(struct dev *dev);
     480                 :            : void nix_cn10k_lf_rq_dump(__io struct nix_cn10k_rq_ctx_s *ctx, FILE *file);
     481                 :            : void nix_lf_rq_dump(__io struct nix_cn20k_rq_ctx_s *ctx, FILE *file);
     482                 :            : int nix_lf_gen_reg_dump(uintptr_t nix_lf_base, uint64_t *data);
     483                 :            : int nix_lf_stat_reg_dump(uintptr_t nix_lf_base, uint64_t *data, uint8_t lf_tx_stats,
     484                 :            :                          uint8_t lf_rx_stats);
     485                 :            : int nix_lf_int_reg_dump(uintptr_t nix_lf_base, uint64_t *data, uint16_t qints, uint16_t cints);
     486                 :            : int nix_q_ctx_get(struct dev *dev, uint8_t ctype, uint16_t qid, __io void **ctx_p);
     487                 :            : uint8_t nix_tm_lbk_relchan_get(struct nix *nix);
     488                 :            : int nix_vlan_tpid_set(struct mbox *mbox, uint16_t pcifunc, uint32_t type, uint16_t tpid);
     489                 :            : 
     490                 :            : /*
     491                 :            :  * Telemetry
     492                 :            :  */
     493                 :            : int nix_tel_node_add(struct roc_nix *roc_nix);
     494                 :            : void nix_tel_node_del(struct roc_nix *roc_nix);
     495                 :            : int nix_tel_node_add_rq(struct roc_nix_rq *rq);
     496                 :            : int nix_tel_node_add_cq(struct roc_nix_cq *cq);
     497                 :            : int nix_tel_node_add_sq(struct roc_nix_sq *sq);
     498                 :            : 
     499                 :            : /*
     500                 :            :  * RSS
     501                 :            :  */
     502                 :            : int nix_rss_reta_pffunc_set(struct roc_nix *roc_nix, uint8_t group,
     503                 :            :                             uint16_t reta[ROC_NIX_RSS_RETA_MAX], uint16_t pf_func);
     504                 :            : int nix_rss_flowkey_pffunc_set(struct roc_nix *roc_nix, uint8_t *alg_idx, uint32_t flowkey,
     505                 :            :                                uint8_t group, int mcam_index, uint16_t pf_func);
     506                 :            : 
     507                 :            : int nix_bpids_alloc(struct dev *dev, uint8_t type, uint8_t bp_cnt, uint16_t *bpids);
     508                 :            : int nix_bpids_free(struct dev *dev, uint8_t bp_cnt, uint16_t *bpids);
     509                 :            : 
     510                 :            : #endif /* _ROC_NIX_PRIV_H_ */

Generated by: LCOV version 1.14