Lines Matching refs:srq

81 	if (!qp->srq) {  in __bnxt_qplib_add_flush_qp()
128 if (!qp->srq) { in __bnxt_qplib_del_flush_qp()
353 struct bnxt_qplib_srq *srq; in bnxt_qplib_service_nq() local
360 srq = (struct bnxt_qplib_srq *)q_handle; in bnxt_qplib_service_nq()
361 bnxt_qplib_armen_db(&srq->dbinfo, in bnxt_qplib_service_nq()
580 struct bnxt_qplib_srq *srq) in bnxt_qplib_destroy_srq() argument
591 req.srq_cid = cpu_to_le32(srq->id); in bnxt_qplib_destroy_srq()
595 kfree(srq->swq); in bnxt_qplib_destroy_srq()
598 bnxt_qplib_free_hwq(res, &srq->hwq); in bnxt_qplib_destroy_srq()
602 struct bnxt_qplib_srq *srq) in bnxt_qplib_create_srq() argument
614 hwq_attr.sginfo = &srq->sg_info; in bnxt_qplib_create_srq()
615 hwq_attr.depth = srq->max_wqe; in bnxt_qplib_create_srq()
616 hwq_attr.stride = srq->wqe_size; in bnxt_qplib_create_srq()
618 rc = bnxt_qplib_alloc_init_hwq(&srq->hwq, &hwq_attr); in bnxt_qplib_create_srq()
622 srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq), in bnxt_qplib_create_srq()
624 if (!srq->swq) { in bnxt_qplib_create_srq()
632 req.dpi = cpu_to_le32(srq->dpi->dpi); in bnxt_qplib_create_srq()
633 req.srq_handle = cpu_to_le64((uintptr_t)srq); in bnxt_qplib_create_srq()
635 req.srq_size = cpu_to_le16((u16)srq->hwq.max_elements); in bnxt_qplib_create_srq()
636 pbl = &srq->hwq.pbl[PBL_LVL_0]; in bnxt_qplib_create_srq()
637 pg_sz_lvl = ((u16)bnxt_qplib_base_pg_size(&srq->hwq) << in bnxt_qplib_create_srq()
639 pg_sz_lvl |= (srq->hwq.level & CMDQ_CREATE_SRQ_LVL_MASK) << in bnxt_qplib_create_srq()
643 req.pd_id = cpu_to_le32(srq->pd->id); in bnxt_qplib_create_srq()
644 req.eventq_id = cpu_to_le16(srq->eventq_hw_ring_id); in bnxt_qplib_create_srq()
651 spin_lock_init(&srq->lock); in bnxt_qplib_create_srq()
652 srq->start_idx = 0; in bnxt_qplib_create_srq()
653 srq->last_idx = srq->hwq.max_elements - 1; in bnxt_qplib_create_srq()
654 for (idx = 0; idx < srq->hwq.max_elements; idx++) in bnxt_qplib_create_srq()
655 srq->swq[idx].next_idx = idx + 1; in bnxt_qplib_create_srq()
656 srq->swq[srq->last_idx].next_idx = -1; in bnxt_qplib_create_srq()
658 srq->id = le32_to_cpu(resp.xid); in bnxt_qplib_create_srq()
659 srq->dbinfo.hwq = &srq->hwq; in bnxt_qplib_create_srq()
660 srq->dbinfo.xid = srq->id; in bnxt_qplib_create_srq()
661 srq->dbinfo.db = srq->dpi->dbr; in bnxt_qplib_create_srq()
662 srq->dbinfo.max_slot = 1; in bnxt_qplib_create_srq()
663 srq->dbinfo.priv_db = res->dpi_tbl.dbr_bar_reg_iomem; in bnxt_qplib_create_srq()
664 if (srq->threshold) in bnxt_qplib_create_srq()
665 bnxt_qplib_armen_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ_ARMENA); in bnxt_qplib_create_srq()
666 srq->arm_req = false; in bnxt_qplib_create_srq()
670 bnxt_qplib_free_hwq(res, &srq->hwq); in bnxt_qplib_create_srq()
671 kfree(srq->swq); in bnxt_qplib_create_srq()
677 struct bnxt_qplib_srq *srq) in bnxt_qplib_modify_srq() argument
679 struct bnxt_qplib_hwq *srq_hwq = &srq->hwq; in bnxt_qplib_modify_srq()
687 if (count > srq->threshold) { in bnxt_qplib_modify_srq()
688 srq->arm_req = false; in bnxt_qplib_modify_srq()
689 bnxt_qplib_srq_arm_db(&srq->dbinfo, srq->threshold); in bnxt_qplib_modify_srq()
692 srq->arm_req = true; in bnxt_qplib_modify_srq()
699 struct bnxt_qplib_srq *srq) in bnxt_qplib_query_srq() argument
716 req.srq_cid = cpu_to_le32(srq->id); in bnxt_qplib_query_srq()
720 srq->threshold = le16_to_cpu(sb->srq_limit); in bnxt_qplib_query_srq()
726 int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq, in bnxt_qplib_post_srq_recv() argument
729 struct bnxt_qplib_hwq *srq_hwq = &srq->hwq; in bnxt_qplib_post_srq_recv()
736 if (srq->start_idx == srq->last_idx) { in bnxt_qplib_post_srq_recv()
738 "FP: SRQ (0x%x) is full!\n", srq->id); in bnxt_qplib_post_srq_recv()
743 next = srq->start_idx; in bnxt_qplib_post_srq_recv()
744 srq->start_idx = srq->swq[next].next_idx; in bnxt_qplib_post_srq_recv()
749 memset(srqe, 0, srq->wqe_size); in bnxt_qplib_post_srq_recv()
762 srq->swq[next].wr_id = wqe->wr_id; in bnxt_qplib_post_srq_recv()
777 bnxt_qplib_ring_prod_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ); in bnxt_qplib_post_srq_recv()
778 if (srq->arm_req == true && count > srq->threshold) { in bnxt_qplib_post_srq_recv()
779 srq->arm_req = false; in bnxt_qplib_post_srq_recv()
780 bnxt_qplib_srq_arm_db(&srq->dbinfo, srq->threshold); in bnxt_qplib_post_srq_recv()
1012 if (!qp->srq) { in bnxt_qplib_create_qp()
1043 req.srq_cid = cpu_to_le32(qp->srq->id); in bnxt_qplib_create_qp()
2423 static void bnxt_qplib_release_srqe(struct bnxt_qplib_srq *srq, u32 tag) in bnxt_qplib_release_srqe() argument
2425 spin_lock(&srq->hwq.lock); in bnxt_qplib_release_srqe()
2426 srq->swq[srq->last_idx].next_idx = (int)tag; in bnxt_qplib_release_srqe()
2427 srq->last_idx = (int)tag; in bnxt_qplib_release_srqe()
2428 srq->swq[srq->last_idx].next_idx = -1; in bnxt_qplib_release_srqe()
2429 srq->hwq.cons++; /* Support for SRQE counter */ in bnxt_qplib_release_srqe()
2430 spin_unlock(&srq->hwq.lock); in bnxt_qplib_release_srqe()
2438 struct bnxt_qplib_srq *srq; in bnxt_qplib_cq_process_res_rc() local
2469 srq = qp->srq; in bnxt_qplib_cq_process_res_rc()
2470 if (!srq) in bnxt_qplib_cq_process_res_rc()
2472 if (wr_id_idx >= srq->hwq.max_elements) { in bnxt_qplib_cq_process_res_rc()
2475 wr_id_idx, srq->hwq.max_elements); in bnxt_qplib_cq_process_res_rc()
2478 cqe->wr_id = srq->swq[wr_id_idx].wr_id; in bnxt_qplib_cq_process_res_rc()
2479 bnxt_qplib_release_srqe(srq, wr_id_idx); in bnxt_qplib_cq_process_res_rc()
2519 struct bnxt_qplib_srq *srq; in bnxt_qplib_cq_process_res_ud() local
2555 srq = qp->srq; in bnxt_qplib_cq_process_res_ud()
2556 if (!srq) in bnxt_qplib_cq_process_res_ud()
2559 if (wr_id_idx >= srq->hwq.max_elements) { in bnxt_qplib_cq_process_res_ud()
2562 wr_id_idx, srq->hwq.max_elements); in bnxt_qplib_cq_process_res_ud()
2565 cqe->wr_id = srq->swq[wr_id_idx].wr_id; in bnxt_qplib_cq_process_res_ud()
2566 bnxt_qplib_release_srqe(srq, wr_id_idx); in bnxt_qplib_cq_process_res_ud()
2622 struct bnxt_qplib_srq *srq; in bnxt_qplib_cq_process_res_raweth_qp1() local
2661 srq = qp->srq; in bnxt_qplib_cq_process_res_raweth_qp1()
2662 if (!srq) { in bnxt_qplib_cq_process_res_raweth_qp1()
2667 if (wr_id_idx >= srq->hwq.max_elements) { in bnxt_qplib_cq_process_res_raweth_qp1()
2670 wr_id_idx, srq->hwq.max_elements); in bnxt_qplib_cq_process_res_raweth_qp1()
2673 cqe->wr_id = srq->swq[wr_id_idx].wr_id; in bnxt_qplib_cq_process_res_raweth_qp1()
2674 bnxt_qplib_release_srqe(srq, wr_id_idx); in bnxt_qplib_cq_process_res_raweth_qp1()