Lines Matching +full:max +full:- +full:msg

2  * Copyright (c) 2015-2024, Broadcom. All rights reserved.  The term
52 if (!_is_chip_gen_p5_p7(rcfw->res->cctx)) in bnxt_qplib_is_atomic_cap()
54 pcie_capability_read_word(rcfw->pdev, PCI_EXP_DEVCTL2, &pcie_ctl2); in bnxt_qplib_is_atomic_cap()
61 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_query_version() local
67 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_query_version()
69 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_query_version()
71 dev_err(&rcfw->pdev->dev, "QPLIB: Failed to query version\n"); in bnxt_qplib_query_version()
83 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_get_dev_attr() local
94 cctx = rcfw->res->cctx; in bnxt_qplib_get_dev_attr()
95 attr = rcfw->res->dattr; in bnxt_qplib_get_dev_attr()
101 sbuf.sb = dma_zalloc_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_get_dev_attr()
104 return -ENOMEM; in bnxt_qplib_get_dev_attr()
108 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, &sbuf, sizeof(req), in bnxt_qplib_get_dev_attr()
110 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_get_dev_attr()
115 attr->max_qp = le32_to_cpu(sb->max_qp); in bnxt_qplib_get_dev_attr()
116 attr->max_qp = min_t(u32, attr->max_qp, BNXT_RE_MAX_QP_SUPPORTED(chip_gen)); in bnxt_qplib_get_dev_attr()
118 attr->max_qp += 1; in bnxt_qplib_get_dev_attr()
119 attr->max_qp_rd_atom = in bnxt_qplib_get_dev_attr()
120 sb->max_qp_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ? in bnxt_qplib_get_dev_attr()
121 BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_rd_atom; in bnxt_qplib_get_dev_attr()
122 attr->max_qp_init_rd_atom = in bnxt_qplib_get_dev_attr()
123 sb->max_qp_init_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ? in bnxt_qplib_get_dev_attr()
124 BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_init_rd_atom; in bnxt_qplib_get_dev_attr()
128 attr->max_qp_wqes = le16_to_cpu(sb->max_qp_wr) - 1; in bnxt_qplib_get_dev_attr()
130 if (cctx->modes.wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE) { in bnxt_qplib_get_dev_attr()
131 attr->max_qp_wqes = (BNXT_MAX_SQ_SIZE) / in bnxt_qplib_get_dev_attr()
132 (BNXT_MAX_VAR_WQE_SIZE / BNXT_SGE_SIZE) - 1; in bnxt_qplib_get_dev_attr()
137 * reporting the max number for gen-p4 only. in bnxt_qplib_get_dev_attr()
139 attr->max_qp_wqes -= BNXT_QPLIB_RESERVED_QP_WRS; in bnxt_qplib_get_dev_attr()
141 attr->max_qp_sges = sb->max_sge; in bnxt_qplib_get_dev_attr()
143 cctx->modes.wqe_mode == BNXT_QPLIB_WQE_MODE_VARIABLE) in bnxt_qplib_get_dev_attr()
144 attr->max_qp_sges = sb->max_sge_var_wqe; in bnxt_qplib_get_dev_attr()
145 attr->max_cq = le32_to_cpu(sb->max_cq); in bnxt_qplib_get_dev_attr()
146 attr->max_cq = min_t(u32, attr->max_cq, BNXT_RE_MAX_CQ_SUPPORTED(chip_gen)); in bnxt_qplib_get_dev_attr()
148 attr->max_cq_wqes = le32_to_cpu(sb->max_cqe); in bnxt_qplib_get_dev_attr()
149 attr->max_cq_wqes = min_t(u32, BNXT_QPLIB_MAX_CQ_WQES, attr->max_cq_wqes); in bnxt_qplib_get_dev_attr()
151 attr->max_cq_sges = attr->max_qp_sges; in bnxt_qplib_get_dev_attr()
152 attr->max_mr = le32_to_cpu(sb->max_mr); in bnxt_qplib_get_dev_attr()
153 attr->max_mr = min_t(u32, attr->max_mr, BNXT_RE_MAX_MRW_SUPPORTED(chip_gen)); in bnxt_qplib_get_dev_attr()
154 attr->max_mw = le32_to_cpu(sb->max_mw); in bnxt_qplib_get_dev_attr()
155 attr->max_mw = min_t(u32, attr->max_mw, BNXT_RE_MAX_MRW_SUPPORTED(chip_gen)); in bnxt_qplib_get_dev_attr()
157 attr->max_mr_size = le64_to_cpu(sb->max_mr_size); in bnxt_qplib_get_dev_attr()
158 attr->max_pd = BNXT_QPLIB_MAX_PD; in bnxt_qplib_get_dev_attr()
159 attr->max_raw_ethy_qp = le32_to_cpu(sb->max_raw_eth_qp); in bnxt_qplib_get_dev_attr()
160 attr->max_ah = le32_to_cpu(sb->max_ah); in bnxt_qplib_get_dev_attr()
161 attr->max_ah = min_t(u32, attr->max_ah, BNXT_RE_MAX_AH_SUPPORTED(chip_gen)); in bnxt_qplib_get_dev_attr()
163 attr->max_fmr = le32_to_cpu(sb->max_fmr); in bnxt_qplib_get_dev_attr()
164 attr->max_map_per_fmr = sb->max_map_per_fmr; in bnxt_qplib_get_dev_attr()
166 attr->max_srq = le16_to_cpu(sb->max_srq); in bnxt_qplib_get_dev_attr()
167 attr->max_srq = min_t(u32, attr->max_srq, BNXT_RE_MAX_SRQ_SUPPORTED(chip_gen)); in bnxt_qplib_get_dev_attr()
168 attr->max_srq_wqes = le32_to_cpu(sb->max_srq_wr) - 1; in bnxt_qplib_get_dev_attr()
169 attr->max_srq_sges = sb->max_srq_sge; in bnxt_qplib_get_dev_attr()
170 attr->max_pkey = 1; in bnxt_qplib_get_dev_attr()
172 attr->max_inline_data = !cctx->modes.wqe_mode ? in bnxt_qplib_get_dev_attr()
173 le32_to_cpu(sb->max_inline_data) : in bnxt_qplib_get_dev_attr()
174 le16_to_cpu(sb->max_inline_data_var_wqe); in bnxt_qplib_get_dev_attr()
176 attr->l2_db_size = (sb->l2_db_space_size + 1) * in bnxt_qplib_get_dev_attr()
179 attr->max_sgid = le32_to_cpu(sb->max_gid); in bnxt_qplib_get_dev_attr()
182 bnxt_re_set_max_gid(&attr->max_sgid); in bnxt_qplib_get_dev_attr()
184 attr->dev_cap_flags = le16_to_cpu(sb->dev_cap_flags); in bnxt_qplib_get_dev_attr()
185 attr->page_size_cap = BIT_ULL(28) | BIT_ULL(21) | BIT_ULL(12); in bnxt_qplib_get_dev_attr()
187 bnxt_qplib_query_version(rcfw, attr->fw_ver); in bnxt_qplib_get_dev_attr()
190 temp = le32_to_cpu(sb->tqm_alloc_reqs[i]); in bnxt_qplib_get_dev_attr()
192 attr->tqm_alloc_reqs[i * 4] = *tqm_alloc; in bnxt_qplib_get_dev_attr()
193 attr->tqm_alloc_reqs[i * 4 + 1] = *(++tqm_alloc); in bnxt_qplib_get_dev_attr()
194 attr->tqm_alloc_reqs[i * 4 + 2] = *(++tqm_alloc); in bnxt_qplib_get_dev_attr()
195 attr->tqm_alloc_reqs[i * 4 + 3] = *(++tqm_alloc); in bnxt_qplib_get_dev_attr()
198 if (rcfw->res->cctx->hwrm_intf_ver >= HWRM_VERSION_DEV_ATTR_MAX_DPI) in bnxt_qplib_get_dev_attr()
199 attr->max_dpi = le32_to_cpu(sb->max_dpi); in bnxt_qplib_get_dev_attr()
201 attr->is_atomic = bnxt_qplib_is_atomic_cap(rcfw); in bnxt_qplib_get_dev_attr()
203 dma_free_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_get_dev_attr()
212 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_set_func_resources() local
217 rcfw = res->rcfw; in bnxt_qplib_set_func_resources()
218 hctx = res->hctx; in bnxt_qplib_set_func_resources()
222 req.number_of_qp = cpu_to_le32(hctx->qp_ctx.max); in bnxt_qplib_set_func_resources()
223 req.number_of_mrw = cpu_to_le32(hctx->mrw_ctx.max); in bnxt_qplib_set_func_resources()
224 req.number_of_srq = cpu_to_le32(hctx->srq_ctx.max); in bnxt_qplib_set_func_resources()
225 req.number_of_cq = cpu_to_le32(hctx->cq_ctx.max); in bnxt_qplib_set_func_resources()
227 req.max_qp_per_vf = cpu_to_le32(hctx->vf_res.max_qp); in bnxt_qplib_set_func_resources()
228 req.max_mrw_per_vf = cpu_to_le32(hctx->vf_res.max_mrw); in bnxt_qplib_set_func_resources()
229 req.max_srq_per_vf = cpu_to_le32(hctx->vf_res.max_srq); in bnxt_qplib_set_func_resources()
230 req.max_cq_per_vf = cpu_to_le32(hctx->vf_res.max_cq); in bnxt_qplib_set_func_resources()
231 req.max_gid_per_vf = cpu_to_le32(hctx->vf_res.max_gid); in bnxt_qplib_set_func_resources()
234 req.stat_ctx_id = cpu_to_le32(hctx->stats.fw_id); in bnxt_qplib_set_func_resources()
236 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_set_func_resources()
238 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_set_func_resources()
240 dev_err(&res->pdev->dev, in bnxt_qplib_set_func_resources()
252 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_update_sgid()
254 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_update_sgid() local
261 req.gid[0] = cpu_to_be32(((u32 *)gid->data)[3]); in bnxt_qplib_update_sgid()
262 req.gid[1] = cpu_to_be32(((u32 *)gid->data)[2]); in bnxt_qplib_update_sgid()
263 req.gid[2] = cpu_to_be32(((u32 *)gid->data)[1]); in bnxt_qplib_update_sgid()
264 req.gid[3] = cpu_to_be32(((u32 *)gid->data)[0]); in bnxt_qplib_update_sgid()
265 if (res->prio) { in bnxt_qplib_update_sgid()
276 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_update_sgid()
278 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_update_sgid()
280 dev_err(&res->pdev->dev, in bnxt_qplib_update_sgid()
292 if (index > sgid_tbl->max) { in bnxt_qplib_get_sgid()
293 dev_err(&res->pdev->dev, in bnxt_qplib_get_sgid()
294 "QPLIB: Index %d exceeded SGID table max (%d)\n", in bnxt_qplib_get_sgid()
295 index, sgid_tbl->max); in bnxt_qplib_get_sgid()
296 return -EINVAL; in bnxt_qplib_get_sgid()
298 memcpy(gid, &sgid_tbl->tbl[index].gid, sizeof(*gid)); in bnxt_qplib_get_sgid()
309 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_del_sgid()
313 dev_err(&res->pdev->dev, "QPLIB: SGID table not allocated\n"); in bnxt_qplib_del_sgid()
314 return -EINVAL; in bnxt_qplib_del_sgid()
317 if (!sgid_tbl->active) { in bnxt_qplib_del_sgid()
318 dev_err(&res->pdev->dev, in bnxt_qplib_del_sgid()
320 return -ENOMEM; in bnxt_qplib_del_sgid()
322 for (index = 0; index < sgid_tbl->max; index++) { in bnxt_qplib_del_sgid()
323 if (!memcmp(&sgid_tbl->tbl[index].gid, gid, sizeof(*gid)) && in bnxt_qplib_del_sgid()
324 vlan_id == sgid_tbl->tbl[index].vlan_id) in bnxt_qplib_del_sgid()
327 if (index == sgid_tbl->max) { in bnxt_qplib_del_sgid()
328 dev_warn(&res->pdev->dev, "GID not found in the SGID table\n"); in bnxt_qplib_del_sgid()
334 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_del_sgid() local
340 if (sgid_tbl->hw_id[index] == 0xFFFF) { in bnxt_qplib_del_sgid()
341 dev_err(&res->pdev->dev, in bnxt_qplib_del_sgid()
343 return -EINVAL; in bnxt_qplib_del_sgid()
345 req.gid_index = cpu_to_le16(sgid_tbl->hw_id[index]); in bnxt_qplib_del_sgid()
346 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_del_sgid()
348 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_del_sgid()
352 memcpy(&sgid_tbl->tbl[index].gid, &bnxt_qplib_gid_zero, in bnxt_qplib_del_sgid()
354 sgid_tbl->tbl[index].vlan_id = 0xFFFF; in bnxt_qplib_del_sgid()
355 sgid_tbl->vlan[index] = false; in bnxt_qplib_del_sgid()
356 sgid_tbl->active--; in bnxt_qplib_del_sgid()
357 dev_dbg(&res->pdev->dev, in bnxt_qplib_del_sgid()
359 index, sgid_tbl->hw_id[index], sgid_tbl->active); in bnxt_qplib_del_sgid()
360 sgid_tbl->hw_id[index] = (u16)-1; in bnxt_qplib_del_sgid()
372 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_add_sgid()
376 dev_err(&res->pdev->dev, "QPLIB: SGID table not allocated\n"); in bnxt_qplib_add_sgid()
377 return -EINVAL; in bnxt_qplib_add_sgid()
380 if (sgid_tbl->active == sgid_tbl->max) { in bnxt_qplib_add_sgid()
381 dev_err(&res->pdev->dev, "QPLIB: SGID table is full\n"); in bnxt_qplib_add_sgid()
382 return -ENOMEM; in bnxt_qplib_add_sgid()
384 free_idx = sgid_tbl->max; in bnxt_qplib_add_sgid()
385 for (i = 0; i < sgid_tbl->max; i++) { in bnxt_qplib_add_sgid()
386 if (!memcmp(&sgid_tbl->tbl[i], gid, sizeof(*gid)) && in bnxt_qplib_add_sgid()
387 sgid_tbl->tbl[i].vlan_id == vlan_id) { in bnxt_qplib_add_sgid()
388 dev_dbg(&res->pdev->dev, in bnxt_qplib_add_sgid()
392 return -EALREADY; in bnxt_qplib_add_sgid()
393 } else if (!memcmp(&sgid_tbl->tbl[i], &bnxt_qplib_gid_zero, in bnxt_qplib_add_sgid()
395 free_idx == sgid_tbl->max) { in bnxt_qplib_add_sgid()
399 if (free_idx == sgid_tbl->max) { in bnxt_qplib_add_sgid()
400 dev_err(&res->pdev->dev, in bnxt_qplib_add_sgid()
401 "QPLIB: SGID table is FULL but count is not MAX??\n"); in bnxt_qplib_add_sgid()
402 return -ENOMEM; in bnxt_qplib_add_sgid()
406 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_add_sgid() local
413 req.gid[0] = cpu_to_be32(((u32 *)gid->raw)[3]); in bnxt_qplib_add_sgid()
414 req.gid[1] = cpu_to_be32(((u32 *)gid->raw)[2]); in bnxt_qplib_add_sgid()
415 req.gid[2] = cpu_to_be32(((u32 *)gid->raw)[1]); in bnxt_qplib_add_sgid()
416 req.gid[3] = cpu_to_be32(((u32 *)gid->raw)[0]); in bnxt_qplib_add_sgid()
418 * if RoCE traffic is running on non-zero VLAN ID or in bnxt_qplib_add_sgid()
419 * RoCE traffic is running on non-zero Priority. in bnxt_qplib_add_sgid()
421 if ((vlan_id != 0xFFFF) || res->prio) { in bnxt_qplib_add_sgid()
435 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_add_sgid()
437 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_add_sgid()
440 sgid_tbl->hw_id[free_idx] = le32_to_cpu(resp.xid); in bnxt_qplib_add_sgid()
444 sgid_tbl->vlan[free_idx] = true; in bnxt_qplib_add_sgid()
446 memcpy(&sgid_tbl->tbl[free_idx], gid, sizeof(*gid)); in bnxt_qplib_add_sgid()
447 sgid_tbl->tbl[free_idx].vlan_id = vlan_id; in bnxt_qplib_add_sgid()
448 sgid_tbl->active++; in bnxt_qplib_add_sgid()
449 dev_dbg(&res->pdev->dev, in bnxt_qplib_add_sgid()
451 free_idx, sgid_tbl->hw_id[free_idx], sgid_tbl->active); in bnxt_qplib_add_sgid()
462 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_create_ah()
464 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_create_ah() local
473 memcpy(temp32, ah->dgid.data, sizeof(struct bnxt_qplib_gid)); in bnxt_qplib_create_ah()
479 req.type = ah->nw_type; in bnxt_qplib_create_ah()
480 req.hop_limit = ah->hop_limit; in bnxt_qplib_create_ah()
481 req.sgid_index = cpu_to_le16(res->sgid_tbl.hw_id[ah->sgid_index]); in bnxt_qplib_create_ah()
482 req.dest_vlan_id_flow_label = cpu_to_le32((ah->flow_label & in bnxt_qplib_create_ah()
485 req.pd_id = cpu_to_le32(ah->pd->id); in bnxt_qplib_create_ah()
486 req.traffic_class = ah->traffic_class; in bnxt_qplib_create_ah()
489 memcpy(temp16, ah->dmac, ETH_ALEN); in bnxt_qplib_create_ah()
494 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_create_ah()
496 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_create_ah()
500 ah->id = le32_to_cpu(resp.xid); in bnxt_qplib_create_ah()
502 if (!_is_chip_gen_p5_p7(res->cctx) && !ah->id) in bnxt_qplib_create_ah()
503 rc = -EINVAL; in bnxt_qplib_create_ah()
511 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_destroy_ah()
513 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_destroy_ah() local
520 req.ah_cid = cpu_to_le32(ah->id); in bnxt_qplib_destroy_ah()
522 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_destroy_ah()
524 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_destroy_ah()
532 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_free_mrw()
534 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_free_mrw() local
537 if (mrw->lkey == 0xFFFFFFFF) { in bnxt_qplib_free_mrw()
538 dev_info(&res->pdev->dev, in bnxt_qplib_free_mrw()
546 req.mrw_flags = mrw->type; in bnxt_qplib_free_mrw()
548 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) || in bnxt_qplib_free_mrw()
549 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) || in bnxt_qplib_free_mrw()
550 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B)) in bnxt_qplib_free_mrw()
551 req.key = cpu_to_le32(mrw->rkey); in bnxt_qplib_free_mrw()
553 req.key = cpu_to_le32(mrw->lkey); in bnxt_qplib_free_mrw()
555 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_free_mrw()
557 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_free_mrw()
561 if (mrw->hwq.max_elements) in bnxt_qplib_free_mrw()
562 bnxt_qplib_free_hwq(res, &mrw->hwq); in bnxt_qplib_free_mrw()
569 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_alloc_mrw()
571 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_alloc_mrw() local
578 req.pd_id = cpu_to_le32(mrw->pd->id); in bnxt_qplib_alloc_mrw()
579 req.mrw_flags = mrw->type; in bnxt_qplib_alloc_mrw()
580 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR && in bnxt_qplib_alloc_mrw()
581 mrw->flags & BNXT_QPLIB_FR_PMR) || in bnxt_qplib_alloc_mrw()
582 mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A || in bnxt_qplib_alloc_mrw()
583 mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B) in bnxt_qplib_alloc_mrw()
587 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_alloc_mrw()
589 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_alloc_mrw()
592 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) || in bnxt_qplib_alloc_mrw()
593 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) || in bnxt_qplib_alloc_mrw()
594 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B)) in bnxt_qplib_alloc_mrw()
595 mrw->rkey = le32_to_cpu(resp.xid); in bnxt_qplib_alloc_mrw()
597 mrw->lkey = le32_to_cpu(resp.xid); in bnxt_qplib_alloc_mrw()
605 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_dereg_mrw()
607 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_dereg_mrw() local
614 req.lkey = cpu_to_le32(mrw->lkey); in bnxt_qplib_dereg_mrw()
615 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_dereg_mrw()
617 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_dereg_mrw()
621 if (mrw->hwq.max_elements) { in bnxt_qplib_dereg_mrw()
622 mrw->va = 0; in bnxt_qplib_dereg_mrw()
623 mrw->total_size = 0; in bnxt_qplib_dereg_mrw()
624 bnxt_qplib_free_hwq(res, &mrw->hwq); in bnxt_qplib_dereg_mrw()
635 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_reg_mr()
637 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_reg_mr() local
646 mr = mrinfo->mrw; in bnxt_qplib_reg_mr()
647 buf_pg_size = 0x01ULL << mrinfo->sg.pgshft; in bnxt_qplib_reg_mr()
648 if (mrinfo->sg.npages) { in bnxt_qplib_reg_mr()
650 if (mr->hwq.max_elements) in bnxt_qplib_reg_mr()
651 bnxt_qplib_free_hwq(res, &mr->hwq); in bnxt_qplib_reg_mr()
654 hwq_attr.depth = mrinfo->sg.npages; in bnxt_qplib_reg_mr()
657 hwq_attr.sginfo = &mrinfo->sg; in bnxt_qplib_reg_mr()
658 rc = bnxt_qplib_alloc_init_hwq(&mr->hwq, &hwq_attr); in bnxt_qplib_reg_mr()
660 dev_err(&res->pdev->dev, in bnxt_qplib_reg_mr()
662 return -ENOMEM; in bnxt_qplib_reg_mr()
669 if (mrinfo->is_dma) { in bnxt_qplib_reg_mr()
675 level = mr->hwq.level; in bnxt_qplib_reg_mr()
676 req.pbl = cpu_to_le64(mr->hwq.pbl[PBL_LVL_0].pg_map_arr[0]); in bnxt_qplib_reg_mr()
687 req.access = (mr->flags & 0xFFFF); in bnxt_qplib_reg_mr()
688 req.va = cpu_to_le64(mr->va); in bnxt_qplib_reg_mr()
689 req.key = cpu_to_le32(mr->lkey); in bnxt_qplib_reg_mr()
690 if (_is_alloc_mr_unified(res->dattr)) { in bnxt_qplib_reg_mr()
692 req.key = cpu_to_le32(mr->pd->id); in bnxt_qplib_reg_mr()
696 req.mr_size = cpu_to_le64(mr->total_size); in bnxt_qplib_reg_mr()
698 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_reg_mr()
700 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_reg_mr()
704 if (_is_alloc_mr_unified(res->dattr)) { in bnxt_qplib_reg_mr()
705 mr->lkey = le32_to_cpu(resp.xid); in bnxt_qplib_reg_mr()
706 mr->rkey = mr->lkey; in bnxt_qplib_reg_mr()
711 if (mr->hwq.max_elements) in bnxt_qplib_reg_mr()
712 bnxt_qplib_free_hwq(res, &mr->hwq); in bnxt_qplib_reg_mr()
724 /* Re-calculate the max to fit the HWQ allocation model */ in bnxt_qplib_alloc_fast_reg_page_list()
735 rc = bnxt_qplib_alloc_init_hwq(&frpl->hwq, &hwq_attr); in bnxt_qplib_alloc_fast_reg_page_list()
737 frpl->max_pg_ptrs = pg_ptrs; in bnxt_qplib_alloc_fast_reg_page_list()
745 bnxt_qplib_free_hwq(res, &frpl->hwq); in bnxt_qplib_free_fast_reg_page_list()
750 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_map_tc2cos()
752 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_map_tc2cos() local
761 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_map_tc2cos()
763 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_map_tc2cos()
770 ext_req->modify_mask = cpu_to_le64(cc_ext->ext_mask); in bnxt_qplib_fill_cc_gen1()
771 cc_ext->ext_mask = 0; in bnxt_qplib_fill_cc_gen1()
772 ext_req->inactivity_th_hi = cpu_to_le16(cc_ext->inact_th_hi); in bnxt_qplib_fill_cc_gen1()
773 ext_req->min_time_between_cnps = cpu_to_le16(cc_ext->min_delta_cnp); in bnxt_qplib_fill_cc_gen1()
774 ext_req->init_cp = cpu_to_le16(cc_ext->init_cp); in bnxt_qplib_fill_cc_gen1()
775 ext_req->tr_update_mode = cc_ext->tr_update_mode; in bnxt_qplib_fill_cc_gen1()
776 ext_req->tr_update_cycles = cc_ext->tr_update_cyls; in bnxt_qplib_fill_cc_gen1()
777 ext_req->fr_num_rtts = cc_ext->fr_rtt; in bnxt_qplib_fill_cc_gen1()
778 ext_req->ai_rate_increase = cc_ext->ai_rate_incr; in bnxt_qplib_fill_cc_gen1()
779 ext_req->reduction_relax_rtts_th = cpu_to_le16(cc_ext->rr_rtt_th); in bnxt_qplib_fill_cc_gen1()
780 ext_req->additional_relax_cr_th = cpu_to_le16(cc_ext->ar_cr_th); in bnxt_qplib_fill_cc_gen1()
781 ext_req->cr_min_th = cpu_to_le16(cc_ext->cr_min_th); in bnxt_qplib_fill_cc_gen1()
782 ext_req->bw_avg_weight = cc_ext->bw_avg_weight; in bnxt_qplib_fill_cc_gen1()
783 ext_req->actual_cr_factor = cc_ext->cr_factor; in bnxt_qplib_fill_cc_gen1()
784 ext_req->max_cp_cr_th = cpu_to_le16(cc_ext->cr_th_max_cp); in bnxt_qplib_fill_cc_gen1()
785 ext_req->cp_bias_en = cc_ext->cp_bias_en; in bnxt_qplib_fill_cc_gen1()
786 ext_req->cp_bias = cc_ext->cp_bias; in bnxt_qplib_fill_cc_gen1()
787 ext_req->cnp_ecn = cc_ext->cnp_ecn; in bnxt_qplib_fill_cc_gen1()
788 ext_req->rtt_jitter_en = cc_ext->rtt_jitter_en; in bnxt_qplib_fill_cc_gen1()
789 ext_req->link_bytes_per_usec = cpu_to_le16(cc_ext->bytes_per_usec); in bnxt_qplib_fill_cc_gen1()
790 ext_req->reset_cc_cr_th = cpu_to_le16(cc_ext->cc_cr_reset_th); in bnxt_qplib_fill_cc_gen1()
791 ext_req->cr_width = cc_ext->cr_width; in bnxt_qplib_fill_cc_gen1()
792 ext_req->quota_period_min = cc_ext->min_quota; in bnxt_qplib_fill_cc_gen1()
793 ext_req->quota_period_max = cc_ext->max_quota; in bnxt_qplib_fill_cc_gen1()
794 ext_req->quota_period_abs_max = cc_ext->abs_max_quota; in bnxt_qplib_fill_cc_gen1()
795 ext_req->tr_lower_bound = cpu_to_le16(cc_ext->tr_lb); in bnxt_qplib_fill_cc_gen1()
796 ext_req->cr_prob_factor = cc_ext->cr_prob_fac; in bnxt_qplib_fill_cc_gen1()
797 ext_req->tr_prob_factor = cc_ext->tr_prob_fac; in bnxt_qplib_fill_cc_gen1()
798 ext_req->fairness_cr_th = cpu_to_le16(cc_ext->fair_cr_th); in bnxt_qplib_fill_cc_gen1()
799 ext_req->red_div = cc_ext->red_div; in bnxt_qplib_fill_cc_gen1()
800 ext_req->cnp_ratio_th = cc_ext->cnp_ratio_th; in bnxt_qplib_fill_cc_gen1()
801 ext_req->exp_ai_rtts = cpu_to_le16(cc_ext->ai_ext_rtt); in bnxt_qplib_fill_cc_gen1()
802 ext_req->exp_ai_cr_cp_ratio = cc_ext->exp_crcp_ratio; in bnxt_qplib_fill_cc_gen1()
803 ext_req->use_rate_table = cc_ext->low_rate_en; in bnxt_qplib_fill_cc_gen1()
804 ext_req->cp_exp_update_th = cpu_to_le16(cc_ext->cpcr_update_th); in bnxt_qplib_fill_cc_gen1()
805 ext_req->high_exp_ai_rtts_th1 = cpu_to_le16(cc_ext->ai_rtt_th1); in bnxt_qplib_fill_cc_gen1()
806 ext_req->high_exp_ai_rtts_th2 = cpu_to_le16(cc_ext->ai_rtt_th2); in bnxt_qplib_fill_cc_gen1()
807 ext_req->actual_cr_cong_free_rtts_th = cpu_to_le16(cc_ext->cf_rtt_th); in bnxt_qplib_fill_cc_gen1()
808 ext_req->severe_cong_cr_th1 = cpu_to_le16(cc_ext->sc_cr_th1); in bnxt_qplib_fill_cc_gen1()
809 ext_req->severe_cong_cr_th2 = cpu_to_le16(cc_ext->sc_cr_th2); in bnxt_qplib_fill_cc_gen1()
810 ext_req->link64B_per_rtt = cpu_to_le32(cc_ext->l64B_per_rtt); in bnxt_qplib_fill_cc_gen1()
811 ext_req->cc_ack_bytes = cc_ext->cc_ack_bytes; in bnxt_qplib_fill_cc_gen1()
812 ext_req->reduce_init_cong_free_rtts_th = cpu_to_le16(cc_ext->reduce_cf_rtt_th); in bnxt_qplib_fill_cc_gen1()
820 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_modify_cc() local
832 req->modify_mask = cpu_to_le32(cc_param->mask); in bnxt_qplib_modify_cc()
833 req->enable_cc = cc_param->enable; in bnxt_qplib_modify_cc()
834 req->g = cc_param->g; in bnxt_qplib_modify_cc()
835 req->num_phases_per_state = cc_param->nph_per_state; in bnxt_qplib_modify_cc()
836 req->time_per_phase = cc_param->time_pph; in bnxt_qplib_modify_cc()
837 req->pkts_per_phase = cc_param->pkts_pph; in bnxt_qplib_modify_cc()
838 req->init_cr = cpu_to_le16(cc_param->init_cr); in bnxt_qplib_modify_cc()
839 req->init_tr = cpu_to_le16(cc_param->init_tr); in bnxt_qplib_modify_cc()
840 req->tos_dscp_tos_ecn = (cc_param->tos_dscp << in bnxt_qplib_modify_cc()
842 (cc_param->tos_ecn & in bnxt_qplib_modify_cc()
844 req->alt_vlan_pcp = cc_param->alt_vlan_pcp; in bnxt_qplib_modify_cc()
845 req->alt_tos_dscp = cpu_to_le16(cc_param->alt_tos_dscp); in bnxt_qplib_modify_cc()
846 req->rtt = cpu_to_le16(cc_param->rtt); in bnxt_qplib_modify_cc()
847 req->tcp_cp = cpu_to_le16(cc_param->tcp_cp); in bnxt_qplib_modify_cc()
848 req->cc_mode = cc_param->cc_mode; in bnxt_qplib_modify_cc()
849 req->inactivity_th = cpu_to_le16(cc_param->inact_th); in bnxt_qplib_modify_cc()
852 if (_is_chip_gen_p5_p7(res->cctx)) { in bnxt_qplib_modify_cc()
866 payload = sizeof(struct cmdq_modify_roce_cc_gen1_tlv) - in bnxt_qplib_modify_cc()
870 bnxt_qplib_fill_cc_gen1(&tlv_req.ext_req, &cc_param->cc_ext); in bnxt_qplib_modify_cc()
873 bnxt_qplib_fill_cmdqmsg(&msg, cmd, &resp, NULL, req_size, in bnxt_qplib_modify_cc()
875 rc = bnxt_qplib_rcfw_send_message(res->rcfw, &msg); in bnxt_qplib_modify_cc()
882 cc_ext->inact_th_hi = le16_to_cpu(sb->inactivity_th_hi); in bnxt_qplib_read_cc_gen1()
883 cc_ext->min_delta_cnp = le16_to_cpu(sb->min_time_between_cnps); in bnxt_qplib_read_cc_gen1()
884 cc_ext->init_cp = le16_to_cpu(sb->init_cp); in bnxt_qplib_read_cc_gen1()
885 cc_ext->tr_update_mode = sb->tr_update_mode; in bnxt_qplib_read_cc_gen1()
886 cc_ext->tr_update_cyls = sb->tr_update_cycles; in bnxt_qplib_read_cc_gen1()
887 cc_ext->fr_rtt = sb->fr_num_rtts; in bnxt_qplib_read_cc_gen1()
888 cc_ext->ai_rate_incr = sb->ai_rate_increase; in bnxt_qplib_read_cc_gen1()
889 cc_ext->rr_rtt_th = le16_to_cpu(sb->reduction_relax_rtts_th); in bnxt_qplib_read_cc_gen1()
890 cc_ext->ar_cr_th = le16_to_cpu(sb->additional_relax_cr_th); in bnxt_qplib_read_cc_gen1()
891 cc_ext->cr_min_th = le16_to_cpu(sb->cr_min_th); in bnxt_qplib_read_cc_gen1()
892 cc_ext->bw_avg_weight = sb->bw_avg_weight; in bnxt_qplib_read_cc_gen1()
893 cc_ext->cr_factor = sb->actual_cr_factor; in bnxt_qplib_read_cc_gen1()
894 cc_ext->cr_th_max_cp = le16_to_cpu(sb->max_cp_cr_th); in bnxt_qplib_read_cc_gen1()
895 cc_ext->cp_bias_en = sb->cp_bias_en; in bnxt_qplib_read_cc_gen1()
896 cc_ext->cp_bias = sb->cp_bias; in bnxt_qplib_read_cc_gen1()
897 cc_ext->cnp_ecn = sb->cnp_ecn; in bnxt_qplib_read_cc_gen1()
898 cc_ext->rtt_jitter_en = sb->rtt_jitter_en; in bnxt_qplib_read_cc_gen1()
899 cc_ext->bytes_per_usec = le16_to_cpu(sb->link_bytes_per_usec); in bnxt_qplib_read_cc_gen1()
900 cc_ext->cc_cr_reset_th = le16_to_cpu(sb->reset_cc_cr_th); in bnxt_qplib_read_cc_gen1()
901 cc_ext->cr_width = sb->cr_width; in bnxt_qplib_read_cc_gen1()
902 cc_ext->min_quota = sb->quota_period_min; in bnxt_qplib_read_cc_gen1()
903 cc_ext->max_quota = sb->quota_period_max; in bnxt_qplib_read_cc_gen1()
904 cc_ext->abs_max_quota = sb->quota_period_abs_max; in bnxt_qplib_read_cc_gen1()
905 cc_ext->tr_lb = le16_to_cpu(sb->tr_lower_bound); in bnxt_qplib_read_cc_gen1()
906 cc_ext->cr_prob_fac = sb->cr_prob_factor; in bnxt_qplib_read_cc_gen1()
907 cc_ext->tr_prob_fac = sb->tr_prob_factor; in bnxt_qplib_read_cc_gen1()
908 cc_ext->fair_cr_th = le16_to_cpu(sb->fairness_cr_th); in bnxt_qplib_read_cc_gen1()
909 cc_ext->red_div = sb->red_div; in bnxt_qplib_read_cc_gen1()
910 cc_ext->cnp_ratio_th = sb->cnp_ratio_th; in bnxt_qplib_read_cc_gen1()
911 cc_ext->ai_ext_rtt = le16_to_cpu(sb->exp_ai_rtts); in bnxt_qplib_read_cc_gen1()
912 cc_ext->exp_crcp_ratio = sb->exp_ai_cr_cp_ratio; in bnxt_qplib_read_cc_gen1()
913 cc_ext->low_rate_en = sb->use_rate_table; in bnxt_qplib_read_cc_gen1()
914 cc_ext->cpcr_update_th = le16_to_cpu(sb->cp_exp_update_th); in bnxt_qplib_read_cc_gen1()
915 cc_ext->ai_rtt_th1 = le16_to_cpu(sb->high_exp_ai_rtts_th1); in bnxt_qplib_read_cc_gen1()
916 cc_ext->ai_rtt_th2 = le16_to_cpu(sb->high_exp_ai_rtts_th2); in bnxt_qplib_read_cc_gen1()
917 cc_ext->cf_rtt_th = le16_to_cpu(sb->actual_cr_cong_free_rtts_th); in bnxt_qplib_read_cc_gen1()
918 cc_ext->sc_cr_th1 = le16_to_cpu(sb->severe_cong_cr_th1); in bnxt_qplib_read_cc_gen1()
919 cc_ext->sc_cr_th2 = le16_to_cpu(sb->severe_cong_cr_th2); in bnxt_qplib_read_cc_gen1()
920 cc_ext->l64B_per_rtt = le32_to_cpu(sb->link64B_per_rtt); in bnxt_qplib_read_cc_gen1()
921 cc_ext->cc_ack_bytes = sb->cc_ack_bytes; in bnxt_qplib_read_cc_gen1()
922 cc_ext->reduce_cf_rtt_th = le16_to_cpu(sb->reduce_init_cong_free_rtts_th); in bnxt_qplib_read_cc_gen1()
930 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_query_cc_param()
933 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_query_cc_param() local
942 if (_is_chip_gen_p5_p7(res->cctx)) in bnxt_qplib_query_cc_param()
947 sbuf.sb = dma_zalloc_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_query_cc_param()
950 return -ENOMEM; in bnxt_qplib_query_cc_param()
953 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, &sbuf, sizeof(req), in bnxt_qplib_query_cc_param()
955 rc = bnxt_qplib_rcfw_send_message(res->rcfw, &msg); in bnxt_qplib_query_cc_param()
957 dev_dbg(&res->pdev->dev, "%s:Query CC param failed:0x%x\n", in bnxt_qplib_query_cc_param()
963 gen1_sb = &ext_sb->gen1_sb; in bnxt_qplib_query_cc_param()
964 sb = _is_chip_gen_p5_p7(res->cctx) ? &ext_sb->base_sb : in bnxt_qplib_query_cc_param()
967 cc_param->enable = sb->enable_cc & CREQ_QUERY_ROCE_CC_RESP_SB_ENABLE_CC; in bnxt_qplib_query_cc_param()
968 cc_param->tos_ecn = (sb->tos_dscp_tos_ecn & in bnxt_qplib_query_cc_param()
971 cc_param->tos_dscp = (sb->tos_dscp_tos_ecn & in bnxt_qplib_query_cc_param()
974 cc_param->alt_tos_dscp = sb->alt_tos_dscp; in bnxt_qplib_query_cc_param()
975 cc_param->alt_vlan_pcp = sb->alt_vlan_pcp; in bnxt_qplib_query_cc_param()
977 cc_param->g = sb->g; in bnxt_qplib_query_cc_param()
978 cc_param->nph_per_state = sb->num_phases_per_state; in bnxt_qplib_query_cc_param()
979 cc_param->init_cr = le16_to_cpu(sb->init_cr); in bnxt_qplib_query_cc_param()
980 cc_param->init_tr = le16_to_cpu(sb->init_tr); in bnxt_qplib_query_cc_param()
981 cc_param->cc_mode = sb->cc_mode; in bnxt_qplib_query_cc_param()
982 cc_param->inact_th = le16_to_cpu(sb->inactivity_th); in bnxt_qplib_query_cc_param()
983 cc_param->rtt = le16_to_cpu(sb->rtt); in bnxt_qplib_query_cc_param()
984 cc_param->tcp_cp = le16_to_cpu(sb->tcp_cp); in bnxt_qplib_query_cc_param()
985 cc_param->time_pph = sb->time_per_phase; in bnxt_qplib_query_cc_param()
986 cc_param->pkts_pph = sb->pkts_per_phase; in bnxt_qplib_query_cc_param()
987 if (_is_chip_gen_p5_p7(res->cctx)) in bnxt_qplib_query_cc_param()
988 bnxt_qplib_read_cc_gen1(&cc_param->cc_ext, gen1_sb); in bnxt_qplib_query_cc_param()
990 dma_free_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_query_cc_param()
1003 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_get_roce_error_stats() local
1013 sbuf.sb = dma_zalloc_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_get_roce_error_stats()
1016 return -ENOMEM; in bnxt_qplib_get_roce_error_stats()
1019 if (rcfw->res->cctx->hwrm_intf_ver >= HWRM_VERSION_ROCE_STATS_FN_ID) { in bnxt_qplib_get_roce_error_stats()
1020 if (sinfo->function_id != 0xFFFFFFFF) { in bnxt_qplib_get_roce_error_stats()
1022 if (sinfo->vf_valid) { in bnxt_qplib_get_roce_error_stats()
1024 fn_id |= (sinfo->function_id << in bnxt_qplib_get_roce_error_stats()
1028 fn_id = sinfo->function_id & in bnxt_qplib_get_roce_error_stats()
1036 if (sinfo->collection_id != 0xFF) { in bnxt_qplib_get_roce_error_stats()
1038 req.collection_id = sinfo->collection_id; in bnxt_qplib_get_roce_error_stats()
1047 req.cmd_size -= 8; in bnxt_qplib_get_roce_error_stats()
1051 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, &sbuf, sizeof(req), in bnxt_qplib_get_roce_error_stats()
1053 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_get_roce_error_stats()
1057 stats->to_retransmits = le64_to_cpu(sb->to_retransmits); in bnxt_qplib_get_roce_error_stats()
1058 stats->seq_err_naks_rcvd = le64_to_cpu(sb->seq_err_naks_rcvd); in bnxt_qplib_get_roce_error_stats()
1059 stats->max_retry_exceeded = le64_to_cpu(sb->max_retry_exceeded); in bnxt_qplib_get_roce_error_stats()
1060 stats->rnr_naks_rcvd = le64_to_cpu(sb->rnr_naks_rcvd); in bnxt_qplib_get_roce_error_stats()
1061 stats->missing_resp = le64_to_cpu(sb->missing_resp); in bnxt_qplib_get_roce_error_stats()
1062 stats->unrecoverable_err = le64_to_cpu(sb->unrecoverable_err); in bnxt_qplib_get_roce_error_stats()
1063 stats->bad_resp_err = le64_to_cpu(sb->bad_resp_err); in bnxt_qplib_get_roce_error_stats()
1064 stats->local_qp_op_err = le64_to_cpu(sb->local_qp_op_err); in bnxt_qplib_get_roce_error_stats()
1065 stats->local_protection_err = le64_to_cpu(sb->local_protection_err); in bnxt_qplib_get_roce_error_stats()
1066 stats->mem_mgmt_op_err = le64_to_cpu(sb->mem_mgmt_op_err); in bnxt_qplib_get_roce_error_stats()
1067 stats->remote_invalid_req_err = le64_to_cpu(sb->remote_invalid_req_err); in bnxt_qplib_get_roce_error_stats()
1068 stats->remote_access_err = le64_to_cpu(sb->remote_access_err); in bnxt_qplib_get_roce_error_stats()
1069 stats->remote_op_err = le64_to_cpu(sb->remote_op_err); in bnxt_qplib_get_roce_error_stats()
1070 stats->dup_req = le64_to_cpu(sb->dup_req); in bnxt_qplib_get_roce_error_stats()
1071 stats->res_exceed_max = le64_to_cpu(sb->res_exceed_max); in bnxt_qplib_get_roce_error_stats()
1072 stats->res_length_mismatch = le64_to_cpu(sb->res_length_mismatch); in bnxt_qplib_get_roce_error_stats()
1073 stats->res_exceeds_wqe = le64_to_cpu(sb->res_exceeds_wqe); in bnxt_qplib_get_roce_error_stats()
1074 stats->res_opcode_err = le64_to_cpu(sb->res_opcode_err); in bnxt_qplib_get_roce_error_stats()
1075 stats->res_rx_invalid_rkey = le64_to_cpu(sb->res_rx_invalid_rkey); in bnxt_qplib_get_roce_error_stats()
1076 stats->res_rx_domain_err = le64_to_cpu(sb->res_rx_domain_err); in bnxt_qplib_get_roce_error_stats()
1077 stats->res_rx_no_perm = le64_to_cpu(sb->res_rx_no_perm); in bnxt_qplib_get_roce_error_stats()
1078 stats->res_rx_range_err = le64_to_cpu(sb->res_rx_range_err); in bnxt_qplib_get_roce_error_stats()
1079 stats->res_tx_invalid_rkey = le64_to_cpu(sb->res_tx_invalid_rkey); in bnxt_qplib_get_roce_error_stats()
1080 stats->res_tx_domain_err = le64_to_cpu(sb->res_tx_domain_err); in bnxt_qplib_get_roce_error_stats()
1081 stats->res_tx_no_perm = le64_to_cpu(sb->res_tx_no_perm); in bnxt_qplib_get_roce_error_stats()
1082 stats->res_tx_range_err = le64_to_cpu(sb->res_tx_range_err); in bnxt_qplib_get_roce_error_stats()
1083 stats->res_irrq_oflow = le64_to_cpu(sb->res_irrq_oflow); in bnxt_qplib_get_roce_error_stats()
1084 stats->res_unsup_opcode = le64_to_cpu(sb->res_unsup_opcode); in bnxt_qplib_get_roce_error_stats()
1085 stats->res_unaligned_atomic = le64_to_cpu(sb->res_unaligned_atomic); in bnxt_qplib_get_roce_error_stats()
1086 stats->res_rem_inv_err = le64_to_cpu(sb->res_rem_inv_err); in bnxt_qplib_get_roce_error_stats()
1087 stats->res_mem_error = le64_to_cpu(sb->res_mem_error); in bnxt_qplib_get_roce_error_stats()
1088 stats->res_srq_err = le64_to_cpu(sb->res_srq_err); in bnxt_qplib_get_roce_error_stats()
1089 stats->res_cmp_err = le64_to_cpu(sb->res_cmp_err); in bnxt_qplib_get_roce_error_stats()
1090 stats->res_invalid_dup_rkey = le64_to_cpu(sb->res_invalid_dup_rkey); in bnxt_qplib_get_roce_error_stats()
1091 stats->res_wqe_format_err = le64_to_cpu(sb->res_wqe_format_err); in bnxt_qplib_get_roce_error_stats()
1092 stats->res_cq_load_err = le64_to_cpu(sb->res_cq_load_err); in bnxt_qplib_get_roce_error_stats()
1093 stats->res_srq_load_err = le64_to_cpu(sb->res_srq_load_err); in bnxt_qplib_get_roce_error_stats()
1094 stats->res_tx_pci_err = le64_to_cpu(sb->res_tx_pci_err); in bnxt_qplib_get_roce_error_stats()
1095 stats->res_rx_pci_err = le64_to_cpu(sb->res_rx_pci_err); in bnxt_qplib_get_roce_error_stats()
1097 if (!rcfw->init_oos_stats) { in bnxt_qplib_get_roce_error_stats()
1098 rcfw->oos_prev = le64_to_cpu(sb->res_oos_drop_count); in bnxt_qplib_get_roce_error_stats()
1099 rcfw->init_oos_stats = true; in bnxt_qplib_get_roce_error_stats()
1101 stats->res_oos_drop_count += (le64_to_cpu(sb->res_oos_drop_count) - in bnxt_qplib_get_roce_error_stats()
1102 rcfw->oos_prev) & in bnxt_qplib_get_roce_error_stats()
1104 rcfw->oos_prev = le64_to_cpu(sb->res_oos_drop_count); in bnxt_qplib_get_roce_error_stats()
1107 stats->active_qp_count_p0 = le64_to_cpu(sb->active_qp_count_p0); in bnxt_qplib_get_roce_error_stats()
1108 stats->active_qp_count_p1 = le64_to_cpu(sb->active_qp_count_p1); in bnxt_qplib_get_roce_error_stats()
1109 stats->active_qp_count_p2 = le64_to_cpu(sb->active_qp_count_p2); in bnxt_qplib_get_roce_error_stats()
1110 stats->active_qp_count_p3 = le64_to_cpu(sb->active_qp_count_p3); in bnxt_qplib_get_roce_error_stats()
1112 dma_free_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_get_roce_error_stats()
1124 struct bnxt_qplib_rcfw *rcfw = res->rcfw; in bnxt_qplib_set_link_aggr_mode()
1125 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_set_link_aggr_mode() local
1146 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), in bnxt_qplib_set_link_aggr_mode()
1148 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_set_link_aggr_mode()
1150 dev_err(&res->pdev->dev, in bnxt_qplib_set_link_aggr_mode()
1163 struct bnxt_qplib_cmdqmsg msg = {}; in bnxt_qplib_qext_stat() local
1168 sbuf.sb = dma_zalloc_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_qext_stat()
1171 dev_err(&rcfw->pdev->dev, in bnxt_qplib_qext_stat()
1173 return -ENOMEM; in bnxt_qplib_qext_stat()
1183 if (_is_chip_p7(rcfw->res->cctx) && rcfw->res->is_vf) { in bnxt_qplib_qext_stat()
1184 if (sinfo->vf_valid) in bnxt_qplib_qext_stat()
1194 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, &sbuf, sizeof(req), in bnxt_qplib_qext_stat()
1196 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); in bnxt_qplib_qext_stat()
1202 estat->tx_atomic_req = le64_to_cpu(sb->tx_atomic_req_pkts); in bnxt_qplib_qext_stat()
1203 estat->tx_read_req = le64_to_cpu(sb->tx_read_req_pkts); in bnxt_qplib_qext_stat()
1204 estat->tx_read_res = le64_to_cpu(sb->tx_read_res_pkts); in bnxt_qplib_qext_stat()
1205 estat->tx_write_req = le64_to_cpu(sb->tx_write_req_pkts); in bnxt_qplib_qext_stat()
1206 estat->tx_send_req = le64_to_cpu(sb->tx_send_req_pkts); in bnxt_qplib_qext_stat()
1207 estat->tx_roce_pkts = le64_to_cpu(sb->tx_roce_pkts); in bnxt_qplib_qext_stat()
1208 estat->tx_roce_bytes = le64_to_cpu(sb->tx_roce_bytes); in bnxt_qplib_qext_stat()
1209 estat->rx_atomic_req = le64_to_cpu(sb->rx_atomic_req_pkts); in bnxt_qplib_qext_stat()
1210 estat->rx_read_req = le64_to_cpu(sb->rx_read_req_pkts); in bnxt_qplib_qext_stat()
1211 estat->rx_read_res = le64_to_cpu(sb->rx_read_res_pkts); in bnxt_qplib_qext_stat()
1212 estat->rx_write_req = le64_to_cpu(sb->rx_write_req_pkts); in bnxt_qplib_qext_stat()
1213 estat->rx_send_req = le64_to_cpu(sb->rx_send_req_pkts); in bnxt_qplib_qext_stat()
1214 estat->rx_roce_pkts = le64_to_cpu(sb->rx_roce_pkts); in bnxt_qplib_qext_stat()
1215 estat->rx_roce_bytes = le64_to_cpu(sb->rx_roce_bytes); in bnxt_qplib_qext_stat()
1216 estat->rx_roce_good_pkts = le64_to_cpu(sb->rx_roce_good_pkts); in bnxt_qplib_qext_stat()
1217 estat->rx_roce_good_bytes = le64_to_cpu(sb->rx_roce_good_bytes); in bnxt_qplib_qext_stat()
1218 estat->rx_out_of_buffer = le64_to_cpu(sb->rx_out_of_buffer_pkts); in bnxt_qplib_qext_stat()
1219 estat->rx_out_of_sequence = le64_to_cpu(sb->rx_out_of_sequence_pkts); in bnxt_qplib_qext_stat()
1220 estat->tx_cnp = le64_to_cpu(sb->tx_cnp_pkts); in bnxt_qplib_qext_stat()
1221 estat->rx_cnp = le64_to_cpu(sb->rx_cnp_pkts); in bnxt_qplib_qext_stat()
1222 estat->rx_ecn_marked = le64_to_cpu(sb->rx_ecn_marked_pkts); in bnxt_qplib_qext_stat()
1223 estat->seq_err_naks_rcvd = le64_to_cpu(sb->seq_err_naks_rcvd); in bnxt_qplib_qext_stat()
1224 estat->rnr_naks_rcvd = le64_to_cpu(sb->rnr_naks_rcvd); in bnxt_qplib_qext_stat()
1225 estat->missing_resp = le64_to_cpu(sb->missing_resp); in bnxt_qplib_qext_stat()
1226 estat->to_retransmits = le64_to_cpu(sb->to_retransmit); in bnxt_qplib_qext_stat()
1227 estat->dup_req = le64_to_cpu(sb->dup_req); in bnxt_qplib_qext_stat()
1228 estat->rx_dcn_payload_cut = le64_to_cpu(sb->rx_dcn_payload_cut); in bnxt_qplib_qext_stat()
1229 estat->te_bypassed = le64_to_cpu(sb->te_bypassed); in bnxt_qplib_qext_stat()
1231 dma_free_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_qext_stat()