Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright(C) 2024 Marvell.
3 : : */
4 : :
5 : : #include "roc_api.h"
6 : :
7 : : #include "cn20k_cryptodev_ops.h"
8 : : #include "cn20k_ethdev.h"
9 : : #include "cn20k_eventdev.h"
10 : : #include "cn20k_tx_worker.h"
11 : : #include "cn20k_worker.h"
12 : : #include "cnxk_common.h"
13 : : #include "cnxk_eventdev.h"
14 : : #include "cnxk_vector_adptr.h"
15 : : #include "cnxk_worker.h"
16 : :
17 : : #define CN20K_SET_EVDEV_DEQ_OP(dev, deq_op, deq_ops) \
18 : : deq_op = deq_ops[dev->rx_offloads & (NIX_RX_OFFLOAD_MAX - 1)]
19 : :
20 : : #define CN20K_SET_EVDEV_ENQ_OP(dev, enq_op, enq_ops) \
21 : : enq_op = enq_ops[dev->tx_offloads & (NIX_TX_OFFLOAD_MAX - 1)]
22 : :
23 : : static uint8_t
24 : : cn20k_sso_hw_weight(uint8_t weight)
25 : : {
26 : : /* Map DPDK weight 0-255 to HW weight 1-255 */
27 : 0 : return (weight + 1) > CN20K_SSO_WEIGHT_MAX ? CN20K_SSO_WEIGHT_MAX : (weight + 1);
28 : : }
29 : :
30 : : static int
31 [ # # ]: 0 : cn20k_sso_queue_setup(struct rte_eventdev *event_dev, uint8_t queue_id,
32 : : const struct rte_event_queue_conf *queue_conf)
33 : : {
34 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
35 : : uint8_t priority, weight, affinity;
36 : :
37 : 0 : priority = CNXK_QOS_NORMALIZE(queue_conf->priority, 0, RTE_EVENT_DEV_PRIORITY_LOWEST,
38 : : CNXK_SSO_PRIORITY_CNT);
39 [ # # ]: 0 : weight = cn20k_sso_hw_weight(queue_conf->weight);
40 : 0 : affinity = CNXK_QOS_NORMALIZE(queue_conf->affinity, 0, RTE_EVENT_QUEUE_AFFINITY_HIGHEST,
41 : : CNXK_SSO_AFFINITY_CNT);
42 : :
43 : 0 : plt_sso_dbg("Queue=%u prio=%u weight=%u affinity=%u", queue_id, priority, weight, affinity);
44 : :
45 : 0 : return roc_sso_hwgrp_set_priority(&dev->sso, queue_id, weight, affinity, priority);
46 : : }
47 : :
48 : : static int
49 [ # # # # : 0 : cn20k_sso_queue_attribute_set(struct rte_eventdev *event_dev, uint8_t queue_id, uint32_t attr_id,
# ]
50 : : uint64_t attr_value)
51 : : {
52 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
53 : : uint8_t priority, weight, affinity;
54 : : struct rte_event_queue_conf *conf;
55 : :
56 : 0 : conf = &event_dev->data->queues_cfg[queue_id];
57 : :
58 [ # # # # : 0 : switch (attr_id) {
# ]
59 : 0 : case RTE_EVENT_QUEUE_ATTR_PRIORITY:
60 : 0 : conf->priority = attr_value;
61 : 0 : break;
62 : 0 : case RTE_EVENT_QUEUE_ATTR_WEIGHT:
63 : 0 : conf->weight = attr_value;
64 : 0 : break;
65 : 0 : case RTE_EVENT_QUEUE_ATTR_AFFINITY:
66 : 0 : conf->affinity = attr_value;
67 : 0 : break;
68 : 0 : case RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS:
69 : : case RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES:
70 : : case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
71 : : case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
72 : : /* FALLTHROUGH */
73 : 0 : plt_sso_dbg("Unsupported attribute id %u", attr_id);
74 : 0 : return -ENOTSUP;
75 : 0 : default:
76 : 0 : plt_err("Invalid attribute id %u", attr_id);
77 : 0 : return -EINVAL;
78 : : }
79 : :
80 : 0 : priority = CNXK_QOS_NORMALIZE(conf->priority, 0, RTE_EVENT_DEV_PRIORITY_LOWEST,
81 : : CNXK_SSO_PRIORITY_CNT);
82 [ # # ]: 0 : weight = cn20k_sso_hw_weight(conf->weight);
83 : 0 : affinity = CNXK_QOS_NORMALIZE(conf->affinity, 0, RTE_EVENT_QUEUE_AFFINITY_HIGHEST,
84 : : CNXK_SSO_AFFINITY_CNT);
85 : :
86 : 0 : return roc_sso_hwgrp_set_priority(&dev->sso, queue_id, weight, affinity, priority);
87 : : }
88 : :
89 : : static void *
90 : 0 : cn20k_sso_init_hws_mem(void *arg, uint8_t port_id)
91 : : {
92 : : struct cnxk_sso_evdev *dev = arg;
93 : : struct cn20k_sso_hws *ws;
94 : :
95 : : /* Allocate event port memory */
96 : 0 : ws = rte_zmalloc("cn20k_ws", sizeof(struct cn20k_sso_hws) + RTE_CACHE_LINE_SIZE,
97 : : RTE_CACHE_LINE_SIZE);
98 [ # # ]: 0 : if (ws == NULL) {
99 : 0 : plt_err("Failed to alloc memory for port=%d", port_id);
100 : 0 : return NULL;
101 : : }
102 : :
103 : : /* First cache line is reserved for cookie */
104 : 0 : ws = (struct cn20k_sso_hws *)((uint8_t *)ws + RTE_CACHE_LINE_SIZE);
105 : 0 : ws->base = roc_sso_hws_base_get(&dev->sso, port_id);
106 : 0 : ws->hws_id = port_id;
107 [ # # ]: 0 : ws->swtag_req = 0;
108 : 0 : ws->gw_wdata = cnxk_sso_hws_prf_wdata(dev);
109 : 0 : ws->gw_rdata = SSO_TT_EMPTY << 32;
110 : 0 : ws->xae_waes = dev->sso.feat.xaq_wq_entries;
111 : :
112 : 0 : return ws;
113 : : }
114 : :
115 : : static int
116 : 0 : cn20k_sso_hws_link(void *arg, void *port, uint16_t *map, uint16_t nb_link, uint8_t profile)
117 : : {
118 : : struct cnxk_sso_evdev *dev = arg;
119 : : struct cn20k_sso_hws *ws = port;
120 : :
121 : 0 : return roc_sso_hws_link(&dev->sso, ws->hws_id, map, nb_link, profile, 0);
122 : : }
123 : :
124 : : static int
125 : 0 : cn20k_sso_hws_unlink(void *arg, void *port, uint16_t *map, uint16_t nb_link, uint8_t profile)
126 : : {
127 : : struct cnxk_sso_evdev *dev = arg;
128 : : struct cn20k_sso_hws *ws = port;
129 : :
130 : 0 : return roc_sso_hws_unlink(&dev->sso, ws->hws_id, map, nb_link, profile, 0);
131 : : }
132 : :
133 : : static void
134 : 0 : cn20k_sso_hws_setup(void *arg, void *hws, uintptr_t grp_base)
135 : : {
136 : : struct cnxk_sso_evdev *dev = arg;
137 : : struct cn20k_sso_hws *ws = hws;
138 : : uint64_t val;
139 : :
140 : 0 : ws->grp_base = grp_base;
141 : 0 : ws->fc_mem = (int64_t __rte_atomic *)dev->fc_iova;
142 : 0 : ws->xaq_lmt = dev->xaq_lmt;
143 : 0 : ws->fc_cache_space = (int64_t __rte_atomic *)dev->fc_cache_space;
144 [ # # ]: 0 : ws->aw_lmt = dev->sso.lmt_base;
145 : 0 : ws->gw_wdata = cnxk_sso_hws_prf_wdata(dev);
146 : 0 : ws->lmt_base = dev->sso.lmt_base;
147 : :
148 : : /* Set get_work timeout for HWS */
149 : 0 : val = NSEC2USEC(dev->deq_tmo_ns);
150 [ # # ]: 0 : val = val ? val - 1 : 0;
151 : 0 : plt_write64(val, ws->base + SSOW_LF_GWS_NW_TIM);
152 : 0 : }
153 : :
154 : : static void
155 : 0 : cn20k_sso_hws_release(void *arg, void *hws)
156 : : {
157 : : struct cnxk_sso_evdev *dev = arg;
158 : : struct cn20k_sso_hws *ws = hws;
159 : : uint16_t i, j;
160 : :
161 [ # # ]: 0 : for (i = 0; i < CNXK_SSO_MAX_PROFILES; i++)
162 [ # # ]: 0 : for (j = 0; j < dev->nb_event_queues; j++)
163 : 0 : roc_sso_hws_unlink(&dev->sso, ws->hws_id, &j, 1, i, 0);
164 : : memset(ws, 0, sizeof(*ws));
165 : 0 : }
166 : :
167 : : static int
168 : 0 : cn20k_sso_hws_flush_events(void *hws, uint8_t queue_id, uintptr_t base, cnxk_handle_event_t fn,
169 : : void *arg)
170 : : {
171 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(arg);
172 : : uint64_t retry = CNXK_SSO_FLUSH_RETRY_MAX;
173 : : struct cn20k_sso_hws *ws = hws;
174 : : uint64_t cq_ds_cnt = 1;
175 : : uint64_t aq_cnt = 1;
176 : : uint64_t ds_cnt = 1;
177 : : struct rte_event ev;
178 : : uint64_t val, req;
179 : :
180 : 0 : plt_write64(0, base + SSO_LF_GGRP_QCTL);
181 : :
182 : 0 : roc_sso_hws_gwc_invalidate(&dev->sso, &ws->hws_id, 1);
183 : 0 : plt_write64(0, ws->base + SSOW_LF_GWS_OP_GWC_INVAL);
184 : 0 : req = queue_id; /* GGRP ID */
185 : : req |= BIT_ULL(18); /* Grouped */
186 : 0 : req |= BIT_ULL(16); /* WAIT */
187 : :
188 : 0 : aq_cnt = plt_read64(base + SSO_LF_GGRP_AQ_CNT);
189 : 0 : ds_cnt = plt_read64(base + SSO_LF_GGRP_MISC_CNT);
190 : 0 : cq_ds_cnt = plt_read64(base + SSO_LF_GGRP_INT_CNT);
191 : 0 : cq_ds_cnt &= 0x3FFF3FFF0000;
192 : :
193 [ # # ]: 0 : while (aq_cnt || cq_ds_cnt || ds_cnt) {
194 : 0 : plt_write64(req, ws->base + SSOW_LF_GWS_OP_GET_WORK0);
195 : 0 : cn20k_sso_hws_get_work_empty(ws, &ev, dev->rx_offloads);
196 [ # # # # ]: 0 : if (fn != NULL && ev.u64 != 0)
197 : 0 : fn(arg, ev);
198 [ # # ]: 0 : if (ev.sched_type != SSO_TT_EMPTY)
199 : 0 : cnxk_sso_hws_swtag_flush(ws->base);
200 [ # # ]: 0 : else if (retry-- == 0)
201 : : break;
202 : : do {
203 [ # # ]: 0 : val = plt_read64(ws->base + SSOW_LF_GWS_PENDSTATE);
204 [ # # ]: 0 : } while (val & BIT_ULL(56));
205 : : aq_cnt = plt_read64(base + SSO_LF_GGRP_AQ_CNT);
206 : : ds_cnt = plt_read64(base + SSO_LF_GGRP_MISC_CNT);
207 : : cq_ds_cnt = plt_read64(base + SSO_LF_GGRP_INT_CNT);
208 : : /* Extract cq and ds count */
209 : 0 : cq_ds_cnt &= 0x3FFF3FFF0000;
210 : : }
211 : :
212 [ # # ]: 0 : if (aq_cnt || cq_ds_cnt || ds_cnt)
213 : : return -EAGAIN;
214 : :
215 : 0 : plt_write64(0, ws->base + SSOW_LF_GWS_OP_GWC_INVAL);
216 : 0 : roc_sso_hws_gwc_invalidate(&dev->sso, &ws->hws_id, 1);
217 : : rte_mb();
218 : :
219 : 0 : return 0;
220 : : }
221 : :
222 : : static void
223 : : cn20k_sso_set_rsrc(void *arg)
224 : : {
225 : : struct cnxk_sso_evdev *dev = arg;
226 : :
227 : 0 : dev->max_event_ports = dev->sso.max_hws;
228 : 0 : dev->max_event_queues = dev->sso.max_hwgrp > RTE_EVENT_MAX_QUEUES_PER_DEV ?
229 : 0 : RTE_EVENT_MAX_QUEUES_PER_DEV :
230 : : dev->sso.max_hwgrp;
231 : : }
232 : :
233 : : static int
234 : 0 : cn20k_sso_rsrc_init(void *arg, uint8_t hws, uint8_t hwgrp)
235 : : {
236 : : struct cnxk_tim_evdev *tim_dev = cnxk_tim_priv_get();
237 : : struct cnxk_sso_evdev *dev = arg;
238 : : uint16_t nb_tim_lfs;
239 : :
240 [ # # ]: 0 : nb_tim_lfs = tim_dev ? tim_dev->nb_rings : 0;
241 : 0 : return roc_sso_rsrc_init(&dev->sso, hws, hwgrp, nb_tim_lfs);
242 : : }
243 : :
244 : : static int
245 [ # # ]: 0 : cn20k_sso_updt_tx_adptr_data(const struct rte_eventdev *event_dev)
246 : : {
247 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
248 : : int i;
249 : :
250 [ # # ]: 0 : if (dev->tx_adptr_data == NULL)
251 : : return 0;
252 : :
253 [ # # ]: 0 : for (i = 0; i < dev->nb_event_ports; i++) {
254 : 0 : struct cn20k_sso_hws *ws = event_dev->data->ports[i];
255 : : void *ws_cookie;
256 : :
257 : : ws_cookie = cnxk_sso_hws_get_cookie(ws);
258 : 0 : ws_cookie = rte_realloc_socket(ws_cookie,
259 : : sizeof(struct cnxk_sso_hws_cookie) +
260 : : sizeof(struct cn20k_sso_hws) +
261 : 0 : dev->tx_adptr_data_sz,
262 : : RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);
263 [ # # ]: 0 : if (ws_cookie == NULL)
264 : : return -ENOMEM;
265 : 0 : ws = RTE_PTR_ADD(ws_cookie, sizeof(struct cnxk_sso_hws_cookie));
266 : 0 : memcpy(&ws->tx_adptr_data, dev->tx_adptr_data, dev->tx_adptr_data_sz);
267 : 0 : event_dev->data->ports[i] = ws;
268 : : }
269 : :
270 : : return 0;
271 : : }
272 : :
273 : : #if defined(RTE_ARCH_ARM64)
274 : : static inline void
275 : : cn20k_sso_fp_tmplt_fns_set(struct rte_eventdev *event_dev)
276 : : {
277 : : #if !defined(CNXK_DIS_TMPLT_FUNC)
278 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
279 : :
280 : : const event_dequeue_burst_t sso_hws_deq_burst[NIX_RX_OFFLOAD_MAX] = {
281 : : #define R(name, flags) [flags] = cn20k_sso_hws_deq_burst_##name,
282 : : NIX_RX_FASTPATH_MODES
283 : : #undef R
284 : : };
285 : :
286 : : const event_dequeue_burst_t sso_hws_deq_tmo_burst[NIX_RX_OFFLOAD_MAX] = {
287 : : #define R(name, flags) [flags] = cn20k_sso_hws_deq_tmo_burst_##name,
288 : : NIX_RX_FASTPATH_MODES
289 : : #undef R
290 : : };
291 : :
292 : : const event_dequeue_burst_t sso_hws_deq_seg_burst[NIX_RX_OFFLOAD_MAX] = {
293 : : #define R(name, flags) [flags] = cn20k_sso_hws_deq_seg_burst_##name,
294 : : NIX_RX_FASTPATH_MODES
295 : : #undef R
296 : : };
297 : :
298 : : const event_dequeue_burst_t sso_hws_deq_tmo_seg_burst[NIX_RX_OFFLOAD_MAX] = {
299 : : #define R(name, flags) [flags] = cn20k_sso_hws_deq_tmo_seg_burst_##name,
300 : : NIX_RX_FASTPATH_MODES
301 : : #undef R
302 : : };
303 : :
304 : : const event_dequeue_burst_t sso_hws_reas_deq_burst[NIX_RX_OFFLOAD_MAX] = {
305 : : #define R(name, flags) [flags] = cn20k_sso_hws_reas_deq_burst_##name,
306 : : NIX_RX_FASTPATH_MODES
307 : : #undef R
308 : : };
309 : :
310 : : const event_dequeue_burst_t sso_hws_reas_deq_tmo_burst[NIX_RX_OFFLOAD_MAX] = {
311 : : #define R(name, flags) [flags] = cn20k_sso_hws_reas_deq_tmo_burst_##name,
312 : : NIX_RX_FASTPATH_MODES
313 : : #undef R
314 : : };
315 : :
316 : : const event_dequeue_burst_t sso_hws_reas_deq_seg_burst[NIX_RX_OFFLOAD_MAX] = {
317 : : #define R(name, flags) [flags] = cn20k_sso_hws_reas_deq_seg_burst_##name,
318 : : NIX_RX_FASTPATH_MODES
319 : : #undef R
320 : : };
321 : :
322 : : const event_dequeue_burst_t sso_hws_reas_deq_tmo_seg_burst[NIX_RX_OFFLOAD_MAX] = {
323 : : #define R(name, flags) [flags] = cn20k_sso_hws_reas_deq_tmo_seg_burst_##name,
324 : : NIX_RX_FASTPATH_MODES
325 : : #undef R
326 : : };
327 : :
328 : : /* Tx modes */
329 : : const event_tx_adapter_enqueue_t sso_hws_tx_adptr_enq[NIX_TX_OFFLOAD_MAX] = {
330 : : #define T(name, sz, flags) [flags] = cn20k_sso_hws_tx_adptr_enq_##name,
331 : : NIX_TX_FASTPATH_MODES
332 : : #undef T
333 : : };
334 : :
335 : : const event_tx_adapter_enqueue_t sso_hws_tx_adptr_enq_seg[NIX_TX_OFFLOAD_MAX] = {
336 : : #define T(name, sz, flags) [flags] = cn20k_sso_hws_tx_adptr_enq_seg_##name,
337 : : NIX_TX_FASTPATH_MODES
338 : : #undef T
339 : : };
340 : :
341 : : if (dev->rx_offloads & NIX_RX_MULTI_SEG_F) {
342 : : if (dev->rx_offloads & NIX_RX_REAS_F) {
343 : : CN20K_SET_EVDEV_DEQ_OP(dev, event_dev->dequeue_burst,
344 : : sso_hws_reas_deq_seg_burst);
345 : : if (dev->is_timeout_deq)
346 : : CN20K_SET_EVDEV_DEQ_OP(dev, event_dev->dequeue_burst,
347 : : sso_hws_reas_deq_tmo_seg_burst);
348 : : } else {
349 : : CN20K_SET_EVDEV_DEQ_OP(dev, event_dev->dequeue_burst,
350 : : sso_hws_deq_seg_burst);
351 : :
352 : : if (dev->is_timeout_deq)
353 : : CN20K_SET_EVDEV_DEQ_OP(dev, event_dev->dequeue_burst,
354 : : sso_hws_deq_tmo_seg_burst);
355 : : }
356 : : } else {
357 : : if (dev->rx_offloads & NIX_RX_REAS_F) {
358 : : CN20K_SET_EVDEV_DEQ_OP(dev, event_dev->dequeue_burst,
359 : : sso_hws_reas_deq_burst);
360 : :
361 : : if (dev->is_timeout_deq)
362 : : CN20K_SET_EVDEV_DEQ_OP(dev, event_dev->dequeue_burst,
363 : : sso_hws_reas_deq_tmo_burst);
364 : : } else {
365 : : CN20K_SET_EVDEV_DEQ_OP(dev, event_dev->dequeue_burst, sso_hws_deq_burst);
366 : :
367 : : if (dev->is_timeout_deq)
368 : : CN20K_SET_EVDEV_DEQ_OP(dev, event_dev->dequeue_burst,
369 : : sso_hws_deq_tmo_burst);
370 : : }
371 : : }
372 : :
373 : : if (dev->tx_offloads & NIX_TX_MULTI_SEG_F)
374 : : CN20K_SET_EVDEV_ENQ_OP(dev, event_dev->txa_enqueue, sso_hws_tx_adptr_enq_seg);
375 : : else
376 : : CN20K_SET_EVDEV_ENQ_OP(dev, event_dev->txa_enqueue, sso_hws_tx_adptr_enq);
377 : :
378 : : event_dev->txa_enqueue_same_dest = event_dev->txa_enqueue;
379 : : #else
380 : : RTE_SET_USED(event_dev);
381 : : #endif
382 : : }
383 : :
384 : : static inline void
385 : : cn20k_sso_fp_blk_fns_set(struct rte_eventdev *event_dev)
386 : : {
387 : : #if defined(CNXK_DIS_TMPLT_FUNC)
388 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
389 : :
390 : : event_dev->dequeue_burst = cn20k_sso_hws_deq_burst_all_offload;
391 : : if (dev->rx_offloads & NIX_RX_OFFLOAD_TSTAMP_F)
392 : : event_dev->dequeue_burst = cn20k_sso_hws_deq_burst_all_offload_tst;
393 : : event_dev->txa_enqueue = cn20k_sso_hws_tx_adptr_enq_seg_all_offload;
394 : : event_dev->txa_enqueue_same_dest = cn20k_sso_hws_tx_adptr_enq_seg_all_offload;
395 : : if (dev->tx_offloads & (NIX_TX_OFFLOAD_OL3_OL4_CSUM_F | NIX_TX_OFFLOAD_VLAN_QINQ_F |
396 : : NIX_TX_OFFLOAD_TSO_F | NIX_TX_OFFLOAD_TSTAMP_F)) {
397 : : event_dev->txa_enqueue = cn20k_sso_hws_tx_adptr_enq_seg_all_offload_tst;
398 : : event_dev->txa_enqueue_same_dest = cn20k_sso_hws_tx_adptr_enq_seg_all_offload_tst;
399 : : }
400 : : #else
401 : : RTE_SET_USED(event_dev);
402 : : #endif
403 : : }
404 : : #endif
405 : :
406 : : static void
407 : : cn20k_sso_fp_fns_set(struct rte_eventdev *event_dev)
408 : : {
409 : : #if defined(RTE_ARCH_ARM64)
410 : : cn20k_sso_fp_blk_fns_set(event_dev);
411 : : cn20k_sso_fp_tmplt_fns_set(event_dev);
412 : :
413 : : event_dev->enqueue_burst = cn20k_sso_hws_enq_burst;
414 : : event_dev->enqueue_new_burst = cn20k_sso_hws_enq_new_burst;
415 : : event_dev->enqueue_forward_burst = cn20k_sso_hws_enq_fwd_burst;
416 : :
417 : : event_dev->ca_enqueue = cn20k_cpt_crypto_adapter_enqueue;
418 : : event_dev->profile_switch = cn20k_sso_hws_profile_switch;
419 : : event_dev->preschedule_modify = cn20k_sso_hws_preschedule_modify;
420 : : event_dev->preschedule = cn20k_sso_hws_preschedule;
421 : : #else
422 : : RTE_SET_USED(event_dev);
423 : : #endif
424 : : }
425 : :
426 : : static void
427 : 0 : cn20k_sso_info_get(struct rte_eventdev *event_dev, struct rte_event_dev_info *dev_info)
428 : : {
429 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
430 : :
431 : 0 : dev_info->driver_name = RTE_STR(EVENTDEV_NAME_CN20K_PMD);
432 : 0 : cnxk_sso_info_get(dev, dev_info);
433 : 0 : dev_info->max_event_port_enqueue_depth = UINT32_MAX;
434 : 0 : }
435 : :
436 : : static int
437 : 0 : cn20k_sso_dev_configure(const struct rte_eventdev *event_dev)
438 : : {
439 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
440 : : int rc;
441 : :
442 : 0 : rc = cnxk_sso_dev_validate(event_dev, 1, UINT32_MAX);
443 [ # # ]: 0 : if (rc < 0) {
444 : 0 : plt_err("Invalid event device configuration");
445 : 0 : return -EINVAL;
446 : : }
447 : :
448 : 0 : rc = cn20k_sso_rsrc_init(dev, dev->nb_event_ports, dev->nb_event_queues);
449 [ # # ]: 0 : if (rc < 0) {
450 : 0 : plt_err("Failed to initialize SSO resources");
451 : 0 : return -ENODEV;
452 : : }
453 : :
454 : 0 : rc = cnxk_sso_xaq_allocate(dev);
455 [ # # ]: 0 : if (rc < 0)
456 : 0 : goto cnxk_rsrc_fini;
457 : :
458 [ # # # ]: 0 : dev->gw_mode = cnxk_sso_hws_preschedule_get(event_dev->data->dev_conf.preschedule_type);
459 : :
460 : 0 : rc = cnxk_setup_event_ports(event_dev, cn20k_sso_init_hws_mem, cn20k_sso_hws_setup);
461 [ # # ]: 0 : if (rc < 0)
462 : 0 : goto cnxk_rsrc_fini;
463 : :
464 : : /* Restore any prior port-queue mapping. */
465 : 0 : cnxk_sso_restore_links(event_dev, cn20k_sso_hws_link);
466 : :
467 : 0 : dev->configured = 1;
468 : : rte_mb();
469 : :
470 : 0 : return 0;
471 : 0 : cnxk_rsrc_fini:
472 : 0 : roc_sso_rsrc_fini(&dev->sso);
473 : 0 : dev->nb_event_ports = 0;
474 : 0 : return rc;
475 : : }
476 : :
477 : : static int
478 : 0 : cn20k_sso_port_setup(struct rte_eventdev *event_dev, uint8_t port_id,
479 : : const struct rte_event_port_conf *port_conf)
480 : : {
481 : :
482 : : RTE_SET_USED(port_conf);
483 : 0 : return cnxk_sso_port_setup(event_dev, port_id, cn20k_sso_hws_setup);
484 : : }
485 : :
486 : : static void
487 [ # # ]: 0 : cn20k_sso_port_release(void *port)
488 : : {
489 : : struct cnxk_sso_hws_cookie *gws_cookie = cnxk_sso_hws_get_cookie(port);
490 : : struct cnxk_sso_evdev *dev;
491 : :
492 [ # # ]: 0 : if (port == NULL)
493 : : return;
494 : :
495 [ # # ]: 0 : dev = cnxk_sso_pmd_priv(gws_cookie->event_dev);
496 [ # # ]: 0 : if (!gws_cookie->configured)
497 : 0 : goto free;
498 : :
499 : 0 : cn20k_sso_hws_release(dev, port);
500 : : memset(gws_cookie, 0, sizeof(*gws_cookie));
501 : 0 : free:
502 : 0 : rte_free(gws_cookie);
503 : : }
504 : :
505 : : static void
506 : 0 : cn20k_sso_port_quiesce(struct rte_eventdev *event_dev, void *port,
507 : : rte_eventdev_port_flush_t flush_cb, void *args)
508 : : {
509 : 0 : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
510 : : struct cn20k_sso_hws *ws = port;
511 : : struct rte_event ev;
512 : : uint64_t ptag;
513 : : bool is_pend;
514 : :
515 : : is_pend = false;
516 : : /* Work in WQE0 is always consumed, unless its a SWTAG. */
517 [ # # ]: 0 : ptag = plt_read64(ws->base + SSOW_LF_GWS_PENDSTATE);
518 [ # # # # ]: 0 : if (ptag & (BIT_ULL(62) | BIT_ULL(54)) || ws->swtag_req)
519 : : is_pend = true;
520 : : do {
521 : : ptag = plt_read64(ws->base + SSOW_LF_GWS_PENDSTATE);
522 [ # # ]: 0 : } while (ptag & (BIT_ULL(62) | BIT_ULL(58) | BIT_ULL(56) | BIT_ULL(54)));
523 : :
524 : 0 : cn20k_sso_hws_get_work_empty(ws, &ev, dev->rx_offloads);
525 [ # # # # ]: 0 : if (is_pend && ev.u64)
526 [ # # ]: 0 : if (flush_cb)
527 : 0 : flush_cb(event_dev->data->dev_id, ev, args);
528 [ # # ]: 0 : ptag = (plt_read64(ws->base + SSOW_LF_GWS_TAG) >> 32) & SSO_TT_EMPTY;
529 [ # # ]: 0 : if (ptag != SSO_TT_EMPTY)
530 : : cnxk_sso_hws_swtag_flush(ws->base);
531 : :
532 : : do {
533 [ # # ]: 0 : ptag = plt_read64(ws->base + SSOW_LF_GWS_PENDSTATE);
534 [ # # ]: 0 : } while (ptag & BIT_ULL(56));
535 : :
536 : : /* Check if we have work in PRF_WQE0, if so extract it. */
537 [ # # ]: 0 : switch (dev->gw_mode) {
538 : : case CNXK_GW_MODE_PREF:
539 : : case CNXK_GW_MODE_PREF_WFE:
540 [ # # ]: 0 : while (plt_read64(ws->base + SSOW_LF_GWS_PRF_WQE0) & BIT_ULL(63))
541 : : ;
542 : : break;
543 : : case CNXK_GW_MODE_NONE:
544 : : default:
545 : : break;
546 : : }
547 : :
548 [ # # ]: 0 : if (CNXK_TT_FROM_TAG(plt_read64(ws->base + SSOW_LF_GWS_PRF_WQE0)) != SSO_TT_EMPTY) {
549 : 0 : plt_write64(BIT_ULL(16) | 1, ws->base + SSOW_LF_GWS_OP_GET_WORK0);
550 : 0 : cn20k_sso_hws_get_work_empty(ws, &ev, dev->rx_offloads);
551 [ # # ]: 0 : if (ev.u64) {
552 [ # # ]: 0 : if (flush_cb)
553 : 0 : flush_cb(event_dev->data->dev_id, ev, args);
554 : : }
555 : 0 : cnxk_sso_hws_swtag_flush(ws->base);
556 : : do {
557 [ # # ]: 0 : ptag = plt_read64(ws->base + SSOW_LF_GWS_PENDSTATE);
558 [ # # ]: 0 : } while (ptag & BIT_ULL(56));
559 : : }
560 : 0 : ws->swtag_req = 0;
561 : 0 : plt_write64(0, ws->base + SSOW_LF_GWS_OP_GWC_INVAL);
562 : 0 : }
563 : :
564 : : static int
565 : 0 : cn20k_sso_port_link_profile(struct rte_eventdev *event_dev, void *port, const uint8_t queues[],
566 : : const uint8_t priorities[], uint16_t nb_links, uint8_t profile)
567 : 0 : {
568 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
569 : 0 : uint16_t hwgrp_ids[nb_links];
570 : : uint16_t link;
571 : :
572 : : RTE_SET_USED(priorities);
573 [ # # ]: 0 : for (link = 0; link < nb_links; link++)
574 : 0 : hwgrp_ids[link] = queues[link];
575 : 0 : nb_links = cn20k_sso_hws_link(dev, port, hwgrp_ids, nb_links, profile);
576 : :
577 : 0 : return (int)nb_links;
578 : : }
579 : :
580 : : static int
581 : 0 : cn20k_sso_port_unlink_profile(struct rte_eventdev *event_dev, void *port, uint8_t queues[],
582 : : uint16_t nb_unlinks, uint8_t profile)
583 : 0 : {
584 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
585 : 0 : uint16_t hwgrp_ids[nb_unlinks];
586 : : uint16_t unlink;
587 : :
588 [ # # ]: 0 : for (unlink = 0; unlink < nb_unlinks; unlink++)
589 : 0 : hwgrp_ids[unlink] = queues[unlink];
590 : 0 : nb_unlinks = cn20k_sso_hws_unlink(dev, port, hwgrp_ids, nb_unlinks, profile);
591 : :
592 : 0 : return (int)nb_unlinks;
593 : : }
594 : :
595 : : static int
596 : 0 : cn20k_sso_port_link(struct rte_eventdev *event_dev, void *port, const uint8_t queues[],
597 : : const uint8_t priorities[], uint16_t nb_links)
598 : : {
599 : 0 : return cn20k_sso_port_link_profile(event_dev, port, queues, priorities, nb_links, 0);
600 : : }
601 : :
602 : : static int
603 : 0 : cn20k_sso_port_unlink(struct rte_eventdev *event_dev, void *port, uint8_t queues[],
604 : : uint16_t nb_unlinks)
605 : : {
606 : 0 : return cn20k_sso_port_unlink_profile(event_dev, port, queues, nb_unlinks, 0);
607 : : }
608 : :
609 : : static int
610 : 0 : cn20k_sso_start(struct rte_eventdev *event_dev)
611 : : {
612 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
613 : : uint8_t hws[RTE_EVENT_MAX_PORTS_PER_DEV];
614 : : int rc, i;
615 : :
616 : 0 : cnxk_sso_configure_queue_stash(event_dev);
617 : 0 : rc = cnxk_sso_start(event_dev, cnxk_sso_hws_reset, cn20k_sso_hws_flush_events);
618 [ # # ]: 0 : if (rc < 0)
619 : : return rc;
620 : : cn20k_sso_fp_fns_set(event_dev);
621 [ # # ]: 0 : for (i = 0; i < event_dev->data->nb_ports; i++)
622 : 0 : hws[i] = i;
623 : 0 : roc_sso_hws_gwc_invalidate(&dev->sso, hws, event_dev->data->nb_ports);
624 : :
625 : 0 : return rc;
626 : : }
627 : :
628 : : static void
629 : 0 : cn20k_sso_stop(struct rte_eventdev *event_dev)
630 : : {
631 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
632 : : uint8_t hws[RTE_EVENT_MAX_PORTS_PER_DEV];
633 : : int i;
634 : :
635 [ # # ]: 0 : for (i = 0; i < event_dev->data->nb_ports; i++)
636 : 0 : hws[i] = i;
637 : 0 : roc_sso_hws_gwc_invalidate(&dev->sso, hws, event_dev->data->nb_ports);
638 : 0 : cnxk_sso_stop(event_dev, cnxk_sso_hws_reset, cn20k_sso_hws_flush_events);
639 : 0 : }
640 : :
641 : : static int
642 : 0 : cn20k_sso_close(struct rte_eventdev *event_dev)
643 : : {
644 : 0 : return cnxk_sso_close(event_dev, cn20k_sso_hws_unlink);
645 : : }
646 : :
647 : : static int
648 : 0 : cn20k_sso_selftest(void)
649 : : {
650 : 0 : return cnxk_sso_selftest(RTE_STR(event_cn20k));
651 : : }
652 : :
653 : : static int
654 : 0 : cn20k_sso_rx_adapter_caps_get(const struct rte_eventdev *event_dev,
655 : : const struct rte_eth_dev *eth_dev, uint32_t *caps)
656 : : {
657 : : int rc;
658 : :
659 : : RTE_SET_USED(event_dev);
660 : 0 : rc = strncmp(eth_dev->device->driver->name, "net_cn20k", 9);
661 [ # # ]: 0 : if (rc)
662 : 0 : *caps = RTE_EVENT_ETH_RX_ADAPTER_SW_CAP;
663 : : else
664 : 0 : *caps = RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT |
665 : : RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ |
666 : : RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID |
667 : : RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR;
668 : :
669 : 0 : return 0;
670 : : }
671 : :
672 : : static void
673 : 0 : cn20k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem)
674 : : {
675 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
676 : : int i;
677 : :
678 [ # # # # : 0 : for (i = 0; i < dev->nb_event_ports; i++) {
# # # # ]
679 : 0 : struct cn20k_sso_hws *ws = event_dev->data->ports[i];
680 : 0 : ws->xaq_lmt = dev->xaq_lmt;
681 : 0 : ws->fc_mem = (int64_t __rte_atomic *)dev->fc_iova;
682 : 0 : ws->tstamp = dev->tstamp;
683 [ # # # # : 0 : if (lookup_mem)
# # ]
684 : 0 : ws->lookup_mem = lookup_mem;
685 : : }
686 : 0 : }
687 : :
688 : : static void
689 : : eventdev_fops_tstamp_update(struct rte_eventdev *event_dev)
690 : : {
691 : 0 : struct rte_event_fp_ops *fp_op = rte_event_fp_ops + event_dev->data->dev_id;
692 : :
693 : 0 : fp_op->dequeue_burst = event_dev->dequeue_burst;
694 : : }
695 : :
696 : : static void
697 : 0 : cn20k_sso_tstamp_hdl_update(uint16_t port_id, uint16_t flags, bool ptp_en)
698 : : {
699 : 0 : struct rte_eth_dev *dev = &rte_eth_devices[port_id];
700 : 0 : struct cnxk_eth_dev *cnxk_eth_dev = dev->data->dev_private;
701 [ # # ]: 0 : struct rte_eventdev *event_dev = cnxk_eth_dev->evdev_priv;
702 : : struct cnxk_sso_evdev *evdev = cnxk_sso_pmd_priv(event_dev);
703 : :
704 : 0 : evdev->rx_offloads |= flags;
705 [ # # ]: 0 : if (ptp_en)
706 : 0 : evdev->tstamp[port_id] = &cnxk_eth_dev->tstamp;
707 : : else
708 : 0 : evdev->tstamp[port_id] = NULL;
709 : : cn20k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev);
710 : : eventdev_fops_tstamp_update(event_dev);
711 : 0 : }
712 : :
713 : : static int
714 : 0 : cn20k_sso_rxq_enable(struct cnxk_eth_dev *cnxk_eth_dev, uint16_t rq_id, uint16_t port_id,
715 : : const struct rte_event_eth_rx_adapter_queue_conf *queue_conf, int agq)
716 : : {
717 : : struct roc_nix_rq *rq;
718 : : uint32_t tag_mask;
719 : : uint16_t wqe_skip;
720 : : uint8_t tt;
721 : : int rc;
722 : :
723 : 0 : rq = &cnxk_eth_dev->rqs[rq_id];
724 [ # # ]: 0 : if (queue_conf->rx_queue_flags & RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR) {
725 : 0 : tag_mask = agq;
726 : : tt = SSO_TT_AGG;
727 : 0 : rq->flow_tag_width = 0;
728 : : } else {
729 : 0 : tag_mask = (port_id & 0xFF) << 20;
730 : : tag_mask |= (RTE_EVENT_TYPE_ETHDEV << 28);
731 : 0 : tt = queue_conf->ev.sched_type;
732 : 0 : rq->flow_tag_width = 20;
733 [ # # ]: 0 : if (queue_conf->rx_queue_flags & RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID) {
734 : 0 : rq->flow_tag_width = 0;
735 : 0 : tag_mask |= queue_conf->ev.flow_id;
736 : : }
737 : : }
738 : :
739 : 0 : rq->tag_mask = tag_mask;
740 : 0 : rq->sso_ena = 1;
741 : 0 : rq->tt = tt;
742 : 0 : rq->hwgrp = queue_conf->ev.queue_id;
743 : : wqe_skip = RTE_ALIGN_CEIL(sizeof(struct rte_mbuf), ROC_CACHE_LINE_SZ);
744 : : wqe_skip = wqe_skip / ROC_CACHE_LINE_SZ;
745 : 0 : rq->wqe_skip = wqe_skip;
746 : :
747 : 0 : rc = roc_nix_rq_modify(&cnxk_eth_dev->nix, rq, 0);
748 : 0 : return rc;
749 : : }
750 : :
751 : : static int
752 : 0 : cn20k_sso_rx_adapter_vwqe_enable(struct cnxk_sso_evdev *dev, uint16_t port_id, uint16_t rq_id,
753 : : const struct rte_event_eth_rx_adapter_queue_conf *queue_conf)
754 : : {
755 : : uint32_t agq, tag_mask, stag_mask;
756 : : struct roc_sso_agq_data data;
757 : : int rc;
758 : :
759 : 0 : tag_mask = (port_id & 0xff) << 20;
760 [ # # ]: 0 : if (queue_conf->rx_queue_flags & RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID)
761 : 0 : tag_mask |= queue_conf->ev.flow_id;
762 : : else
763 : 0 : tag_mask |= rq_id;
764 : :
765 : : stag_mask = tag_mask;
766 [ # # ]: 0 : tag_mask |= RTE_EVENT_TYPE_ETHDEV_VECTOR << 28;
767 : : stag_mask |= RTE_EVENT_TYPE_ETHDEV << 28;
768 : :
769 : : memset(&data, 0, sizeof(struct roc_sso_agq_data));
770 : 0 : data.tag = tag_mask;
771 : 0 : data.tt = queue_conf->ev.sched_type;
772 : 0 : data.stag = stag_mask;
773 [ # # ]: 0 : data.vwqe_aura = roc_npa_aura_handle_to_aura(queue_conf->vector_mp->pool_id);
774 [ # # ]: 0 : data.vwqe_max_sz_exp = rte_log2_u32(queue_conf->vector_sz);
775 : 0 : data.vwqe_wait_tmo = queue_conf->vector_timeout_ns / ((SSO_AGGR_DEF_TMO + 1) * 100);
776 : : data.xqe_type = 0;
777 : :
778 : 0 : agq = UINT32_MAX;
779 : 0 : rc = roc_sso_hwgrp_agq_alloc(&dev->sso, queue_conf->ev.queue_id, &data, &agq);
780 [ # # ]: 0 : if (rc < 0)
781 : : return rc;
782 : :
783 : 0 : return agq;
784 : : }
785 : :
786 : : static int
787 : 0 : cn20k_rx_adapter_queue_del(const struct rte_eventdev *event_dev, const struct rte_eth_dev *eth_dev,
788 : : int32_t rx_queue_id)
789 : : {
790 [ # # ]: 0 : struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private;
791 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
792 : : struct roc_nix_rq *rxq;
793 : : int i, rc = 0;
794 : :
795 : : RTE_SET_USED(event_dev);
796 [ # # ]: 0 : if (rx_queue_id < 0) {
797 [ # # ]: 0 : for (i = 0; i < eth_dev->data->nb_rx_queues; i++)
798 : 0 : cn20k_rx_adapter_queue_del(event_dev, eth_dev, i);
799 : : } else {
800 : 0 : rxq = &cnxk_eth_dev->rqs[rx_queue_id];
801 [ # # ]: 0 : if (rxq->tt == SSO_TT_AGG)
802 : 0 : roc_sso_hwgrp_agq_free(&dev->sso, rxq->hwgrp, rxq->tag_mask);
803 : 0 : rc = cnxk_sso_rxq_disable(eth_dev, (uint16_t)rx_queue_id);
804 : 0 : cnxk_eth_dev->nb_rxq_sso--;
805 : : }
806 : :
807 [ # # ]: 0 : if (rc < 0)
808 : 0 : plt_err("Failed to clear Rx adapter config port=%d, q=%d", eth_dev->data->port_id,
809 : : rx_queue_id);
810 : 0 : return rc;
811 : : }
812 : :
813 : : static int
814 : 0 : cn20k_rx_adapter_queues_add(const struct rte_eventdev *event_dev, const struct rte_eth_dev *eth_dev,
815 : : int32_t rx_queue_id[],
816 : : const struct rte_event_eth_rx_adapter_queue_conf queue_conf[],
817 : : uint16_t nb_rx_queues)
818 : : {
819 [ # # ]: 0 : struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private;
820 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
821 : : const struct rte_event_eth_rx_adapter_queue_conf *conf;
822 : 0 : uint64_t old_xae_cnt = dev->adptr_xae_cnt;
823 : 0 : uint16_t port = eth_dev->data->port_id;
824 : : struct cnxk_eth_rxq_sp *rxq_sp;
825 : : uint16_t max_rx_queues;
826 : : int i, rc = 0, agq = 0;
827 : : int32_t queue_id;
828 : :
829 [ # # ]: 0 : max_rx_queues = nb_rx_queues ? nb_rx_queues : eth_dev->data->nb_rx_queues;
830 [ # # ]: 0 : for (i = 0; i < max_rx_queues; i++) {
831 [ # # ]: 0 : conf = nb_rx_queues ? &queue_conf[i] : &queue_conf[0];
832 [ # # ]: 0 : queue_id = nb_rx_queues ? rx_queue_id[i] : i;
833 : 0 : rxq_sp = cnxk_eth_rxq_to_sp(eth_dev->data->rx_queues[queue_id]);
834 : 0 : cnxk_sso_updt_xae_cnt(dev, rxq_sp, RTE_EVENT_TYPE_ETHDEV);
835 : :
836 [ # # ]: 0 : if (conf->rx_queue_flags & RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR)
837 : 0 : cnxk_sso_updt_xae_cnt(dev, conf->vector_mp, RTE_EVENT_TYPE_ETHDEV_VECTOR);
838 : : }
839 : :
840 [ # # ]: 0 : if (dev->adptr_xae_cnt != old_xae_cnt) {
841 : 0 : rc = cnxk_sso_xae_reconfigure((struct rte_eventdev *)(uintptr_t)event_dev);
842 [ # # ]: 0 : if (rc < 0)
843 : : return rc;
844 : : }
845 : :
846 [ # # ]: 0 : for (i = 0; i < max_rx_queues; i++) {
847 [ # # ]: 0 : conf = nb_rx_queues ? &queue_conf[i] : &queue_conf[0];
848 [ # # ]: 0 : queue_id = nb_rx_queues ? rx_queue_id[i] : i;
849 [ # # ]: 0 : if (conf->rx_queue_flags & RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR) {
850 : 0 : rc = cn20k_sso_rx_adapter_vwqe_enable(dev, port, queue_id, conf);
851 [ # # ]: 0 : if (rc < 0) {
852 : 0 : plt_err("Failed to enable VWQE, port=%d, rxq=%d", port, queue_id);
853 : 0 : goto fail;
854 : : }
855 : :
856 : : agq = rc;
857 : : }
858 : :
859 : 0 : rc = cn20k_sso_rxq_enable(cnxk_eth_dev, (uint16_t)queue_id, port, conf, agq);
860 [ # # ]: 0 : if (rc < 0) {
861 : 0 : plt_err("Failed to enable Rx queue, port=%d, rxq=%d", port, queue_id);
862 : 0 : goto fail;
863 : : }
864 : :
865 : 0 : cnxk_eth_dev->nb_rxq_sso++;
866 : : }
867 : :
868 : : /* Propagate force bp devarg */
869 : 0 : cnxk_eth_dev->nix.force_rx_aura_bp = dev->force_ena_bp;
870 : 0 : cnxk_sso_tstamp_cfg(port, eth_dev, dev);
871 : 0 : dev->rx_offloads |= cnxk_eth_dev->rx_offload_flags;
872 : 0 : return 0;
873 : :
874 : 0 : fail:
875 [ # # ]: 0 : for (i = cnxk_eth_dev->nb_rxq_sso - 1; i >= 0; i--) {
876 [ # # ]: 0 : queue_id = nb_rx_queues ? rx_queue_id[i] : i;
877 : 0 : cn20k_rx_adapter_queue_del(event_dev, eth_dev, queue_id);
878 : : }
879 : :
880 : : return rc;
881 : : }
882 : :
883 : : static int
884 : 0 : cn20k_sso_configure_queue_stash_default(struct cnxk_sso_evdev *dev, uint16_t hwgrp)
885 : : {
886 : : struct roc_sso_hwgrp_stash stash;
887 : : int rc;
888 : :
889 : 0 : stash.hwgrp = hwgrp;
890 : 0 : stash.stash_offset = CN20K_SSO_DEFAULT_STASH_OFFSET;
891 : 0 : stash.stash_count = CN20K_SSO_DEFAULT_STASH_LENGTH;
892 : 0 : rc = roc_sso_hwgrp_stash_config(&dev->sso, &stash, 1);
893 [ # # ]: 0 : if (rc < 0)
894 : 0 : plt_warn("failed to configure HWGRP WQE stashing rc = %d", rc);
895 : :
896 : 0 : return rc;
897 : : }
898 : :
899 : : static int
900 : 0 : cn20k_sso_rx_adapter_queue_add(const struct rte_eventdev *event_dev,
901 : : const struct rte_eth_dev *eth_dev, int32_t rx_queue_id,
902 : : const struct rte_event_eth_rx_adapter_queue_conf *queue_conf)
903 : : {
904 [ # # ]: 0 : struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private;
905 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
906 : : struct cn20k_eth_rxq *rxq;
907 : : uint16_t nb_rx_queues;
908 : : void *lookup_mem;
909 : : int rc;
910 : :
911 : 0 : rc = strncmp(eth_dev->device->driver->name, "net_cn20k", 8);
912 [ # # ]: 0 : if (rc)
913 : : return -EINVAL;
914 : :
915 : 0 : nb_rx_queues = rx_queue_id == -1 ? 0 : 1;
916 : 0 : rc = cn20k_rx_adapter_queues_add(event_dev, eth_dev, &rx_queue_id, queue_conf,
917 : : nb_rx_queues);
918 [ # # ]: 0 : if (rc)
919 : : return -EINVAL;
920 : :
921 : 0 : cnxk_eth_dev->cnxk_sso_ptp_tstamp_cb = cn20k_sso_tstamp_hdl_update;
922 : 0 : cnxk_eth_dev->evdev_priv = (struct rte_eventdev *)(uintptr_t)event_dev;
923 : :
924 : 0 : rxq = eth_dev->data->rx_queues[0];
925 : 0 : lookup_mem = rxq->lookup_mem;
926 : : cn20k_sso_set_priv_mem(event_dev, lookup_mem);
927 : : cn20k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev);
928 [ # # # # ]: 0 : if (roc_feature_sso_has_stash() && dev->nb_event_ports > 1)
929 : 0 : rc = cn20k_sso_configure_queue_stash_default(dev, queue_conf->ev.queue_id);
930 : :
931 : : return rc;
932 : : }
933 : :
934 : : static int
935 : 0 : cn20k_sso_rx_adapter_queues_add(const struct rte_eventdev *event_dev,
936 : : const struct rte_eth_dev *eth_dev, int32_t rx_queue_id[],
937 : : const struct rte_event_eth_rx_adapter_queue_conf queue_conf[],
938 : : uint16_t nb_rx_queues)
939 : : {
940 [ # # ]: 0 : struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private;
941 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
942 : : struct cn20k_eth_rxq *rxq;
943 : : void *lookup_mem;
944 : : int rc, i;
945 : :
946 : 0 : rc = strncmp(eth_dev->device->driver->name, "net_cn20k", 8);
947 [ # # ]: 0 : if (rc)
948 : : return -EINVAL;
949 : :
950 : 0 : rc = cn20k_rx_adapter_queues_add(event_dev, eth_dev, rx_queue_id, queue_conf, nb_rx_queues);
951 [ # # ]: 0 : if (rc)
952 : : return -EINVAL;
953 : :
954 : 0 : cnxk_eth_dev->cnxk_sso_ptp_tstamp_cb = cn20k_sso_tstamp_hdl_update;
955 : 0 : cnxk_eth_dev->evdev_priv = (struct rte_eventdev *)(uintptr_t)event_dev;
956 : :
957 : 0 : rxq = eth_dev->data->rx_queues[0];
958 : 0 : lookup_mem = rxq->lookup_mem;
959 : : cn20k_sso_set_priv_mem(event_dev, lookup_mem);
960 : : cn20k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev);
961 [ # # # # ]: 0 : if (roc_feature_sso_has_stash() && dev->nb_event_ports > 1) {
962 : 0 : uint16_t hwgrp = dev->sso.max_hwgrp;
963 : :
964 [ # # ]: 0 : if (nb_rx_queues == 0)
965 : 0 : rc = cn20k_sso_configure_queue_stash_default(dev,
966 : 0 : queue_conf[0].ev.queue_id);
967 : :
968 [ # # ]: 0 : for (i = 0; i < nb_rx_queues; i++) {
969 [ # # ]: 0 : if (hwgrp == queue_conf[i].ev.queue_id)
970 : 0 : continue;
971 : :
972 : : hwgrp = queue_conf[i].ev.queue_id;
973 : 0 : rc = cn20k_sso_configure_queue_stash_default(dev, hwgrp);
974 [ # # ]: 0 : if (rc < 0)
975 : : break;
976 : : }
977 : : }
978 : :
979 : : return rc;
980 : : }
981 : :
982 : : static int
983 : 0 : cn20k_sso_rx_adapter_queue_del(const struct rte_eventdev *event_dev,
984 : : const struct rte_eth_dev *eth_dev, int32_t rx_queue_id)
985 : : {
986 : : int rc;
987 : :
988 : 0 : rc = strncmp(eth_dev->device->driver->name, "net_cn20k", 8);
989 [ # # ]: 0 : if (rc)
990 : : return -EINVAL;
991 : :
992 : 0 : return cn20k_rx_adapter_queue_del(event_dev, eth_dev, rx_queue_id);
993 : : }
994 : :
995 : : static int
996 : 0 : cn20k_sso_rx_adapter_vector_limits(const struct rte_eventdev *dev,
997 : : const struct rte_eth_dev *eth_dev,
998 : : struct rte_event_eth_rx_adapter_vector_limits *limits)
999 : : {
1000 : : int ret;
1001 : :
1002 : : RTE_SET_USED(dev);
1003 : : RTE_SET_USED(eth_dev);
1004 : 0 : ret = strncmp(eth_dev->device->driver->name, "net_cn20k", 8);
1005 [ # # ]: 0 : if (ret)
1006 : : return -ENOTSUP;
1007 : :
1008 : 0 : limits->log2_sz = true;
1009 : 0 : limits->min_sz = 1 << ROC_NIX_VWQE_MIN_SIZE_LOG2;
1010 : 0 : limits->max_sz = 1 << ROC_NIX_VWQE_MAX_SIZE_LOG2;
1011 : 0 : limits->min_timeout_ns = (SSO_AGGR_DEF_TMO + 1) * 100;
1012 : 0 : limits->max_timeout_ns = (BITMASK_ULL(11, 0) + 1) * limits->min_timeout_ns;
1013 : :
1014 : 0 : return 0;
1015 : : }
1016 : :
1017 : : static int
1018 : 0 : cn20k_sso_tx_adapter_caps_get(const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev,
1019 : : uint32_t *caps)
1020 : : {
1021 : : int ret;
1022 : :
1023 : : RTE_SET_USED(dev);
1024 : 0 : ret = strncmp(eth_dev->device->driver->name, "net_cn20k", 8);
1025 [ # # ]: 0 : if (ret)
1026 : 0 : *caps = 0;
1027 : : else
1028 : 0 : *caps = RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT |
1029 : : RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR;
1030 : :
1031 : 0 : return 0;
1032 : : }
1033 : :
1034 : : static void
1035 : 0 : cn20k_sso_txq_fc_update(const struct rte_eth_dev *eth_dev, int32_t tx_queue_id)
1036 : : {
1037 : 0 : struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private;
1038 : : struct cn20k_eth_txq *txq;
1039 : : struct roc_nix_sq *sq;
1040 : : int i;
1041 : :
1042 [ # # ]: 0 : if (tx_queue_id < 0) {
1043 [ # # ]: 0 : for (i = 0; i < eth_dev->data->nb_tx_queues; i++)
1044 : 0 : cn20k_sso_txq_fc_update(eth_dev, i);
1045 : : } else {
1046 : : uint16_t sqes_per_sqb;
1047 : :
1048 : 0 : sq = &cnxk_eth_dev->sqs[tx_queue_id];
1049 : 0 : txq = eth_dev->data->tx_queues[tx_queue_id];
1050 : 0 : sqes_per_sqb = 1U << txq->sqes_per_sqb_log2;
1051 [ # # ]: 0 : if (cnxk_eth_dev->tx_offloads & RTE_ETH_TX_OFFLOAD_SECURITY)
1052 : 0 : sq->nb_sqb_bufs_adj -= (cnxk_eth_dev->outb.nb_desc / sqes_per_sqb);
1053 : 0 : txq->nb_sqb_bufs_adj = sq->nb_sqb_bufs_adj;
1054 : : }
1055 : 0 : }
1056 : :
1057 : : static int
1058 : 0 : cn20k_sso_tx_adapter_queue_add(uint8_t id, const struct rte_eventdev *event_dev,
1059 : : const struct rte_eth_dev *eth_dev, int32_t tx_queue_id)
1060 : : {
1061 : 0 : struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private;
1062 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
1063 : : uint64_t tx_offloads;
1064 : : int rc;
1065 : :
1066 : : RTE_SET_USED(id);
1067 : 0 : rc = cnxk_sso_tx_adapter_queue_add(event_dev, eth_dev, tx_queue_id);
1068 [ # # ]: 0 : if (rc < 0)
1069 : : return rc;
1070 : :
1071 : : /* Can't enable tstamp if all the ports don't have it enabled. */
1072 : 0 : tx_offloads = cnxk_eth_dev->tx_offload_flags;
1073 [ # # ]: 0 : if (dev->tx_adptr_configured) {
1074 : 0 : uint8_t tstmp_req = !!(tx_offloads & NIX_TX_OFFLOAD_TSTAMP_F);
1075 : 0 : uint8_t tstmp_ena = !!(dev->tx_offloads & NIX_TX_OFFLOAD_TSTAMP_F);
1076 : :
1077 [ # # ]: 0 : if (tstmp_ena && !tstmp_req)
1078 : 0 : dev->tx_offloads &= ~(NIX_TX_OFFLOAD_TSTAMP_F);
1079 [ # # ]: 0 : else if (!tstmp_ena && tstmp_req)
1080 : 0 : tx_offloads &= ~(NIX_TX_OFFLOAD_TSTAMP_F);
1081 : : }
1082 : :
1083 : 0 : dev->tx_offloads |= tx_offloads;
1084 : 0 : cn20k_sso_txq_fc_update(eth_dev, tx_queue_id);
1085 : 0 : rc = cn20k_sso_updt_tx_adptr_data(event_dev);
1086 [ # # ]: 0 : if (rc < 0)
1087 : : return rc;
1088 : : cn20k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev);
1089 : 0 : dev->tx_adptr_configured = 1;
1090 : :
1091 : 0 : return 0;
1092 : : }
1093 : :
1094 : : static int
1095 : 0 : cn20k_sso_tx_adapter_queue_del(uint8_t id, const struct rte_eventdev *event_dev,
1096 : : const struct rte_eth_dev *eth_dev, int32_t tx_queue_id)
1097 : : {
1098 : : int rc;
1099 : :
1100 : : RTE_SET_USED(id);
1101 : 0 : rc = cnxk_sso_tx_adapter_queue_del(event_dev, eth_dev, tx_queue_id);
1102 [ # # ]: 0 : if (rc < 0)
1103 : : return rc;
1104 : 0 : return cn20k_sso_updt_tx_adptr_data(event_dev);
1105 : : }
1106 : :
1107 : : static int
1108 : 0 : cn20k_crypto_adapter_caps_get(const struct rte_eventdev *event_dev,
1109 : : const struct rte_cryptodev *cdev, uint32_t *caps)
1110 : : {
1111 [ # # ]: 0 : CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn20k", ENOTSUP);
1112 [ # # ]: 0 : CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn20k", ENOTSUP);
1113 : :
1114 : 0 : *caps = RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD |
1115 : : RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA |
1116 : : RTE_EVENT_CRYPTO_ADAPTER_CAP_EVENT_VECTOR;
1117 : :
1118 : 0 : return 0;
1119 : : }
1120 : :
1121 : : static int
1122 : 0 : cn20k_crypto_adapter_qp_add(const struct rte_eventdev *event_dev, const struct rte_cryptodev *cdev,
1123 : : int32_t queue_pair_id,
1124 : : const struct rte_event_crypto_adapter_queue_conf *conf)
1125 : : {
1126 : : int ret;
1127 : :
1128 [ # # ]: 0 : CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn20k", EINVAL);
1129 [ # # ]: 0 : CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn20k", EINVAL);
1130 : :
1131 : : cn20k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev);
1132 : :
1133 : 0 : ret = cnxk_crypto_adapter_qp_add(event_dev, cdev, queue_pair_id, conf);
1134 : : cn20k_sso_set_priv_mem(event_dev, NULL);
1135 : :
1136 : : return ret;
1137 : : }
1138 : :
1139 : : static int
1140 : 0 : cn20k_crypto_adapter_qp_del(const struct rte_eventdev *event_dev, const struct rte_cryptodev *cdev,
1141 : : int32_t queue_pair_id)
1142 : : {
1143 [ # # ]: 0 : CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn20k", EINVAL);
1144 [ # # ]: 0 : CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn20k", EINVAL);
1145 : :
1146 : 0 : return cnxk_crypto_adapter_qp_del(cdev, queue_pair_id);
1147 : : }
1148 : :
1149 : : static int
1150 : 0 : cn20k_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags, uint32_t *caps,
1151 : : const struct event_timer_adapter_ops **ops)
1152 : : {
1153 : 0 : return cnxk_tim_caps_get(evdev, flags, caps, ops, cn20k_sso_set_priv_mem);
1154 : : }
1155 : :
1156 : : static int
1157 : 0 : cn20k_crypto_adapter_vec_limits(const struct rte_eventdev *event_dev,
1158 : : const struct rte_cryptodev *cdev,
1159 : : struct rte_event_crypto_adapter_vector_limits *limits)
1160 : : {
1161 [ # # ]: 0 : CNXK_VALID_DEV_OR_ERR_RET(event_dev->dev, "event_cn20k", EINVAL);
1162 [ # # ]: 0 : CNXK_VALID_DEV_OR_ERR_RET(cdev->device, "crypto_cn20k", EINVAL);
1163 : :
1164 : 0 : limits->log2_sz = false;
1165 : 0 : limits->min_sz = 0;
1166 : 0 : limits->max_sz = UINT16_MAX;
1167 : : /* Unused timeout, in software implementation we aggregate all crypto
1168 : : * operations passed to the enqueue function
1169 : : */
1170 : 0 : limits->min_timeout_ns = 0;
1171 : 0 : limits->max_timeout_ns = 0;
1172 : :
1173 : 0 : return 0;
1174 : : }
1175 : :
1176 : : static struct eventdev_ops cn20k_sso_dev_ops = {
1177 : : .dev_infos_get = cn20k_sso_info_get,
1178 : : .dev_configure = cn20k_sso_dev_configure,
1179 : :
1180 : : .queue_def_conf = cnxk_sso_queue_def_conf,
1181 : : .queue_setup = cn20k_sso_queue_setup,
1182 : : .queue_release = cnxk_sso_queue_release,
1183 : : .queue_attr_set = cn20k_sso_queue_attribute_set,
1184 : :
1185 : : .port_def_conf = cnxk_sso_port_def_conf,
1186 : : .port_setup = cn20k_sso_port_setup,
1187 : : .port_release = cn20k_sso_port_release,
1188 : : .port_quiesce = cn20k_sso_port_quiesce,
1189 : : .port_link = cn20k_sso_port_link,
1190 : : .port_unlink = cn20k_sso_port_unlink,
1191 : : .port_link_profile = cn20k_sso_port_link_profile,
1192 : : .port_unlink_profile = cn20k_sso_port_unlink_profile,
1193 : : .timeout_ticks = cnxk_sso_timeout_ticks,
1194 : :
1195 : : .eth_rx_adapter_caps_get = cn20k_sso_rx_adapter_caps_get,
1196 : : .eth_rx_adapter_queue_add = cn20k_sso_rx_adapter_queue_add,
1197 : : .eth_rx_adapter_queues_add = cn20k_sso_rx_adapter_queues_add,
1198 : : .eth_rx_adapter_queue_del = cn20k_sso_rx_adapter_queue_del,
1199 : : .eth_rx_adapter_start = cnxk_sso_rx_adapter_start,
1200 : : .eth_rx_adapter_stop = cnxk_sso_rx_adapter_stop,
1201 : :
1202 : : .eth_rx_adapter_vector_limits_get = cn20k_sso_rx_adapter_vector_limits,
1203 : :
1204 : : .eth_tx_adapter_caps_get = cn20k_sso_tx_adapter_caps_get,
1205 : : .eth_tx_adapter_queue_add = cn20k_sso_tx_adapter_queue_add,
1206 : : .eth_tx_adapter_queue_del = cn20k_sso_tx_adapter_queue_del,
1207 : : .eth_tx_adapter_start = cnxk_sso_tx_adapter_start,
1208 : : .eth_tx_adapter_stop = cnxk_sso_tx_adapter_stop,
1209 : : .eth_tx_adapter_free = cnxk_sso_tx_adapter_free,
1210 : :
1211 : : .timer_adapter_caps_get = cn20k_tim_caps_get,
1212 : :
1213 : : .crypto_adapter_caps_get = cn20k_crypto_adapter_caps_get,
1214 : : .crypto_adapter_queue_pair_add = cn20k_crypto_adapter_qp_add,
1215 : : .crypto_adapter_queue_pair_del = cn20k_crypto_adapter_qp_del,
1216 : : .crypto_adapter_vector_limits_get = cn20k_crypto_adapter_vec_limits,
1217 : :
1218 : : .vector_adapter_caps_get = cnxk_vector_caps_get,
1219 : : .vector_adapter_info_get = cnxk_vector_info_get,
1220 : :
1221 : : .xstats_get = cnxk_sso_xstats_get,
1222 : : .xstats_reset = cnxk_sso_xstats_reset,
1223 : : .xstats_get_names = cnxk_sso_xstats_get_names,
1224 : :
1225 : : .dump = cnxk_sso_dump,
1226 : : .dev_start = cn20k_sso_start,
1227 : : .dev_stop = cn20k_sso_stop,
1228 : : .dev_close = cn20k_sso_close,
1229 : : .dev_selftest = cn20k_sso_selftest,
1230 : : };
1231 : :
1232 : : static int
1233 : 0 : cn20k_sso_init(struct rte_eventdev *event_dev)
1234 : : {
1235 : : struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev);
1236 : : int rc;
1237 : :
1238 : 0 : rc = roc_plt_init();
1239 [ # # ]: 0 : if (rc < 0) {
1240 : 0 : plt_err("Failed to initialize platform model");
1241 : 0 : return rc;
1242 : : }
1243 : :
1244 : 0 : event_dev->dev_ops = &cn20k_sso_dev_ops;
1245 : : /* For secondary processes, the primary has done all the work */
1246 [ # # ]: 0 : if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
1247 : : cn20k_sso_fp_fns_set(event_dev);
1248 : : return 0;
1249 : : }
1250 : :
1251 : 0 : rc = cnxk_sso_init(event_dev);
1252 [ # # ]: 0 : if (rc < 0)
1253 : : return rc;
1254 : :
1255 : : cn20k_sso_set_rsrc(cnxk_sso_pmd_priv(event_dev));
1256 [ # # # # ]: 0 : if (!dev->max_event_ports || !dev->max_event_queues) {
1257 : 0 : plt_err("Not enough eventdev resource queues=%d ports=%d", dev->max_event_queues,
1258 : : dev->max_event_ports);
1259 : 0 : cnxk_sso_fini(event_dev);
1260 : 0 : return -ENODEV;
1261 : : }
1262 : :
1263 : 0 : plt_sso_dbg("Initializing %s max_queues=%d max_ports=%d", event_dev->data->name,
1264 : : dev->max_event_queues, dev->max_event_ports);
1265 : :
1266 : 0 : return 0;
1267 : : }
1268 : :
1269 : : static int
1270 : 0 : cn20k_sso_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
1271 : : {
1272 : 0 : return rte_event_pmd_pci_probe(pci_drv, pci_dev, sizeof(struct cnxk_sso_evdev),
1273 : : cn20k_sso_init);
1274 : : }
1275 : :
1276 : : static const struct rte_pci_id cn20k_pci_sso_map[] = {
1277 : : CNXK_PCI_ID(PCI_SUBSYSTEM_DEVID_CN20KA, PCI_DEVID_CNXK_RVU_SSO_TIM_PF),
1278 : : CNXK_PCI_ID(PCI_SUBSYSTEM_DEVID_CN20KA, PCI_DEVID_CNXK_RVU_SSO_TIM_VF),
1279 : : {
1280 : : .vendor_id = 0,
1281 : : },
1282 : : };
1283 : :
1284 : : static struct rte_pci_driver cn20k_pci_sso = {
1285 : : .id_table = cn20k_pci_sso_map,
1286 : : .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_NEED_IOVA_AS_VA,
1287 : : .probe = cn20k_sso_probe,
1288 : : .remove = cnxk_sso_remove,
1289 : : };
1290 : :
1291 : 254 : RTE_PMD_REGISTER_PCI(event_cn20k, cn20k_pci_sso);
1292 : : RTE_PMD_REGISTER_PCI_TABLE(event_cn20k, cn20k_pci_sso_map);
1293 : : RTE_PMD_REGISTER_KMOD_DEP(event_cn20k, "vfio-pci");
1294 : : RTE_PMD_REGISTER_PARAM_STRING(event_cn20k,
1295 : : CNXK_SSO_XAE_CNT "=<int>"
1296 : : CNXK_SSO_GGRP_QOS "=<string>"
1297 : : CNXK_SSO_STASH "=<string>"
1298 : : CNXK_SSO_FORCE_BP "=1"
1299 : : CNXK_TIM_DISABLE_NPA "=1"
1300 : : CNXK_TIM_CHNK_SLOTS "=<int>"
1301 : : CNXK_TIM_RINGS_LMT "=<int>"
1302 : : CNXK_TIM_STATS_ENA "=1"
1303 : : CNXK_TIM_EXT_CLK "=<string>");
|