Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright(C) 2021 Marvell.
3 : : */
4 : :
5 : : #include "roc_api.h"
6 : : #include "roc_priv.h"
7 : :
8 : : static int
9 : : nix_fc_rxchan_bpid_get(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
10 : : {
11 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
12 : :
13 [ # # ]: 0 : if (nix->chan_cnt != 0)
14 : 0 : fc_cfg->rxchan_cfg.enable = true;
15 : : else
16 : 0 : fc_cfg->rxchan_cfg.enable = false;
17 : :
18 : 0 : fc_cfg->type = ROC_NIX_FC_RXCHAN_CFG;
19 : :
20 : : return 0;
21 : : }
22 : :
23 : : static int
24 : 0 : nix_fc_rxchan_bpid_set(struct roc_nix *roc_nix, bool enable)
25 : : {
26 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
27 : : struct dev *dev = &nix->dev;
28 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
29 : : struct nix_bp_cfg_req *req;
30 : : struct nix_bp_cfg_rsp *rsp;
31 : : int rc = -ENOSPC, i;
32 : :
33 [ # # ]: 0 : if (enable) {
34 : 0 : req = mbox_alloc_msg_nix_bp_enable(mbox);
35 [ # # ]: 0 : if (req == NULL)
36 : 0 : goto exit;
37 : :
38 : 0 : req->chan_base = 0;
39 [ # # # # ]: 0 : if (roc_nix_is_lbk(roc_nix) || roc_nix_is_sdp(roc_nix))
40 : 0 : req->chan_cnt = NIX_LBK_MAX_CHAN;
41 : : else
42 : 0 : req->chan_cnt = NIX_CGX_MAX_CHAN;
43 : :
44 : 0 : req->bpid_per_chan = true;
45 : :
46 : : rc = mbox_process_msg(mbox, (void *)&rsp);
47 [ # # # # ]: 0 : if (rc || (req->chan_cnt != rsp->chan_cnt)) {
48 : : rc = -EIO;
49 : 0 : goto exit;
50 : : }
51 : :
52 : 0 : nix->chan_cnt = rsp->chan_cnt;
53 [ # # ]: 0 : for (i = 0; i < rsp->chan_cnt; i++)
54 : 0 : nix->bpid[i] = rsp->chan_bpid[i] & 0x7FF;
55 : : } else {
56 : 0 : req = mbox_alloc_msg_nix_bp_disable(mbox);
57 [ # # ]: 0 : if (req == NULL)
58 : 0 : goto exit;
59 : 0 : req->chan_base = 0;
60 : 0 : req->chan_cnt = nix->chan_cnt;
61 : :
62 : 0 : rc = mbox_process(mbox);
63 [ # # ]: 0 : if (rc)
64 : 0 : goto exit;
65 : :
66 : 0 : memset(nix->bpid, 0, sizeof(uint16_t) * NIX_MAX_CHAN);
67 : 0 : nix->chan_cnt = 0;
68 : : }
69 : :
70 [ # # ]: 0 : if (roc_model_is_cn9k())
71 : 0 : goto exit;
72 : :
73 : : /* Enable backpressure on CPT if inline inb is enabled */
74 [ # # # # : 0 : if (enable && roc_nix_inl_inb_is_enabled(roc_nix) &&
# # ]
75 : : !roc_errata_cpt_hang_on_x2p_bp()) {
76 : 0 : req = mbox_alloc_msg_nix_cpt_bp_enable(mbox);
77 [ # # ]: 0 : if (req == NULL)
78 : 0 : goto exit;
79 : 0 : req->chan_base = 0;
80 [ # # # # ]: 0 : if (roc_nix_is_lbk(roc_nix) || roc_nix_is_sdp(roc_nix))
81 : 0 : req->chan_cnt = NIX_LBK_MAX_CHAN;
82 : : else
83 : 0 : req->chan_cnt = NIX_CGX_MAX_CHAN;
84 : 0 : req->bpid_per_chan = 0;
85 : :
86 : : rc = mbox_process_msg(mbox, (void *)&rsp);
87 [ # # ]: 0 : if (rc)
88 : 0 : goto exit;
89 : 0 : nix->cpt_lbpid = rsp->chan_bpid[0] & 0x7FF;
90 : : }
91 : :
92 : : /* CPT to NIX BP on all channels */
93 [ # # # # ]: 0 : if (!roc_feature_nix_has_rxchan_multi_bpid() || !nix->cpt_nixbpid ||
94 : 0 : !roc_nix_inl_inb_is_enabled(roc_nix))
95 : 0 : goto exit;
96 : :
97 : : mbox_put(mbox);
98 [ # # ]: 0 : for (i = 0; i < nix->rx_chan_cnt; i++) {
99 : 0 : rc = roc_nix_chan_bpid_set(roc_nix, i, nix->cpt_nixbpid, enable, false);
100 [ # # ]: 0 : if (rc)
101 : : break;
102 : : }
103 : : return rc;
104 : 0 : exit:
105 : : mbox_put(mbox);
106 : 0 : return rc;
107 : : }
108 : :
109 : : static int
110 : 0 : nix_fc_cq_config_get(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
111 : : {
112 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
113 : : struct dev *dev = &nix->dev;
114 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
115 : : struct nix_aq_enq_rsp *rsp;
116 : : int rc;
117 : :
118 [ # # ]: 0 : if (roc_model_is_cn9k()) {
119 : : struct nix_aq_enq_req *aq;
120 : :
121 : 0 : aq = mbox_alloc_msg_nix_aq_enq(mbox);
122 [ # # ]: 0 : if (!aq) {
123 : : rc = -ENOSPC;
124 : 0 : goto exit;
125 : : }
126 : :
127 : 0 : aq->qidx = fc_cfg->cq_cfg.rq;
128 : 0 : aq->ctype = NIX_AQ_CTYPE_CQ;
129 : 0 : aq->op = NIX_AQ_INSTOP_READ;
130 [ # # ]: 0 : } else if (roc_model_is_cn10k()) {
131 : : struct nix_cn10k_aq_enq_req *aq;
132 : :
133 : 0 : aq = mbox_alloc_msg_nix_cn10k_aq_enq(mbox);
134 [ # # ]: 0 : if (!aq) {
135 : : rc = -ENOSPC;
136 : 0 : goto exit;
137 : : }
138 : :
139 : 0 : aq->qidx = fc_cfg->cq_cfg.rq;
140 : 0 : aq->ctype = NIX_AQ_CTYPE_CQ;
141 : 0 : aq->op = NIX_AQ_INSTOP_READ;
142 : : } else {
143 : : struct nix_cn20k_aq_enq_req *aq;
144 : :
145 : 0 : aq = mbox_alloc_msg_nix_cn20k_aq_enq(mbox);
146 [ # # ]: 0 : if (!aq) {
147 : : rc = -ENOSPC;
148 : 0 : goto exit;
149 : : }
150 : :
151 : 0 : aq->qidx = fc_cfg->cq_cfg.rq;
152 : 0 : aq->ctype = NIX_AQ_CTYPE_CQ;
153 : 0 : aq->op = NIX_AQ_INSTOP_READ;
154 : : }
155 : :
156 : : rc = mbox_process_msg(mbox, (void *)&rsp);
157 [ # # ]: 0 : if (rc)
158 : 0 : goto exit;
159 : :
160 : 0 : fc_cfg->cq_cfg.cq_drop = rsp->cq.drop;
161 : 0 : fc_cfg->cq_cfg.cq_bp = rsp->cq.bp;
162 : 0 : fc_cfg->cq_cfg.enable = rsp->cq.bp_ena;
163 : 0 : fc_cfg->type = ROC_NIX_FC_CQ_CFG;
164 : :
165 : 0 : exit:
166 : : mbox_put(mbox);
167 : 0 : return rc;
168 : : }
169 : :
170 : : static int
171 : 0 : nix_fc_rq_config_get(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
172 : : {
173 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
174 : : struct npa_cn20k_aq_enq_req *npa_req_cn20k;
175 : : struct npa_cn20k_aq_enq_rsp *npa_rsp_cn20k;
176 : : struct dev *dev = &nix->dev;
177 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
178 : : struct nix_aq_enq_rsp *rsp;
179 : : struct npa_aq_enq_req *npa_req;
180 : : struct npa_aq_enq_rsp *npa_rsp;
181 : : int rc;
182 : :
183 [ # # ]: 0 : if (roc_model_is_cn9k()) {
184 : : struct nix_aq_enq_req *aq;
185 : :
186 : 0 : aq = mbox_alloc_msg_nix_aq_enq(mbox);
187 [ # # ]: 0 : if (!aq) {
188 : : rc = -ENOSPC;
189 : 0 : goto exit;
190 : : }
191 : :
192 : 0 : aq->qidx = fc_cfg->rq_cfg.rq;
193 : 0 : aq->ctype = NIX_AQ_CTYPE_RQ;
194 : 0 : aq->op = NIX_AQ_INSTOP_READ;
195 [ # # ]: 0 : } else if (roc_model_is_cn10k()) {
196 : : struct nix_cn10k_aq_enq_req *aq;
197 : :
198 : 0 : aq = mbox_alloc_msg_nix_cn10k_aq_enq(mbox);
199 [ # # ]: 0 : if (!aq) {
200 : : rc = -ENOSPC;
201 : 0 : goto exit;
202 : : }
203 : :
204 : 0 : aq->qidx = fc_cfg->rq_cfg.rq;
205 : 0 : aq->ctype = NIX_AQ_CTYPE_RQ;
206 : 0 : aq->op = NIX_AQ_INSTOP_READ;
207 : : } else {
208 : : struct nix_cn20k_aq_enq_req *aq;
209 : :
210 : 0 : aq = mbox_alloc_msg_nix_cn20k_aq_enq(mbox);
211 [ # # ]: 0 : if (!aq) {
212 : : rc = -ENOSPC;
213 : 0 : goto exit;
214 : : }
215 : :
216 : 0 : aq->qidx = fc_cfg->rq_cfg.rq;
217 : 0 : aq->ctype = NIX_AQ_CTYPE_RQ;
218 : 0 : aq->op = NIX_AQ_INSTOP_READ;
219 : : }
220 : :
221 : : rc = mbox_process_msg(mbox, (void *)&rsp);
222 [ # # ]: 0 : if (rc)
223 : 0 : goto exit;
224 : :
225 [ # # ]: 0 : if (roc_model_is_cn20k()) {
226 : 0 : npa_req_cn20k = mbox_alloc_msg_npa_cn20k_aq_enq(mbox);
227 [ # # ]: 0 : if (!npa_req_cn20k) {
228 : : rc = -ENOSPC;
229 : 0 : goto exit;
230 : : }
231 : :
232 : 0 : npa_req_cn20k->aura_id = rsp->rq.lpb_aura;
233 : 0 : npa_req_cn20k->ctype = NPA_AQ_CTYPE_AURA;
234 : 0 : npa_req_cn20k->op = NPA_AQ_INSTOP_READ;
235 : :
236 : : rc = mbox_process_msg(mbox, (void *)&npa_rsp_cn20k);
237 [ # # ]: 0 : if (rc)
238 : 0 : goto exit;
239 : :
240 : 0 : fc_cfg->cq_cfg.cq_drop = npa_rsp_cn20k->aura.bp;
241 : 0 : fc_cfg->cq_cfg.enable = npa_rsp_cn20k->aura.bp_ena;
242 : 0 : fc_cfg->type = ROC_NIX_FC_RQ_CFG;
243 : : } else {
244 : 0 : npa_req = mbox_alloc_msg_npa_aq_enq(mbox);
245 [ # # ]: 0 : if (!npa_req) {
246 : : rc = -ENOSPC;
247 : 0 : goto exit;
248 : : }
249 : :
250 : 0 : npa_req->aura_id = rsp->rq.lpb_aura;
251 : 0 : npa_req->ctype = NPA_AQ_CTYPE_AURA;
252 : 0 : npa_req->op = NPA_AQ_INSTOP_READ;
253 : :
254 : : rc = mbox_process_msg(mbox, (void *)&npa_rsp);
255 [ # # ]: 0 : if (rc)
256 : 0 : goto exit;
257 : :
258 : 0 : fc_cfg->cq_cfg.cq_drop = npa_rsp->aura.bp;
259 : 0 : fc_cfg->cq_cfg.enable = npa_rsp->aura.bp_ena;
260 : 0 : fc_cfg->type = ROC_NIX_FC_RQ_CFG;
261 : : }
262 : :
263 : 0 : exit:
264 : : mbox_put(mbox);
265 : 0 : return rc;
266 : : }
267 : :
268 : : static int
269 : 0 : nix_fc_cq_config_set(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
270 : : {
271 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
272 : : struct dev *dev = &nix->dev;
273 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
274 : : int rc;
275 : :
276 [ # # ]: 0 : if (roc_model_is_cn9k()) {
277 : : struct nix_aq_enq_req *aq;
278 : :
279 : 0 : aq = mbox_alloc_msg_nix_aq_enq(mbox);
280 [ # # ]: 0 : if (!aq) {
281 : : rc = -ENOSPC;
282 : 0 : goto exit;
283 : : }
284 : :
285 : 0 : aq->qidx = fc_cfg->cq_cfg.rq;
286 : 0 : aq->ctype = NIX_AQ_CTYPE_CQ;
287 : 0 : aq->op = NIX_AQ_INSTOP_WRITE;
288 : :
289 [ # # ]: 0 : if (fc_cfg->cq_cfg.enable) {
290 : 0 : aq->cq.bpid = nix->bpid[fc_cfg->cq_cfg.tc];
291 : 0 : aq->cq_mask.bpid = ~(aq->cq_mask.bpid);
292 : 0 : aq->cq.bp = fc_cfg->cq_cfg.cq_bp;
293 : 0 : aq->cq_mask.bp = ~(aq->cq_mask.bp);
294 : : }
295 : :
296 : 0 : aq->cq.bp_ena = !!(fc_cfg->cq_cfg.enable);
297 : 0 : aq->cq_mask.bp_ena = ~(aq->cq_mask.bp_ena);
298 [ # # ]: 0 : } else if (roc_model_is_cn10k()) {
299 : : struct nix_cn10k_aq_enq_req *aq;
300 : :
301 : 0 : aq = mbox_alloc_msg_nix_cn10k_aq_enq(mbox);
302 [ # # ]: 0 : if (!aq) {
303 : : rc = -ENOSPC;
304 : 0 : goto exit;
305 : : }
306 : :
307 : 0 : aq->qidx = fc_cfg->cq_cfg.rq;
308 : 0 : aq->ctype = NIX_AQ_CTYPE_CQ;
309 : 0 : aq->op = NIX_AQ_INSTOP_WRITE;
310 : :
311 [ # # ]: 0 : if (fc_cfg->cq_cfg.enable) {
312 : 0 : aq->cq.bpid = nix->bpid[fc_cfg->cq_cfg.tc];
313 : 0 : aq->cq_mask.bpid = ~(aq->cq_mask.bpid);
314 : 0 : aq->cq.bp = fc_cfg->cq_cfg.cq_bp;
315 : 0 : aq->cq_mask.bp = ~(aq->cq_mask.bp);
316 : : }
317 : :
318 : 0 : aq->cq.bp_ena = !!(fc_cfg->cq_cfg.enable);
319 : 0 : aq->cq_mask.bp_ena = ~(aq->cq_mask.bp_ena);
320 : : } else {
321 : : struct nix_cn20k_aq_enq_req *aq;
322 : :
323 : 0 : aq = mbox_alloc_msg_nix_cn20k_aq_enq(mbox);
324 [ # # ]: 0 : if (!aq) {
325 : : rc = -ENOSPC;
326 : 0 : goto exit;
327 : : }
328 : :
329 : 0 : aq->qidx = fc_cfg->cq_cfg.rq;
330 : 0 : aq->ctype = NIX_AQ_CTYPE_CQ;
331 : 0 : aq->op = NIX_AQ_INSTOP_WRITE;
332 : :
333 [ # # ]: 0 : if (fc_cfg->cq_cfg.enable) {
334 : 0 : aq->cq.bpid = nix->bpid[fc_cfg->cq_cfg.tc];
335 : 0 : aq->cq_mask.bpid = ~(aq->cq_mask.bpid);
336 : 0 : aq->cq.bpid_ext = (nix->bpid[fc_cfg->cq_cfg.tc] >> 9) & 0x3;
337 : 0 : aq->cq_mask.bpid_ext = ~(aq->cq_mask.bpid_ext);
338 : 0 : aq->cq.bp = fc_cfg->cq_cfg.cq_bp;
339 : 0 : aq->cq_mask.bp = ~(aq->cq_mask.bp);
340 : : }
341 : :
342 : 0 : aq->cq.bp_ena = !!(fc_cfg->cq_cfg.enable);
343 : 0 : aq->cq_mask.bp_ena = ~(aq->cq_mask.bp_ena);
344 : : }
345 : :
346 : 0 : rc = mbox_process(mbox);
347 : 0 : exit:
348 : : mbox_put(mbox);
349 : 0 : return rc;
350 : : }
351 : :
352 : : static int
353 : 0 : nix_fc_rq_config_set(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
354 : : {
355 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
356 : : uint64_t pool_drop_pct, spb_pool_drop_pct;
357 : : struct roc_nix_fc_cfg tmp;
358 : : struct roc_nix_rq *rq;
359 : : int rc;
360 : :
361 : 0 : rq = nix->rqs[fc_cfg->rq_cfg.rq];
362 : :
363 [ # # ]: 0 : if (rq->sso_ena) {
364 : 0 : pool_drop_pct = fc_cfg->rq_cfg.pool_drop_pct;
365 : : /* Use default value for zero pct */
366 [ # # # # ]: 0 : if (fc_cfg->rq_cfg.enable && !pool_drop_pct)
367 : : pool_drop_pct = ROC_NIX_AURA_THRESH;
368 : :
369 : 0 : roc_nix_fc_npa_bp_cfg(roc_nix, fc_cfg->rq_cfg.pool, fc_cfg->rq_cfg.enable,
370 : 0 : roc_nix->force_rx_aura_bp, fc_cfg->rq_cfg.tc, pool_drop_pct);
371 : :
372 [ # # ]: 0 : if (rq->spb_ena) {
373 : 0 : spb_pool_drop_pct = fc_cfg->rq_cfg.spb_pool_drop_pct;
374 : : /* Use default value for zero pct */
375 [ # # ]: 0 : if (!spb_pool_drop_pct)
376 : : spb_pool_drop_pct = ROC_NIX_AURA_THRESH;
377 : :
378 : 0 : roc_nix_fc_npa_bp_cfg(roc_nix, fc_cfg->rq_cfg.spb_pool,
379 : 0 : fc_cfg->rq_cfg.enable, roc_nix->force_rx_aura_bp,
380 : 0 : fc_cfg->rq_cfg.tc, spb_pool_drop_pct);
381 : : }
382 : :
383 [ # # # # ]: 0 : if (roc_nix->local_meta_aura_ena && roc_nix->meta_aura_handle)
384 : 0 : roc_nix_fc_npa_bp_cfg(roc_nix, roc_nix->meta_aura_handle,
385 : 0 : fc_cfg->rq_cfg.enable, roc_nix->force_rx_aura_bp,
386 : 0 : fc_cfg->rq_cfg.tc, pool_drop_pct);
387 : : }
388 : :
389 : : /* Copy RQ config to CQ config as they are occupying same area */
390 : : memset(&tmp, 0, sizeof(tmp));
391 : 0 : tmp.type = ROC_NIX_FC_CQ_CFG;
392 : 0 : tmp.cq_cfg.rq = fc_cfg->rq_cfg.rq;
393 : 0 : tmp.cq_cfg.tc = fc_cfg->rq_cfg.tc;
394 : 0 : tmp.cq_cfg.cq_drop = fc_cfg->rq_cfg.cq_drop;
395 : 0 : tmp.cq_cfg.cq_bp = fc_cfg->rq_cfg.cq_bp;
396 : 0 : tmp.cq_cfg.enable = fc_cfg->rq_cfg.enable;
397 : :
398 : 0 : rc = nix_fc_cq_config_set(roc_nix, &tmp);
399 [ # # ]: 0 : if (rc)
400 : : return rc;
401 : :
402 [ # # ]: 0 : rq->tc = fc_cfg->rq_cfg.enable ? fc_cfg->rq_cfg.tc : ROC_NIX_PFC_CLASS_INVALID;
403 [ # # ]: 0 : plt_nix_dbg("RQ %u: TC %u %s", fc_cfg->rq_cfg.rq, fc_cfg->rq_cfg.tc,
404 : : fc_cfg->rq_cfg.enable ? "enabled" : "disabled");
405 : 0 : return 0;
406 : : }
407 : :
408 : : int
409 : 0 : roc_nix_fc_config_get(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
410 : : {
411 [ # # # # : 0 : if (!roc_nix_is_pf(roc_nix) && !roc_nix_is_lbk(roc_nix) &&
# # ]
412 : 0 : !roc_nix_is_sdp(roc_nix))
413 : : return 0;
414 : :
415 [ # # ]: 0 : if (fc_cfg->type == ROC_NIX_FC_CQ_CFG)
416 : 0 : return nix_fc_cq_config_get(roc_nix, fc_cfg);
417 [ # # ]: 0 : else if (fc_cfg->type == ROC_NIX_FC_RQ_CFG)
418 : 0 : return nix_fc_rq_config_get(roc_nix, fc_cfg);
419 [ # # ]: 0 : else if (fc_cfg->type == ROC_NIX_FC_RXCHAN_CFG)
420 : 0 : return nix_fc_rxchan_bpid_get(roc_nix, fc_cfg);
421 [ # # ]: 0 : else if (fc_cfg->type == ROC_NIX_FC_TM_CFG)
422 : 0 : return nix_tm_bp_config_get(roc_nix, &fc_cfg->tm_cfg.enable);
423 : :
424 : : return -EINVAL;
425 : : }
426 : :
427 : : int
428 : 0 : roc_nix_fc_config_set(struct roc_nix *roc_nix, struct roc_nix_fc_cfg *fc_cfg)
429 : : {
430 [ # # ]: 0 : if (fc_cfg->type == ROC_NIX_FC_CQ_CFG)
431 : 0 : return nix_fc_cq_config_set(roc_nix, fc_cfg);
432 [ # # ]: 0 : else if (fc_cfg->type == ROC_NIX_FC_RQ_CFG)
433 : 0 : return nix_fc_rq_config_set(roc_nix, fc_cfg);
434 [ # # ]: 0 : else if (fc_cfg->type == ROC_NIX_FC_RXCHAN_CFG)
435 : 0 : return nix_fc_rxchan_bpid_set(roc_nix,
436 : 0 : fc_cfg->rxchan_cfg.enable);
437 [ # # ]: 0 : else if (fc_cfg->type == ROC_NIX_FC_TM_CFG)
438 : 0 : return nix_tm_bp_config_set(roc_nix, fc_cfg->tm_cfg.sq,
439 : 0 : fc_cfg->tm_cfg.tc,
440 : 0 : fc_cfg->tm_cfg.enable);
441 : :
442 : : return -EINVAL;
443 : : }
444 : :
445 : : enum roc_nix_fc_mode
446 : 0 : roc_nix_fc_mode_get(struct roc_nix *roc_nix)
447 : : {
448 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
449 : : enum roc_nix_fc_mode mode;
450 : :
451 [ # # # # ]: 0 : if (nix->tx_pause && nix->rx_pause)
452 : : mode = ROC_NIX_FC_FULL;
453 [ # # ]: 0 : else if (nix->rx_pause)
454 : : mode = ROC_NIX_FC_RX;
455 [ # # ]: 0 : else if (nix->tx_pause)
456 : : mode = ROC_NIX_FC_TX;
457 : : else
458 : : mode = ROC_NIX_FC_NONE;
459 : 0 : return mode;
460 : : }
461 : :
462 : : int
463 : 0 : roc_nix_fc_mode_set(struct roc_nix *roc_nix, enum roc_nix_fc_mode mode)
464 : : {
465 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
466 : : struct dev *dev = &nix->dev;
467 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
468 : : struct cgx_pause_frm_cfg *req;
469 : : uint8_t tx_pause, rx_pause;
470 : : int rc = -ENOSPC;
471 : :
472 : 0 : rx_pause = (mode == ROC_NIX_FC_FULL) || (mode == ROC_NIX_FC_RX);
473 : 0 : tx_pause = (mode == ROC_NIX_FC_FULL) || (mode == ROC_NIX_FC_TX);
474 : :
475 : : /* Nothing much to do for LBK links */
476 [ # # ]: 0 : if (roc_nix_is_lbk(roc_nix)) {
477 : 0 : nix->rx_pause = rx_pause;
478 : 0 : nix->tx_pause = tx_pause;
479 : : rc = 0;
480 : 0 : goto exit;
481 : : }
482 : :
483 : : /* Set new config */
484 : 0 : req = mbox_alloc_msg_cgx_cfg_pause_frm(mbox);
485 [ # # ]: 0 : if (req == NULL)
486 : 0 : goto exit;
487 : 0 : req->set = 1;
488 : 0 : req->rx_pause = rx_pause;
489 : 0 : req->tx_pause = tx_pause;
490 : :
491 : 0 : rc = mbox_process(mbox);
492 [ # # ]: 0 : if (rc)
493 : 0 : goto exit;
494 : :
495 : 0 : nix->rx_pause = rx_pause;
496 : 0 : nix->tx_pause = tx_pause;
497 : 0 : exit:
498 : : mbox_put(mbox);
499 : 0 : return rc;
500 : : }
501 : :
502 : : static int
503 [ # # ]: 0 : nix_rx_chan_multi_bpid_cfg(struct roc_nix *roc_nix, uint8_t chan, uint16_t bpid, uint16_t *bpid_new)
504 : : {
505 : : struct roc_nix *roc_nix_tmp, *roc_nix_pre = NULL;
506 : : struct roc_nix_list *nix_list;
507 : : uint8_t chan_pre;
508 : :
509 : : if (!roc_feature_nix_has_rxchan_multi_bpid())
510 : : return -ENOTSUP;
511 : :
512 : 0 : nix_list = roc_idev_nix_list_get();
513 [ # # ]: 0 : if (nix_list == NULL)
514 : : return -EINVAL;
515 : :
516 : : /* Find associated NIX RX channel if Aura BPID is of that of a NIX. */
517 [ # # ]: 0 : TAILQ_FOREACH(roc_nix_tmp, nix_list, next) {
518 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix_tmp);
519 : : int i;
520 : :
521 [ # # ]: 0 : for (i = 0; i < NIX_MAX_CHAN; i++) {
522 [ # # ]: 0 : if (nix->bpid[i] == bpid)
523 : : break;
524 : : }
525 : :
526 [ # # ]: 0 : if (i < NIX_MAX_CHAN) {
527 : : roc_nix_pre = roc_nix_tmp;
528 : 0 : chan_pre = i;
529 : 0 : break;
530 : : }
531 : : }
532 : :
533 : : /* Alloc and configure a new BPID if Aura BPID is that of a NIX. */
534 [ # # ]: 0 : if (roc_nix_pre) {
535 [ # # ]: 0 : if (roc_nix_bpids_alloc(roc_nix, ROC_NIX_INTF_TYPE_SSO, 1, bpid_new) <= 0)
536 : : return -ENOSPC;
537 : :
538 [ # # ]: 0 : if (roc_nix_chan_bpid_set(roc_nix_pre, chan_pre, *bpid_new, 1, false) < 0)
539 : : return -ENOSPC;
540 : :
541 [ # # ]: 0 : if (roc_nix_chan_bpid_set(roc_nix, chan, *bpid_new, 1, false) < 0)
542 : : return -ENOSPC;
543 : :
544 : 0 : return 0;
545 : : } else {
546 : 0 : return roc_nix_chan_bpid_set(roc_nix, chan, bpid, 1, false);
547 : : }
548 : :
549 : : return 0;
550 : : }
551 : :
552 : : #define NIX_BPID_INVALID 0xFFFF
553 : :
554 : : static void
555 : 0 : nix_fc_npa_multi_bp_cfg(struct roc_nix *roc_nix, uint64_t pool_handle, uint8_t ena, uint8_t force,
556 : : uint8_t tc, uint64_t drop_percent)
557 : : {
558 : 0 : uint32_t pool_id = roc_npa_aura_handle_to_aura(pool_handle);
559 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
560 : 0 : struct npa_lf *lf = idev_npa_obj_get();
561 : : struct npa_aura_attr *aura_attr;
562 : : uint8_t bp_thresh, bp_ena;
563 : : uint16_t bpid;
564 : : int i;
565 : :
566 [ # # ]: 0 : if (!lf)
567 : : return;
568 : :
569 : 0 : aura_attr = &lf->aura_attr[pool_id];
570 : :
571 : 0 : bp_thresh = NIX_RQ_AURA_BP_THRESH(drop_percent, aura_attr->limit, aura_attr->shift);
572 : 0 : bpid = aura_attr->nix0_bpid;
573 : 0 : bp_ena = aura_attr->bp_ena;
574 : :
575 : : /* BP is already enabled. */
576 [ # # # # ]: 0 : if ((bp_ena & (0x1 << tc)) && ena) {
577 [ # # ]: 0 : if (bp_thresh != aura_attr->bp_thresh[tc]) {
578 [ # # ]: 0 : if (roc_npa_pool_bp_configure(pool_id, nix->bpid[0], bp_thresh, tc, true))
579 : 0 : plt_err("Enabling backpressue failed on pool 0x%" PRIx32, pool_id);
580 : : } else {
581 : 0 : aura_attr->ref_count++;
582 : : }
583 : :
584 : 0 : return;
585 : : }
586 : :
587 [ # # ]: 0 : if (ena) {
588 [ # # ]: 0 : if (roc_npa_pool_bp_configure(pool_id, nix->bpid[0], bp_thresh, tc, true))
589 : 0 : plt_err("Enabling backpressue failed on pool 0x%" PRIx32, pool_id);
590 : : else
591 : 0 : aura_attr->ref_count++;
592 : : } else {
593 : 0 : bool found = !!force;
594 : :
595 : : /* Don't disable if existing BPID is not within this port's list */
596 [ # # ]: 0 : for (i = 0; i < nix->chan_cnt; i++)
597 [ # # ]: 0 : if (bpid == nix->bpid[i])
598 : : found = true;
599 [ # # ]: 0 : if (!found)
600 : : return;
601 [ # # # # ]: 0 : else if ((aura_attr->ref_count > 0) && --(aura_attr->ref_count))
602 : : return;
603 : :
604 [ # # ]: 0 : if (roc_npa_pool_bp_configure(pool_id, 0, 0, 0, false))
605 : 0 : plt_err("Disabling backpressue failed on pool 0x%" PRIx32, pool_id);
606 : : }
607 : : }
608 : :
609 : : void
610 : 0 : roc_nix_fc_npa_bp_cfg(struct roc_nix *roc_nix, uint64_t pool_id, uint8_t ena, uint8_t force,
611 : : uint8_t tc, uint64_t drop_percent)
612 : : {
613 : : uint32_t aura_id = roc_npa_aura_handle_to_aura(pool_id);
614 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
615 : 0 : struct npa_lf *lf = idev_npa_obj_get();
616 : : struct npa_aura_attr *aura_attr;
617 : : uint8_t bp_thresh, bp_intf;
618 : : uint16_t bpid;
619 : : int i;
620 : :
621 [ # # ]: 0 : if (roc_nix_is_sdp(roc_nix))
622 : : return;
623 : :
624 [ # # ]: 0 : if (!lf)
625 : : return;
626 : :
627 [ # # # # ]: 0 : if (roc_model_is_cn20k() && roc_nix->use_multi_bpids) {
628 : 0 : nix_fc_npa_multi_bp_cfg(roc_nix, pool_id, ena, force, tc, drop_percent);
629 : 0 : return;
630 : : }
631 : :
632 : 0 : aura_attr = &lf->aura_attr[aura_id];
633 : :
634 : 0 : bp_intf = 1 << nix->is_nix1;
635 : 0 : bp_thresh = NIX_RQ_AURA_BP_THRESH(drop_percent, aura_attr->limit, aura_attr->shift);
636 : :
637 [ # # ]: 0 : bpid = (aura_attr->bp_ena & 0x1) ? aura_attr->nix0_bpid : aura_attr->nix1_bpid;
638 : : /* BP is already enabled. */
639 [ # # # # ]: 0 : if (aura_attr->bp_ena && ena) {
640 [ # # ]: 0 : if (bpid != nix->bpid[tc]) {
641 : 0 : uint16_t bpid_new = NIX_BPID_INVALID;
642 : :
643 [ # # # # ]: 0 : if (force && !nix_rx_chan_multi_bpid_cfg(roc_nix, tc, bpid, &bpid_new)) {
644 : 0 : plt_info("Setting up shared BPID on shared aura 0x%" PRIx64,
645 : : pool_id);
646 : :
647 : : /* Configure Aura with new BPID if it is allocated. */
648 [ # # ]: 0 : if (roc_npa_aura_bp_configure(pool_id, bpid_new, bp_intf, bp_thresh,
649 : : true))
650 : 0 : plt_err("Enabling backpressue failed on aura 0x%" PRIx64,
651 : : pool_id);
652 : : } else {
653 : 0 : aura_attr->ref_count++;
654 : 0 : plt_info("Ignoring port=%u tc=%u config on shared aura 0x%" PRIx64,
655 : : roc_nix->port_id, tc, pool_id);
656 : : }
657 : : } else {
658 : 0 : aura_attr->ref_count++;
659 : : }
660 : :
661 : 0 : return;
662 : : }
663 : :
664 [ # # ]: 0 : if (ena) {
665 [ # # ]: 0 : if (roc_npa_aura_bp_configure(pool_id, nix->bpid[tc], bp_intf, bp_thresh, true))
666 : 0 : plt_err("Enabling backpressue failed on aura 0x%" PRIx64, pool_id);
667 : : else
668 : 0 : aura_attr->ref_count++;
669 : : } else {
670 : 0 : bool found = !!force;
671 : :
672 : : /* Don't disable if existing BPID is not within this port's list */
673 [ # # ]: 0 : for (i = 0; i < nix->chan_cnt; i++)
674 [ # # ]: 0 : if (bpid == nix->bpid[i])
675 : : found = true;
676 [ # # ]: 0 : if (!found)
677 : : return;
678 [ # # # # ]: 0 : else if ((aura_attr->ref_count > 0) && --(aura_attr->ref_count))
679 : : return;
680 : :
681 [ # # ]: 0 : if (roc_npa_aura_bp_configure(pool_id, 0, 0, 0, false))
682 : 0 : plt_err("Disabling backpressue failed on aura 0x%" PRIx64, pool_id);
683 : : }
684 : :
685 : : return;
686 : : }
687 : :
688 : : int
689 : 0 : roc_nix_pfc_mode_set(struct roc_nix *roc_nix, struct roc_nix_pfc_cfg *pfc_cfg)
690 : : {
691 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
692 : : struct dev *dev = &nix->dev;
693 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
694 : : uint8_t tx_pause, rx_pause;
695 : : struct cgx_pfc_cfg *req;
696 : : struct cgx_pfc_rsp *rsp;
697 : : int rc = -ENOSPC;
698 : :
699 [ # # ]: 0 : if (roc_nix_is_lbk(roc_nix)) {
700 : : rc = NIX_ERR_OP_NOTSUP;
701 : 0 : goto exit;
702 : : }
703 : :
704 : 0 : rx_pause = (pfc_cfg->mode == ROC_NIX_FC_FULL) ||
705 : : (pfc_cfg->mode == ROC_NIX_FC_RX);
706 : 0 : tx_pause = (pfc_cfg->mode == ROC_NIX_FC_FULL) ||
707 : : (pfc_cfg->mode == ROC_NIX_FC_TX);
708 : :
709 : 0 : req = mbox_alloc_msg_cgx_prio_flow_ctrl_cfg(mbox);
710 [ # # ]: 0 : if (req == NULL)
711 : 0 : goto exit;
712 : :
713 : 0 : req->pfc_en = pfc_cfg->tc;
714 : 0 : req->rx_pause = rx_pause;
715 : 0 : req->tx_pause = tx_pause;
716 : :
717 : : rc = mbox_process_msg(mbox, (void *)&rsp);
718 [ # # ]: 0 : if (rc)
719 : 0 : goto exit;
720 : :
721 : 0 : nix->pfc_rx_pause = rsp->rx_pause;
722 : 0 : nix->pfc_tx_pause = rsp->tx_pause;
723 [ # # ]: 0 : if (rsp->tx_pause)
724 : 0 : nix->cev |= BIT(pfc_cfg->tc);
725 : : else
726 : 0 : nix->cev &= ~BIT(pfc_cfg->tc);
727 : :
728 : 0 : exit:
729 : : mbox_put(mbox);
730 : 0 : return rc;
731 : : }
732 : :
733 : : int
734 : 0 : roc_nix_pfc_mode_get(struct roc_nix *roc_nix, struct roc_nix_pfc_cfg *pfc_cfg)
735 : : {
736 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
737 : :
738 [ # # ]: 0 : if (roc_nix_is_lbk(roc_nix))
739 : : return NIX_ERR_OP_NOTSUP;
740 : :
741 : 0 : pfc_cfg->tc = nix->cev;
742 : :
743 [ # # # # ]: 0 : if (nix->pfc_rx_pause && nix->pfc_tx_pause)
744 : 0 : pfc_cfg->mode = ROC_NIX_FC_FULL;
745 [ # # ]: 0 : else if (nix->pfc_rx_pause)
746 : 0 : pfc_cfg->mode = ROC_NIX_FC_RX;
747 [ # # ]: 0 : else if (nix->pfc_tx_pause)
748 : 0 : pfc_cfg->mode = ROC_NIX_FC_TX;
749 : : else
750 : 0 : pfc_cfg->mode = ROC_NIX_FC_NONE;
751 : :
752 : : return 0;
753 : : }
754 : :
755 : : uint16_t
756 : 0 : roc_nix_chan_count_get(struct roc_nix *roc_nix)
757 : : {
758 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
759 : :
760 : 0 : return nix->chan_cnt;
761 : : }
762 : :
763 : : /* Allocate BPID for requested type
764 : : * Returns number of BPIDs allocated
765 : : * 0 if no BPIDs available
766 : : * -ve value on error
767 : : */
768 : : int
769 : 0 : nix_bpids_alloc(struct dev *dev, uint8_t type, uint8_t bp_cnt, uint16_t *bpids)
770 : : {
771 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
772 : : struct nix_alloc_bpid_req *req;
773 : : struct nix_bpids *rsp;
774 : : int rc = -EINVAL;
775 : :
776 : : /* Use this api for unreserved interface types */
777 [ # # # # ]: 0 : if ((type < ROC_NIX_INTF_TYPE_RSVD) || (bp_cnt > ROC_NIX_MAX_BPID_CNT) || !bpids)
778 : 0 : goto exit;
779 : :
780 : : rc = -ENOSPC;
781 : 0 : req = mbox_alloc_msg_nix_alloc_bpids(mbox);
782 [ # # ]: 0 : if (req == NULL)
783 : 0 : goto exit;
784 : 0 : req->type = type;
785 : 0 : req->bpid_cnt = bp_cnt;
786 : :
787 : : rc = mbox_process_msg(mbox, (void *)&rsp);
788 [ # # ]: 0 : if (rc)
789 : 0 : goto exit;
790 : :
791 [ # # ]: 0 : for (rc = 0; rc < rsp->bpid_cnt; rc++)
792 : 0 : bpids[rc] = rsp->bpids[rc];
793 : 0 : exit:
794 : : mbox_put(mbox);
795 : 0 : return rc;
796 : : }
797 : :
798 : : int
799 : 0 : nix_bpids_free(struct dev *dev, uint8_t bp_cnt, uint16_t *bpids)
800 : : {
801 : 0 : struct mbox *mbox = mbox_get(dev->mbox);
802 : : struct nix_bpids *req;
803 : : int rc = -EINVAL;
804 : :
805 : : /* Use this api for unreserved interface types */
806 [ # # ]: 0 : if ((bp_cnt > ROC_NIX_MAX_BPID_CNT) || !bpids)
807 : 0 : goto exit;
808 : :
809 : : rc = -ENOSPC;
810 : 0 : req = mbox_alloc_msg_nix_free_bpids(mbox);
811 [ # # ]: 0 : if (req == NULL)
812 : 0 : goto exit;
813 [ # # ]: 0 : for (rc = 0; rc < bp_cnt; rc++)
814 : 0 : req->bpids[rc] = bpids[rc];
815 : 0 : req->bpid_cnt = rc;
816 : :
817 : 0 : rc = mbox_process(mbox);
818 : 0 : exit:
819 : : mbox_put(mbox);
820 : 0 : return rc;
821 : : }
822 : :
823 : : int
824 : 0 : roc_nix_bpids_alloc(struct roc_nix *roc_nix, uint8_t type, uint8_t bp_cnt, uint16_t *bpids)
825 : : {
826 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
827 : 0 : return nix_bpids_alloc(&nix->dev, type, bp_cnt, bpids);
828 : : }
829 : :
830 : : int
831 : 0 : roc_nix_bpids_free(struct roc_nix *roc_nix, uint8_t bp_cnt, uint16_t *bpids)
832 : : {
833 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
834 : 0 : return nix_bpids_free(&nix->dev, bp_cnt, bpids);
835 : : }
836 : :
837 : : int
838 : 0 : roc_nix_rx_chan_cfg_get(struct roc_nix *roc_nix, uint16_t chan, bool is_cpt, uint64_t *cfg)
839 : : {
840 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
841 : 0 : struct mbox *mbox = mbox_get(nix->dev.mbox);
842 : : struct nix_rx_chan_cfg *req;
843 : : struct nix_rx_chan_cfg *rsp;
844 : : int rc = -EINVAL;
845 : :
846 : 0 : req = mbox_alloc_msg_nix_rx_chan_cfg(mbox);
847 [ # # ]: 0 : if (req == NULL)
848 : 0 : goto exit;
849 [ # # ]: 0 : if (is_cpt)
850 : 0 : req->type = ROC_NIX_INTF_TYPE_CPT;
851 : 0 : req->chan = chan;
852 : 0 : req->read = 1;
853 : :
854 : : rc = mbox_process_msg(mbox, (void *)&rsp);
855 [ # # ]: 0 : if (rc)
856 : 0 : goto exit;
857 : 0 : *cfg = rsp->val;
858 : 0 : exit:
859 : : mbox_put(mbox);
860 : 0 : return rc;
861 : : }
862 : :
863 : : int
864 : 0 : roc_nix_rx_chan_cfg_set(struct roc_nix *roc_nix, uint16_t chan, bool is_cpt, uint64_t val)
865 : : {
866 : : struct nix *nix = roc_nix_to_nix_priv(roc_nix);
867 : 0 : struct mbox *mbox = mbox_get(nix->dev.mbox);
868 : : struct nix_rx_chan_cfg *req;
869 : : int rc = -EINVAL;
870 : :
871 : 0 : req = mbox_alloc_msg_nix_rx_chan_cfg(mbox);
872 [ # # ]: 0 : if (req == NULL)
873 : 0 : goto exit;
874 [ # # ]: 0 : if (is_cpt)
875 : 0 : req->type = ROC_NIX_INTF_TYPE_CPT;
876 : 0 : req->chan = chan;
877 : 0 : req->val = val;
878 : 0 : req->read = 0;
879 : :
880 : 0 : rc = mbox_process(mbox);
881 : 0 : exit:
882 : : mbox_put(mbox);
883 : 0 : return rc;
884 : : }
885 : :
886 : : #define NIX_BPID1_ENA 15
887 : : #define NIX_BPID2_ENA 14
888 : : #define NIX_BPID3_ENA 13
889 : :
890 : : #define NIX_BPID1_OFF 20
891 : : #define NIX_BPID2_OFF 32
892 : : #define NIX_BPID3_OFF 44
893 : :
894 : : int
895 [ # # ]: 0 : roc_nix_chan_bpid_set(struct roc_nix *roc_nix, uint16_t chan, uint64_t bpid, int ena, bool cpt_chan)
896 : : {
897 : : uint64_t cfg;
898 : : int rc;
899 : :
900 : : if (!roc_feature_nix_has_rxchan_multi_bpid())
901 : : return -ENOTSUP;
902 : :
903 : 0 : rc = roc_nix_rx_chan_cfg_get(roc_nix, chan, cpt_chan, &cfg);
904 [ # # ]: 0 : if (rc)
905 : : return rc;
906 : :
907 [ # # ]: 0 : if (ena) {
908 [ # # ]: 0 : if ((((cfg >> NIX_BPID1_OFF) & GENMASK_ULL(10, 0)) == bpid) ||
909 [ # # ]: 0 : (((cfg >> NIX_BPID2_OFF) & GENMASK_ULL(10, 0)) == bpid) ||
910 [ # # ]: 0 : (((cfg >> NIX_BPID3_OFF) & GENMASK_ULL(10, 0)) == bpid))
911 : : return 0;
912 : :
913 [ # # ]: 0 : if (!(cfg & BIT_ULL(NIX_BPID1_ENA))) {
914 : 0 : cfg &= ~GENMASK_ULL(NIX_BPID1_OFF + 10, NIX_BPID1_OFF);
915 : 0 : cfg |= (((uint64_t)bpid << NIX_BPID1_OFF) | BIT_ULL(NIX_BPID1_ENA));
916 [ # # ]: 0 : } else if (!(cfg & BIT_ULL(NIX_BPID2_ENA))) {
917 : 0 : cfg &= ~GENMASK_ULL(NIX_BPID2_OFF + 10, NIX_BPID2_OFF);
918 : 0 : cfg |= (((uint64_t)bpid << NIX_BPID2_OFF) | BIT_ULL(NIX_BPID2_ENA));
919 [ # # ]: 0 : } else if (!(cfg & BIT_ULL(NIX_BPID3_ENA))) {
920 : 0 : cfg &= ~GENMASK_ULL(NIX_BPID3_OFF + 10, NIX_BPID3_OFF);
921 : 0 : cfg |= (((uint64_t)bpid << NIX_BPID3_OFF) | BIT_ULL(NIX_BPID3_ENA));
922 : : } else {
923 : 0 : plt_nix_dbg("Exceed maximum BPIDs");
924 : 0 : return -ENOSPC;
925 : : }
926 : : } else {
927 [ # # ]: 0 : if (((cfg >> NIX_BPID1_OFF) & GENMASK_ULL(10, 0)) == bpid) {
928 : 0 : cfg &= ~(GENMASK_ULL(NIX_BPID1_OFF + 10, NIX_BPID1_OFF) |
929 : : BIT_ULL(NIX_BPID1_ENA));
930 [ # # ]: 0 : } else if (((cfg >> NIX_BPID2_OFF) & GENMASK_ULL(10, 0)) == bpid) {
931 : 0 : cfg &= ~(GENMASK_ULL(NIX_BPID2_OFF + 10, NIX_BPID2_OFF) |
932 : : BIT_ULL(NIX_BPID2_ENA));
933 [ # # ]: 0 : } else if (((cfg >> NIX_BPID3_OFF) & GENMASK_ULL(10, 0)) == bpid) {
934 : 0 : cfg &= ~(GENMASK_ULL(NIX_BPID3_OFF + 10, NIX_BPID3_OFF) |
935 : : BIT_ULL(NIX_BPID3_ENA));
936 : : } else {
937 : 0 : plt_nix_dbg("BPID not found");
938 : 0 : return -EINVAL;
939 : : }
940 : : }
941 : 0 : return roc_nix_rx_chan_cfg_set(roc_nix, chan, cpt_chan, cfg);
942 : : }
|