Lines Matching refs:srq

82 	if (!qp->srq) {  in __bnxt_qplib_add_flush_qp()
129 if (!qp->srq) { in __bnxt_qplib_del_flush_qp()
346 struct bnxt_qplib_srq *srq; in bnxt_qplib_service_nq() local
353 srq = (struct bnxt_qplib_srq *)q_handle; in bnxt_qplib_service_nq()
354 bnxt_qplib_armen_db(&srq->dbinfo, in bnxt_qplib_service_nq()
599 struct bnxt_qplib_srq *srq) in bnxt_qplib_destroy_srq() argument
612 req.srq_cid = cpu_to_le32(srq->id); in bnxt_qplib_destroy_srq()
616 kfree(srq->swq); in bnxt_qplib_destroy_srq()
619 bnxt_qplib_free_hwq(res, &srq->hwq); in bnxt_qplib_destroy_srq()
623 struct bnxt_qplib_srq *srq) in bnxt_qplib_create_srq() argument
635 hwq_attr.sginfo = &srq->sg_info; in bnxt_qplib_create_srq()
636 hwq_attr.depth = srq->max_wqe; in bnxt_qplib_create_srq()
637 hwq_attr.stride = srq->wqe_size; in bnxt_qplib_create_srq()
639 rc = bnxt_qplib_alloc_init_hwq(&srq->hwq, &hwq_attr); in bnxt_qplib_create_srq()
642 srq->dbinfo.flags = 0; in bnxt_qplib_create_srq()
648 req.dpi = cpu_to_le32(srq->dpi->dpi); in bnxt_qplib_create_srq()
649 req.srq_handle = cpu_to_le64((uintptr_t)srq); in bnxt_qplib_create_srq()
651 req.srq_size = cpu_to_le16((u16)srq->hwq.max_elements); in bnxt_qplib_create_srq()
652 pbl = &srq->hwq.pbl[PBL_LVL_0]; in bnxt_qplib_create_srq()
653 pg_sz_lvl = ((u16)bnxt_qplib_base_pg_size(&srq->hwq) << in bnxt_qplib_create_srq()
655 pg_sz_lvl |= (srq->hwq.level & CMDQ_CREATE_SRQ_LVL_MASK) << in bnxt_qplib_create_srq()
659 req.pd_id = cpu_to_le32(srq->pd->id); in bnxt_qplib_create_srq()
660 req.eventq_id = cpu_to_le16(srq->eventq_hw_ring_id); in bnxt_qplib_create_srq()
667 spin_lock_init(&srq->lock); in bnxt_qplib_create_srq()
668 srq->start_idx = 0; in bnxt_qplib_create_srq()
669 srq->last_idx = srq->hwq.max_elements - 1; in bnxt_qplib_create_srq()
670 if (!srq->hwq.is_user) { in bnxt_qplib_create_srq()
671 srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq), in bnxt_qplib_create_srq()
673 if (!srq->swq) { in bnxt_qplib_create_srq()
677 for (idx = 0; idx < srq->hwq.max_elements; idx++) in bnxt_qplib_create_srq()
678 srq->swq[idx].next_idx = idx + 1; in bnxt_qplib_create_srq()
679 srq->swq[srq->last_idx].next_idx = -1; in bnxt_qplib_create_srq()
682 srq->id = le32_to_cpu(resp.xid); in bnxt_qplib_create_srq()
683 srq->dbinfo.hwq = &srq->hwq; in bnxt_qplib_create_srq()
684 srq->dbinfo.xid = srq->id; in bnxt_qplib_create_srq()
685 srq->dbinfo.db = srq->dpi->dbr; in bnxt_qplib_create_srq()
686 srq->dbinfo.max_slot = 1; in bnxt_qplib_create_srq()
687 srq->dbinfo.priv_db = res->dpi_tbl.priv_db; in bnxt_qplib_create_srq()
688 if (srq->threshold) in bnxt_qplib_create_srq()
689 bnxt_qplib_armen_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ_ARMENA); in bnxt_qplib_create_srq()
690 srq->arm_req = false; in bnxt_qplib_create_srq()
694 bnxt_qplib_free_hwq(res, &srq->hwq); in bnxt_qplib_create_srq()
695 kfree(srq->swq); in bnxt_qplib_create_srq()
701 struct bnxt_qplib_srq *srq) in bnxt_qplib_modify_srq() argument
703 struct bnxt_qplib_hwq *srq_hwq = &srq->hwq; in bnxt_qplib_modify_srq()
707 if (count > srq->threshold) { in bnxt_qplib_modify_srq()
708 srq->arm_req = false; in bnxt_qplib_modify_srq()
709 bnxt_qplib_srq_arm_db(&srq->dbinfo, srq->threshold); in bnxt_qplib_modify_srq()
712 srq->arm_req = true; in bnxt_qplib_modify_srq()
719 struct bnxt_qplib_srq *srq) in bnxt_qplib_query_srq() argument
740 req.srq_cid = cpu_to_le32(srq->id); in bnxt_qplib_query_srq()
746 srq->threshold = le16_to_cpu(sb->srq_limit); in bnxt_qplib_query_srq()
753 int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq, in bnxt_qplib_post_srq_recv() argument
756 struct bnxt_qplib_hwq *srq_hwq = &srq->hwq; in bnxt_qplib_post_srq_recv()
763 if (srq->start_idx == srq->last_idx) { in bnxt_qplib_post_srq_recv()
765 "FP: SRQ (0x%x) is full!\n", srq->id); in bnxt_qplib_post_srq_recv()
769 next = srq->start_idx; in bnxt_qplib_post_srq_recv()
770 srq->start_idx = srq->swq[next].next_idx; in bnxt_qplib_post_srq_recv()
774 memset(srqe, 0, srq->wqe_size); in bnxt_qplib_post_srq_recv()
787 srq->swq[next].wr_id = wqe->wr_id; in bnxt_qplib_post_srq_recv()
789 bnxt_qplib_hwq_incr_prod(&srq->dbinfo, srq_hwq, srq->dbinfo.max_slot); in bnxt_qplib_post_srq_recv()
795 bnxt_qplib_ring_prod_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ); in bnxt_qplib_post_srq_recv()
796 if (srq->arm_req == true && count > srq->threshold) { in bnxt_qplib_post_srq_recv()
797 srq->arm_req = false; in bnxt_qplib_post_srq_recv()
798 bnxt_qplib_srq_arm_db(&srq->dbinfo, srq->threshold); in bnxt_qplib_post_srq_recv()
1052 if (!qp->srq) { in bnxt_qplib_create_qp()
1086 req.srq_cid = cpu_to_le32(qp->srq->id); in bnxt_qplib_create_qp()
2581 static void bnxt_qplib_release_srqe(struct bnxt_qplib_srq *srq, u32 tag) in bnxt_qplib_release_srqe() argument
2583 spin_lock(&srq->hwq.lock); in bnxt_qplib_release_srqe()
2584 srq->swq[srq->last_idx].next_idx = (int)tag; in bnxt_qplib_release_srqe()
2585 srq->last_idx = (int)tag; in bnxt_qplib_release_srqe()
2586 srq->swq[srq->last_idx].next_idx = -1; in bnxt_qplib_release_srqe()
2587 bnxt_qplib_hwq_incr_cons(srq->hwq.max_elements, &srq->hwq.cons, in bnxt_qplib_release_srqe()
2588 srq->dbinfo.max_slot, &srq->dbinfo.flags); in bnxt_qplib_release_srqe()
2589 spin_unlock(&srq->hwq.lock); in bnxt_qplib_release_srqe()
2597 struct bnxt_qplib_srq *srq; in bnxt_qplib_cq_process_res_rc() local
2627 srq = qp->srq; in bnxt_qplib_cq_process_res_rc()
2628 if (!srq) in bnxt_qplib_cq_process_res_rc()
2630 if (wr_id_idx >= srq->hwq.max_elements) { in bnxt_qplib_cq_process_res_rc()
2633 wr_id_idx, srq->hwq.max_elements); in bnxt_qplib_cq_process_res_rc()
2636 cqe->wr_id = srq->swq[wr_id_idx].wr_id; in bnxt_qplib_cq_process_res_rc()
2637 bnxt_qplib_release_srqe(srq, wr_id_idx); in bnxt_qplib_cq_process_res_rc()
2677 struct bnxt_qplib_srq *srq; in bnxt_qplib_cq_process_res_ud() local
2712 srq = qp->srq; in bnxt_qplib_cq_process_res_ud()
2713 if (!srq) in bnxt_qplib_cq_process_res_ud()
2716 if (wr_id_idx >= srq->hwq.max_elements) { in bnxt_qplib_cq_process_res_ud()
2719 wr_id_idx, srq->hwq.max_elements); in bnxt_qplib_cq_process_res_ud()
2722 cqe->wr_id = srq->swq[wr_id_idx].wr_id; in bnxt_qplib_cq_process_res_ud()
2723 bnxt_qplib_release_srqe(srq, wr_id_idx); in bnxt_qplib_cq_process_res_ud()
2777 struct bnxt_qplib_srq *srq; in bnxt_qplib_cq_process_res_raweth_qp1() local
2815 srq = qp->srq; in bnxt_qplib_cq_process_res_raweth_qp1()
2816 if (!srq) { in bnxt_qplib_cq_process_res_raweth_qp1()
2821 if (wr_id_idx >= srq->hwq.max_elements) { in bnxt_qplib_cq_process_res_raweth_qp1()
2824 wr_id_idx, srq->hwq.max_elements); in bnxt_qplib_cq_process_res_raweth_qp1()
2827 cqe->wr_id = srq->swq[wr_id_idx].wr_id; in bnxt_qplib_cq_process_res_raweth_qp1()
2828 bnxt_qplib_release_srqe(srq, wr_id_idx); in bnxt_qplib_cq_process_res_raweth_qp1()