Lines Matching refs:srq

73 	if (!qp->srq) {  in __bnxt_qplib_add_flush_qp()
119 if (!qp->srq) { in __bnxt_qplib_del_flush_qp()
388 struct bnxt_qplib_srq *srq; in bnxt_qplib_service_nq() local
394 srq = (struct bnxt_qplib_srq *)q_handle; in bnxt_qplib_service_nq()
395 bnxt_qplib_armen_db(&srq->dbinfo, in bnxt_qplib_service_nq()
613 struct bnxt_qplib_srq *srq) in __qplib_destroy_srq() argument
619 req.srq_cid = cpu_to_le32(srq->id); in __qplib_destroy_srq()
628 struct bnxt_qplib_srq *srq) in bnxt_qplib_destroy_srq() argument
633 rc = __qplib_destroy_srq(rcfw, srq); in bnxt_qplib_destroy_srq()
636 bnxt_qplib_free_hwq(res, &srq->hwq); in bnxt_qplib_destroy_srq()
637 kfree(srq->swq); in bnxt_qplib_destroy_srq()
642 struct bnxt_qplib_srq *srq) in bnxt_qplib_create_srq() argument
654 hwq_attr.sginfo = &srq->sginfo; in bnxt_qplib_create_srq()
655 hwq_attr.depth = srq->max_wqe; in bnxt_qplib_create_srq()
656 hwq_attr.stride = srq->wqe_size; in bnxt_qplib_create_srq()
658 rc = bnxt_qplib_alloc_init_hwq(&srq->hwq, &hwq_attr); in bnxt_qplib_create_srq()
662 req.dpi = cpu_to_le32(srq->dpi->dpi); in bnxt_qplib_create_srq()
663 req.srq_handle = cpu_to_le64((uintptr_t)srq); in bnxt_qplib_create_srq()
664 srq_size = min_t(u32, srq->hwq.depth, U16_MAX); in bnxt_qplib_create_srq()
666 pg_sz_lvl |= (_get_base_pg_size(&srq->hwq) << in bnxt_qplib_create_srq()
668 pg_sz_lvl |= (srq->hwq.level & CMDQ_CREATE_SRQ_LVL_MASK); in bnxt_qplib_create_srq()
670 req.pbl = cpu_to_le64(_get_base_addr(&srq->hwq)); in bnxt_qplib_create_srq()
671 req.pd_id = cpu_to_le32(srq->pd->id); in bnxt_qplib_create_srq()
672 req.eventq_id = cpu_to_le16(srq->eventq_hw_ring_id); in bnxt_qplib_create_srq()
680 if (!srq->is_user) { in bnxt_qplib_create_srq()
681 srq->swq = kcalloc(srq->hwq.depth, sizeof(*srq->swq), in bnxt_qplib_create_srq()
683 if (!srq->swq) in bnxt_qplib_create_srq()
685 srq->start_idx = 0; in bnxt_qplib_create_srq()
686 srq->last_idx = srq->hwq.depth - 1; in bnxt_qplib_create_srq()
687 for (idx = 0; idx < srq->hwq.depth; idx++) in bnxt_qplib_create_srq()
688 srq->swq[idx].next_idx = idx + 1; in bnxt_qplib_create_srq()
689 srq->swq[srq->last_idx].next_idx = -1; in bnxt_qplib_create_srq()
692 spin_lock_init(&srq->lock); in bnxt_qplib_create_srq()
693 srq->id = le32_to_cpu(resp.xid); in bnxt_qplib_create_srq()
694 srq->cctx = res->cctx; in bnxt_qplib_create_srq()
695 srq->dbinfo.hwq = &srq->hwq; in bnxt_qplib_create_srq()
696 srq->dbinfo.xid = srq->id; in bnxt_qplib_create_srq()
697 srq->dbinfo.db = srq->dpi->dbr; in bnxt_qplib_create_srq()
698 srq->dbinfo.max_slot = 1; in bnxt_qplib_create_srq()
699 srq->dbinfo.priv_db = res->dpi_tbl.priv_db; in bnxt_qplib_create_srq()
700 srq->dbinfo.flags = 0; in bnxt_qplib_create_srq()
701 spin_lock_init(&srq->dbinfo.lock); in bnxt_qplib_create_srq()
702 srq->dbinfo.shadow_key = BNXT_QPLIB_DBR_KEY_INVALID; in bnxt_qplib_create_srq()
703 srq->dbinfo.shadow_key_arm_ena = BNXT_QPLIB_DBR_KEY_INVALID; in bnxt_qplib_create_srq()
704 srq->dbinfo.res = res; in bnxt_qplib_create_srq()
705 srq->dbinfo.seed = srq->id; in bnxt_qplib_create_srq()
706 if (srq->threshold) in bnxt_qplib_create_srq()
707 bnxt_qplib_armen_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ_ARMENA); in bnxt_qplib_create_srq()
708 srq->arm_req = false; in bnxt_qplib_create_srq()
711 __qplib_destroy_srq(rcfw, srq); in bnxt_qplib_create_srq()
713 bnxt_qplib_free_hwq(res, &srq->hwq); in bnxt_qplib_create_srq()
719 struct bnxt_qplib_srq *srq) in bnxt_qplib_modify_srq() argument
721 struct bnxt_qplib_hwq *srq_hwq = &srq->hwq; in bnxt_qplib_modify_srq()
725 if (avail <= srq->threshold) { in bnxt_qplib_modify_srq()
726 srq->arm_req = false; in bnxt_qplib_modify_srq()
727 bnxt_qplib_srq_arm_db(&srq->dbinfo); in bnxt_qplib_modify_srq()
730 srq->arm_req = true; in bnxt_qplib_modify_srq()
736 struct bnxt_qplib_srq *srq) in bnxt_qplib_query_srq() argument
754 req.srq_cid = cpu_to_le32(srq->id); in bnxt_qplib_query_srq()
765 int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq, in bnxt_qplib_post_srq_recv() argument
768 struct bnxt_qplib_hwq *srq_hwq = &srq->hwq; in bnxt_qplib_post_srq_recv()
775 if (srq->start_idx == srq->last_idx) { in bnxt_qplib_post_srq_recv()
777 srq->id); in bnxt_qplib_post_srq_recv()
782 next = srq->start_idx; in bnxt_qplib_post_srq_recv()
783 srq->start_idx = srq->swq[next].next_idx; in bnxt_qplib_post_srq_recv()
787 memset(srqe, 0, srq->wqe_size); in bnxt_qplib_post_srq_recv()
802 srq->swq[next].wr_id = wqe->wr_id; in bnxt_qplib_post_srq_recv()
803 bnxt_qplib_hwq_incr_prod(&srq->dbinfo, srq_hwq, srq->dbinfo.max_slot); in bnxt_qplib_post_srq_recv()
811 bnxt_qplib_ring_prod_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ); in bnxt_qplib_post_srq_recv()
812 if (srq->arm_req && avail <= srq->threshold) { in bnxt_qplib_post_srq_recv()
813 srq->arm_req = false; in bnxt_qplib_post_srq_recv()
814 bnxt_qplib_srq_arm_db(&srq->dbinfo); in bnxt_qplib_post_srq_recv()
948 if (!qp->srq) { in bnxt_qplib_create_qp1()
972 req.srq_cid = cpu_to_le32(qp->srq->id); in bnxt_qplib_create_qp1()
992 if (!qp->srq) { in bnxt_qplib_create_qp1()
1140 if (!qp->srq) { in bnxt_qplib_create_qp()
1166 req.srq_cid = cpu_to_le32(qp->srq->id); in bnxt_qplib_create_qp()
1234 if (!qp->srq) { in bnxt_qplib_create_qp()
2972 static void bnxt_qplib_release_srqe(struct bnxt_qplib_srq *srq, u32 tag) in bnxt_qplib_release_srqe() argument
2974 spin_lock(&srq->hwq.lock); in bnxt_qplib_release_srqe()
2975 srq->swq[srq->last_idx].next_idx = (int)tag; in bnxt_qplib_release_srqe()
2976 srq->last_idx = (int)tag; in bnxt_qplib_release_srqe()
2977 srq->swq[srq->last_idx].next_idx = -1; in bnxt_qplib_release_srqe()
2978 bnxt_qplib_hwq_incr_cons(srq->hwq.depth, &srq->hwq.cons, in bnxt_qplib_release_srqe()
2979 srq->dbinfo.max_slot, &srq->dbinfo.flags); in bnxt_qplib_release_srqe()
2980 spin_unlock(&srq->hwq.lock); in bnxt_qplib_release_srqe()
2988 struct bnxt_qplib_srq *srq; in bnxt_qplib_cq_process_res_rc() local
3018 srq = qp->srq; in bnxt_qplib_cq_process_res_rc()
3019 if (!srq) { in bnxt_qplib_cq_process_res_rc()
3024 if (wr_id_idx > srq->hwq.depth - 1) { in bnxt_qplib_cq_process_res_rc()
3029 wr_id_idx, srq->hwq.depth); in bnxt_qplib_cq_process_res_rc()
3032 cqe->wr_id = srq->swq[wr_id_idx].wr_id; in bnxt_qplib_cq_process_res_rc()
3033 bnxt_qplib_release_srqe(srq, wr_id_idx); in bnxt_qplib_cq_process_res_rc()
3034 dev_dbg(&srq->hwq.pdev->dev, in bnxt_qplib_cq_process_res_rc()
3076 struct bnxt_qplib_srq *srq; in bnxt_qplib_cq_process_res_ud() local
3119 srq = qp->srq; in bnxt_qplib_cq_process_res_ud()
3120 if (!srq) { in bnxt_qplib_cq_process_res_ud()
3125 if (wr_id_idx > srq->hwq.depth - 1) { in bnxt_qplib_cq_process_res_ud()
3130 wr_id_idx, srq->hwq.depth); in bnxt_qplib_cq_process_res_ud()
3133 cqe->wr_id = srq->swq[wr_id_idx].wr_id; in bnxt_qplib_cq_process_res_ud()
3134 bnxt_qplib_release_srqe(srq, wr_id_idx); in bnxt_qplib_cq_process_res_ud()
3196 struct bnxt_qplib_srq *srq; in bnxt_qplib_cq_process_res_raweth_qp1() local
3238 srq = qp->srq; in bnxt_qplib_cq_process_res_raweth_qp1()
3239 if (!srq) { in bnxt_qplib_cq_process_res_raweth_qp1()
3244 if (wr_id_idx > srq->hwq.depth - 1) { in bnxt_qplib_cq_process_res_raweth_qp1()
3249 wr_id_idx, srq->hwq.depth); in bnxt_qplib_cq_process_res_raweth_qp1()
3252 cqe->wr_id = srq->swq[wr_id_idx].wr_id; in bnxt_qplib_cq_process_res_raweth_qp1()
3260 srq->hwq.cons++; in bnxt_qplib_cq_process_res_raweth_qp1()