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