Lines Matching refs:ibqp

69 	if (qp->ibqp.qp_type == IB_QPT_RC || qp->ibqp.qp_type == IB_QPT_UC)  in set_extend_sge()
104 static int set_rwqe_data_seg(struct ib_qp *ibqp, const struct ib_send_wr *wr, in set_rwqe_data_seg() argument
109 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in set_rwqe_data_seg()
111 struct hns_roce_qp *qp = to_hr_qp(ibqp); in set_rwqe_data_seg()
168 static int hns_roce_v2_modify_qp(struct ib_qp *ibqp,
173 static int hns_roce_v2_post_send(struct ib_qp *ibqp, in hns_roce_v2_post_send() argument
177 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v2_post_send()
181 struct hns_roce_qp *qp = to_hr_qp(ibqp); in hns_roce_v2_post_send()
198 if (unlikely(ibqp->qp_type != IB_QPT_RC && in hns_roce_v2_post_send()
199 ibqp->qp_type != IB_QPT_GSI && in hns_roce_v2_post_send()
200 ibqp->qp_type != IB_QPT_UD)) { in hns_roce_v2_post_send()
201 dev_err(dev, "Not supported QP(0x%x)type!\n", ibqp->qp_type); in hns_roce_v2_post_send()
218 if (hns_roce_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)) { in hns_roce_v2_post_send()
241 if (ibqp->qp_type == IB_QPT_GSI) { in hns_roce_v2_post_send()
308 to_hr_pd(ibqp->pd)->pdn); in hns_roce_v2_post_send()
370 } else if (ibqp->qp_type == IB_QPT_RC) { in hns_roce_v2_post_send()
498 ret = set_rwqe_data_seg(ibqp, wr, rc_sq_wqe, wqe, in hns_roce_v2_post_send()
504 dev_err(dev, "Illegal qp_type(0x%x)\n", ibqp->qp_type); in hns_roce_v2_post_send()
539 ret = hns_roce_v2_modify_qp(&qp->ibqp, &attr, attr_mask, in hns_roce_v2_post_send()
554 static int hns_roce_v2_post_recv(struct ib_qp *ibqp, in hns_roce_v2_post_recv() argument
558 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v2_post_recv()
559 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v2_post_recv()
583 hr_qp->ibqp.recv_cq)) { in hns_roce_v2_post_recv()
640 ret = hns_roce_v2_modify_qp(&hr_qp->ibqp, &attr, in hns_roce_v2_post_recv()
2084 wc->qp = &(*cur_qp)->ibqp; in hns_roce_v2_poll_one()
2142 return hns_roce_v2_modify_qp(&(*cur_qp)->ibqp, in hns_roce_v2_poll_one()
2514 static void modify_qp_reset_to_init(struct ib_qp *ibqp, in modify_qp_reset_to_init() argument
2520 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in modify_qp_reset_to_init()
2521 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in modify_qp_reset_to_init()
2530 V2_QPC_BYTE_4_TST_S, to_hr_qp_type(hr_qp->ibqp.qp_type)); in modify_qp_reset_to_init()
2534 if (ibqp->qp_type == IB_QPT_GSI) in modify_qp_reset_to_init()
2555 V2_QPC_BYTE_16_PD_S, to_hr_pd(ibqp->pd)->pdn); in modify_qp_reset_to_init()
2638 V2_QPC_BYTE_80_RX_CQN_S, to_hr_cq(ibqp->recv_cq)->cqn); in modify_qp_reset_to_init()
2641 if (ibqp->srq) { in modify_qp_reset_to_init()
2644 to_hr_srq(ibqp->srq)->srqn); in modify_qp_reset_to_init()
2822 V2_QPC_BYTE_252_TX_CQN_S, to_hr_cq(ibqp->send_cq)->cqn); in modify_qp_reset_to_init()
2837 static void modify_qp_init_to_init(struct ib_qp *ibqp, in modify_qp_init_to_init() argument
2842 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in modify_qp_init_to_init()
2851 V2_QPC_BYTE_4_TST_S, to_hr_qp_type(hr_qp->ibqp.qp_type)); in modify_qp_init_to_init()
2855 if (ibqp->qp_type == IB_QPT_GSI) in modify_qp_init_to_init()
2916 V2_QPC_BYTE_16_PD_S, to_hr_pd(ibqp->pd)->pdn); in modify_qp_init_to_init()
2921 V2_QPC_BYTE_80_RX_CQN_S, to_hr_cq(ibqp->recv_cq)->cqn); in modify_qp_init_to_init()
2926 V2_QPC_BYTE_252_TX_CQN_S, to_hr_cq(ibqp->send_cq)->cqn); in modify_qp_init_to_init()
2930 if (ibqp->srq) { in modify_qp_init_to_init()
2937 to_hr_srq(ibqp->srq)->srqn); in modify_qp_init_to_init()
2967 static int modify_qp_init_to_rtr(struct ib_qp *ibqp, in modify_qp_init_to_rtr() argument
2973 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in modify_qp_init_to_rtr()
2974 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in modify_qp_init_to_rtr()
3042 ((ibqp->qp_type == IB_QPT_GSI) || hr_qp->sq.max_gs > 2) ? in modify_qp_init_to_rtr()
3190 if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD) in modify_qp_init_to_rtr()
3241 static int modify_qp_rtr_to_rts(struct ib_qp *ibqp, in modify_qp_rtr_to_rts() argument
3246 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in modify_qp_rtr_to_rts()
3247 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in modify_qp_rtr_to_rts()
3293 ((ibqp->qp_type == IB_QPT_GSI) || hr_qp->sq.max_gs > 2) ? in modify_qp_rtr_to_rts()
3299 ((ibqp->qp_type == IB_QPT_GSI) || hr_qp->sq.max_gs > 2) ? in modify_qp_rtr_to_rts()
3438 static int hns_roce_v2_modify_qp(struct ib_qp *ibqp, in hns_roce_v2_modify_qp() argument
3443 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v2_modify_qp()
3444 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v2_modify_qp()
3463 modify_qp_reset_to_init(ibqp, attr, attr_mask, context, in hns_roce_v2_modify_qp()
3466 modify_qp_init_to_init(ibqp, attr, attr_mask, context, in hns_roce_v2_modify_qp()
3469 ret = modify_qp_init_to_rtr(ibqp, attr, attr_mask, context, in hns_roce_v2_modify_qp()
3474 ret = modify_qp_rtr_to_rts(ibqp, attr, attr_mask, context, in hns_roce_v2_modify_qp()
3634 if (new_state == IB_QPS_RESET && !ibqp->uobject) { in hns_roce_v2_modify_qp()
3635 hns_roce_v2_cq_clean(to_hr_cq(ibqp->recv_cq), hr_qp->qpn, in hns_roce_v2_modify_qp()
3636 ibqp->srq ? to_hr_srq(ibqp->srq) : NULL); in hns_roce_v2_modify_qp()
3637 if (ibqp->send_cq != ibqp->recv_cq) in hns_roce_v2_modify_qp()
3638 hns_roce_v2_cq_clean(to_hr_cq(ibqp->send_cq), in hns_roce_v2_modify_qp()
3697 static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, in hns_roce_v2_query_qp() argument
3701 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v2_query_qp()
3702 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v2_query_qp()
3746 if (hr_qp->ibqp.qp_type == IB_QPT_UD) in hns_roce_v2_query_qp()
3764 if (hr_qp->ibqp.qp_type == IB_QPT_RC || in hns_roce_v2_query_qp()
3765 hr_qp->ibqp.qp_type == IB_QPT_UC) { in hns_roce_v2_query_qp()
3813 if (!ibqp->uobject) { in hns_roce_v2_query_qp()
3837 if (hr_qp->ibqp.qp_type == IB_QPT_RC && hr_qp->state != IB_QPS_RESET) { in hns_roce_v2_destroy_qp_common()
3839 ret = hns_roce_v2_modify_qp(&hr_qp->ibqp, NULL, 0, in hns_roce_v2_destroy_qp_common()
3848 send_cq = to_hr_cq(hr_qp->ibqp.send_cq); in hns_roce_v2_destroy_qp_common()
3849 recv_cq = to_hr_cq(hr_qp->ibqp.recv_cq); in hns_roce_v2_destroy_qp_common()
3854 __hns_roce_v2_cq_clean(recv_cq, hr_qp->qpn, hr_qp->ibqp.srq ? in hns_roce_v2_destroy_qp_common()
3855 to_hr_srq(hr_qp->ibqp.srq) : NULL); in hns_roce_v2_destroy_qp_common()
3867 if ((hr_qp->ibqp.qp_type == IB_QPT_RC) || in hns_roce_v2_destroy_qp_common()
3868 (hr_qp->ibqp.qp_type == IB_QPT_UC) || in hns_roce_v2_destroy_qp_common()
3869 (hr_qp->ibqp.qp_type == IB_QPT_UD)) in hns_roce_v2_destroy_qp_common()
3877 to_hr_ucontext(hr_qp->ibqp.uobject->context), in hns_roce_v2_destroy_qp_common()
3882 to_hr_ucontext(hr_qp->ibqp.uobject->context), in hns_roce_v2_destroy_qp_common()
3901 static int hns_roce_v2_destroy_qp(struct ib_qp *ibqp) in hns_roce_v2_destroy_qp() argument
3903 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v2_destroy_qp()
3904 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v2_destroy_qp()
3907 ret = hns_roce_v2_destroy_qp_common(hr_dev, hr_qp, !!ibqp->pd->uobject); in hns_roce_v2_destroy_qp()
3913 if (hr_qp->ibqp.qp_type == IB_QPT_GSI) in hns_roce_v2_destroy_qp()
3975 if (hr_qp->ibqp.uobject) { in hns_roce_set_qps_to_err()
3987 ret = hns_roce_v2_modify_qp(&hr_qp->ibqp, &attr, attr_mask, in hns_roce_set_qps_to_err()