Lines Matching refs:rq
74 if (!qp->rq.flushed) { in __bnxt_qplib_add_flush_qp()
79 qp->rq.flushed = true; in __bnxt_qplib_add_flush_qp()
120 if (qp->rq.flushed) { in __bnxt_qplib_del_flush_qp()
121 qp->rq.flushed = false; in __bnxt_qplib_del_flush_qp()
137 qp->rq.hwq.prod = 0; in bnxt_qplib_clean_qp()
138 qp->rq.hwq.cons = 0; in bnxt_qplib_clean_qp()
139 qp->rq.swq_start = 0; in bnxt_qplib_clean_qp()
140 qp->rq.swq_last = 0; in bnxt_qplib_clean_qp()
229 qp->rq.max_wqe); in bnxt_qplib_alloc_hdr_buf()
912 struct bnxt_qplib_q *rq = &qp->rq; in bnxt_qplib_create_qp1() local
950 hwq_attr.sginfo = &rq->sginfo; in bnxt_qplib_create_qp1()
952 hwq_attr.depth = bnxt_qplib_get_depth(rq); in bnxt_qplib_create_qp1()
954 rc = bnxt_qplib_alloc_init_hwq(&rq->hwq, &hwq_attr); in bnxt_qplib_create_qp1()
957 req.rq_size = cpu_to_le32(rq->max_wqe); in bnxt_qplib_create_qp1()
958 req.rq_pbl = cpu_to_le64(_get_base_addr(&rq->hwq)); in bnxt_qplib_create_qp1()
959 pg_sz_lvl = _get_base_pg_size(&rq->hwq) << in bnxt_qplib_create_qp1()
961 pg_sz_lvl |= ((rq->hwq.level & CMDQ_CREATE_QP1_RQ_LVL_MASK) << in bnxt_qplib_create_qp1()
967 (rq->max_sge & in bnxt_qplib_create_qp1()
993 rc = bnxt_qplib_alloc_init_swq(rq); in bnxt_qplib_create_qp1()
1009 if (rq->max_wqe) { in bnxt_qplib_create_qp1()
1010 rq->dbinfo.hwq = &rq->hwq; in bnxt_qplib_create_qp1()
1011 rq->dbinfo.xid = qp->id; in bnxt_qplib_create_qp1()
1012 rq->dbinfo.db = qp->dpi->dbr; in bnxt_qplib_create_qp1()
1013 rq->dbinfo.max_slot = _set_rq_max_slot(rq); in bnxt_qplib_create_qp1()
1014 rq->dbinfo.flags = 0; in bnxt_qplib_create_qp1()
1015 spin_lock_init(&rq->dbinfo.lock); in bnxt_qplib_create_qp1()
1016 rq->dbinfo.shadow_key = BNXT_QPLIB_DBR_KEY_INVALID; in bnxt_qplib_create_qp1()
1017 rq->dbinfo.res = res; in bnxt_qplib_create_qp1()
1032 bnxt_qplib_free_hwq(res, &rq->hwq); in bnxt_qplib_create_qp1()
1065 struct bnxt_qplib_q *rq = &qp->rq; in bnxt_qplib_create_qp() local
1142 hwq_attr.sginfo = &rq->sginfo; in bnxt_qplib_create_qp()
1144 hwq_attr.depth = bnxt_qplib_get_depth(rq); in bnxt_qplib_create_qp()
1148 rc = bnxt_qplib_alloc_init_hwq(&rq->hwq, &hwq_attr); in bnxt_qplib_create_qp()
1151 req.rq_size = cpu_to_le32(rq->max_wqe); in bnxt_qplib_create_qp()
1152 req.rq_pbl = cpu_to_le64(_get_base_addr(&rq->hwq)); in bnxt_qplib_create_qp()
1153 pg_sz_lvl = _get_base_pg_size(&rq->hwq) << in bnxt_qplib_create_qp()
1155 pg_sz_lvl |= ((rq->hwq.level & CMDQ_CREATE_QP_RQ_LVL_MASK) << in bnxt_qplib_create_qp()
1159 res->dattr->max_qp_sges : rq->max_sge; in bnxt_qplib_create_qp()
1235 rc = bnxt_qplib_alloc_init_swq(rq); in bnxt_qplib_create_qp()
1256 if (rq->max_wqe) { in bnxt_qplib_create_qp()
1257 rq->dbinfo.hwq = &rq->hwq; in bnxt_qplib_create_qp()
1258 rq->dbinfo.xid = qp->id; in bnxt_qplib_create_qp()
1259 rq->dbinfo.db = qp->dpi->dbr; in bnxt_qplib_create_qp()
1260 rq->dbinfo.max_slot = _set_rq_max_slot(rq); in bnxt_qplib_create_qp()
1261 rq->dbinfo.flags = 0; in bnxt_qplib_create_qp()
1262 spin_lock_init(&rq->dbinfo.lock); in bnxt_qplib_create_qp()
1263 rq->dbinfo.shadow_key = BNXT_QPLIB_DBR_KEY_INVALID; in bnxt_qplib_create_qp()
1264 rq->dbinfo.res = res; in bnxt_qplib_create_qp()
1265 rq->dbinfo.seed = qp->id; in bnxt_qplib_create_qp()
1285 bnxt_qplib_free_hwq(res, &rq->hwq); in bnxt_qplib_create_qp()
1447 req.rq_psn = cpu_to_le32(qp->rq.psn); in bnxt_qplib_modify_qp()
1461 req.rq_size = cpu_to_le32(qp->rq.hwq.max_elements); in bnxt_qplib_modify_qp()
1463 req.rq_sge = cpu_to_le16(qp->rq.max_sge); in bnxt_qplib_modify_qp()
1570 qp->rq.psn = le32_to_cpu(sb->rq_psn); in bnxt_qplib_query_qp()
1576 qp->rq.max_wqe = qp->rq.hwq.max_elements; in bnxt_qplib_query_qp()
1578 qp->rq.max_sge = le16_to_cpu(sb->rq_sge); in bnxt_qplib_query_qp()
1670 kfree(qp->rq.swq); in bnxt_qplib_free_qp_res()
1671 bnxt_qplib_free_hwq(res, &qp->rq.hwq); in bnxt_qplib_free_qp_res()
1700 struct bnxt_qplib_q *rq = &qp->rq; in bnxt_qplib_get_rq_prod_index() local
1702 return rq->swq_start; in bnxt_qplib_get_rq_prod_index()
1708 struct bnxt_qplib_q *rq = &qp->rq; in bnxt_qplib_get_qp1_rq_buf() local
1716 sw_prod = rq->swq_start; in bnxt_qplib_get_qp1_rq_buf()
2272 struct bnxt_qplib_q *rq = &qp->rq; in bnxt_qplib_post_recv_db() local
2274 bnxt_qplib_ring_prod_db(&rq->dbinfo, DBC_DBC_TYPE_RQ); in bnxt_qplib_post_recv_db()
2299 struct bnxt_qplib_q *rq = &qp->rq; in bnxt_qplib_post_recv() local
2311 rq_hwq = &rq->hwq; in bnxt_qplib_post_recv()
2321 if (bnxt_qplib_queue_full(rq_hwq, rq->dbinfo.max_slot)) { in bnxt_qplib_post_recv()
2328 swq = bnxt_qplib_get_swqe(rq, &wqe_idx); in bnxt_qplib_post_recv()
2330 swq->slots = rq->dbinfo.max_slot; in bnxt_qplib_post_recv()
2361 bnxt_qplib_swq_mod_start(rq, wqe_idx); in bnxt_qplib_post_recv()
2362 bnxt_qplib_hwq_incr_prod(&rq->dbinfo, &rq->hwq, swq->slots); in bnxt_qplib_post_recv()
2372 dev_err(&rq->hwq.pdev->dev, in bnxt_qplib_post_recv()
2669 static int __flush_rq(struct bnxt_qplib_q *rq, struct bnxt_qplib_qp *qp, in __flush_rq() argument
2690 start = rq->swq_start; in __flush_rq()
2693 last = rq->swq_last; in __flush_rq()
2701 cqe->wr_id = rq->swq[last].wr_id; in __flush_rq()
2702 dev_dbg(&rq->hwq.pdev->dev, "QPLIB: FP: CQ Processed Res RC \n"); in __flush_rq()
2703 dev_dbg(&rq->hwq.pdev->dev, in __flush_rq()
2708 bnxt_qplib_hwq_incr_cons(rq->hwq.depth, in __flush_rq()
2709 &rq->hwq.cons, in __flush_rq()
2710 rq->swq[last].slots, in __flush_rq()
2711 &rq->dbinfo.flags); in __flush_rq()
2712 rq->swq_last = rq->swq[last].next_idx; in __flush_rq()
2715 if (!*budget && rq->swq_last != start) in __flush_rq()
2719 dev_dbg(&rq->hwq.pdev->dev, "QPLIB: FP: Flush RQ rc = 0x%x\n", rc); in __flush_rq()
2991 struct bnxt_qplib_q *rq; in bnxt_qplib_cq_process_res_rc() local
3000 if (qp->rq.flushed) { in bnxt_qplib_cq_process_res_rc()
3041 rq = &qp->rq; in bnxt_qplib_cq_process_res_rc()
3042 if (wr_id_idx > (rq->max_wqe - 1)) { in bnxt_qplib_cq_process_res_rc()
3047 wr_id_idx, rq->hwq.depth); in bnxt_qplib_cq_process_res_rc()
3050 if (wr_id_idx != rq->swq_last) in bnxt_qplib_cq_process_res_rc()
3052 cqe->wr_id = rq->swq[rq->swq_last].wr_id; in bnxt_qplib_cq_process_res_rc()
3055 rq->swq_last, cqe->wr_id); in bnxt_qplib_cq_process_res_rc()
3058 bnxt_qplib_hwq_incr_cons(rq->hwq.depth, &rq->hwq.cons, in bnxt_qplib_cq_process_res_rc()
3059 rq->swq[rq->swq_last].slots, in bnxt_qplib_cq_process_res_rc()
3060 &rq->dbinfo.flags); in bnxt_qplib_cq_process_res_rc()
3061 rq->swq_last = rq->swq[rq->swq_last].next_idx; in bnxt_qplib_cq_process_res_rc()
3079 struct bnxt_qplib_q *rq; in bnxt_qplib_cq_process_res_ud() local
3089 if (qp->rq.flushed) { in bnxt_qplib_cq_process_res_ud()
3142 rq = &qp->rq; in bnxt_qplib_cq_process_res_ud()
3143 if (wr_id_idx > (rq->max_wqe - 1)) { in bnxt_qplib_cq_process_res_ud()
3148 wr_id_idx, rq->hwq.depth); in bnxt_qplib_cq_process_res_ud()
3151 if (rq->swq_last != wr_id_idx) in bnxt_qplib_cq_process_res_ud()
3154 cqe->wr_id = rq->swq[rq->swq_last].wr_id; in bnxt_qplib_cq_process_res_ud()
3157 rq->swq_last, cqe->wr_id); in bnxt_qplib_cq_process_res_ud()
3160 bnxt_qplib_hwq_incr_cons(rq->hwq.depth, &rq->hwq.cons, in bnxt_qplib_cq_process_res_ud()
3161 rq->swq[rq->swq_last].slots, in bnxt_qplib_cq_process_res_ud()
3162 &rq->dbinfo.flags); in bnxt_qplib_cq_process_res_ud()
3163 rq->swq_last = rq->swq[rq->swq_last].next_idx; in bnxt_qplib_cq_process_res_ud()
3195 struct bnxt_qplib_q *rq; in bnxt_qplib_cq_process_res_raweth_qp1() local
3207 if (qp->rq.flushed) { in bnxt_qplib_cq_process_res_raweth_qp1()
3263 rq = &qp->rq; in bnxt_qplib_cq_process_res_raweth_qp1()
3264 if (wr_id_idx > (rq->max_wqe - 1)) { in bnxt_qplib_cq_process_res_raweth_qp1()
3269 wr_id_idx, rq->max_wqe); in bnxt_qplib_cq_process_res_raweth_qp1()
3272 if (wr_id_idx != rq->swq_last) in bnxt_qplib_cq_process_res_raweth_qp1()
3274 cqe->wr_id = rq->swq[rq->swq_last].wr_id; in bnxt_qplib_cq_process_res_raweth_qp1()
3282 bnxt_qplib_hwq_incr_cons(rq->hwq.depth, &rq->hwq.cons, in bnxt_qplib_cq_process_res_raweth_qp1()
3283 rq->swq[wr_id_idx].slots, in bnxt_qplib_cq_process_res_raweth_qp1()
3284 &rq->dbinfo.flags); in bnxt_qplib_cq_process_res_raweth_qp1()
3285 rq->swq_last = rq->swq[rq->swq_last].next_idx; in bnxt_qplib_cq_process_res_raweth_qp1()
3300 struct bnxt_qplib_q *sq, *rq; in bnxt_qplib_cq_process_terminal() local
3326 rq = &qp->rq; in bnxt_qplib_cq_process_terminal()
3382 } else if (cqe_cons > (rq->max_wqe - 1)) { in bnxt_qplib_cq_process_terminal()
3387 cqe_cons, rq->hwq.depth); in bnxt_qplib_cq_process_terminal()
3390 if (qp->rq.flushed) { in bnxt_qplib_cq_process_terminal()
3439 __flush_rq(&qp->rq, qp, &cqe, &budget); in bnxt_qplib_process_flush_list()