Lines Matching refs:ibqp

61 static int hns_roce_v1_post_send(struct ib_qp *ibqp,  in hns_roce_v1_post_send()  argument
65 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v1_post_send()
70 struct hns_roce_qp *qp = to_hr_qp(ibqp); in hns_roce_v1_post_send()
83 if (unlikely(ibqp->qp_type != IB_QPT_GSI && in hns_roce_v1_post_send()
84 ibqp->qp_type != IB_QPT_RC)) { in hns_roce_v1_post_send()
93 if (hns_roce_wq_overflow(&qp->sq, nreq, qp->ibqp.send_cq)) { in hns_roce_v1_post_send()
112 if (ibqp->qp_type == IB_QPT_GSI) { in hns_roce_v1_post_send()
217 } else if (ibqp->qp_type == IB_QPT_RC) { in hns_roce_v1_post_send()
350 static int hns_roce_v1_post_recv(struct ib_qp *ibqp, in hns_roce_v1_post_recv() argument
362 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v1_post_recv()
363 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v1_post_recv()
373 hr_qp->ibqp.recv_cq)) { in hns_roce_v1_post_recv()
410 if (ibqp->qp_type == IB_QPT_GSI) { in hns_roce_v1_post_recv()
414 reg_val = roce_read(to_hr_dev(ibqp->device), in hns_roce_v1_post_recv()
423 roce_write(to_hr_dev(ibqp->device), in hns_roce_v1_post_recv()
801 hr_qp->ibqp.qp_type = IB_QPT_RC; in hns_roce_v1_rsv_lp_qp()
802 hr_qp->ibqp.device = &hr_dev->ib_dev; in hns_roce_v1_rsv_lp_qp()
803 hr_qp->ibqp.uobject = NULL; in hns_roce_v1_rsv_lp_qp()
804 atomic_set(&hr_qp->ibqp.usecnt, 0); in hns_roce_v1_rsv_lp_qp()
805 hr_qp->ibqp.pd = pd; in hns_roce_v1_rsv_lp_qp()
806 hr_qp->ibqp.recv_cq = cq; in hns_roce_v1_rsv_lp_qp()
807 hr_qp->ibqp.send_cq = cq; in hns_roce_v1_rsv_lp_qp()
826 ret = hr_dev->hw->modify_qp(&hr_qp->ibqp, &attr, attr_mask, in hns_roce_v1_rsv_lp_qp()
833 ret = hr_dev->hw->modify_qp(&hr_qp->ibqp, &attr, IB_QP_DEST_QPN, in hns_roce_v1_rsv_lp_qp()
840 ret = hr_dev->hw->modify_qp(&hr_qp->ibqp, &attr, attr_mask, in hns_roce_v1_rsv_lp_qp()
853 if (hns_roce_v1_destroy_qp(&hr_qp->ibqp)) in hns_roce_v1_rsv_lp_qp()
884 ret = hns_roce_v1_destroy_qp(&hr_qp->ibqp); in hns_roce_v1_release_lp_qp()
1000 struct hns_roce_dev *hr_dev = to_hr_dev(hr_qp->ibqp.device); in hns_roce_v1_send_lp_wqe()
1014 ret = hns_roce_v1_post_send(&hr_qp->ibqp, &send_wr, &bad_wr); in hns_roce_v1_send_lp_wqe()
2271 wc->qp = &(*cur_qp)->ibqp; in hns_roce_v1_poll_one()
2607 static int hns_roce_v1_m_sqp(struct ib_qp *ibqp, const struct ib_qp_attr *attr, in hns_roce_v1_m_sqp() argument
2611 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v1_m_sqp()
2612 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v1_m_sqp()
2644 QP1C_BYTES_4_PD_S, to_hr_pd(ibqp->pd)->pdn); in hns_roce_v1_m_sqp()
2686 to_hr_cq(ibqp->recv_cq)->cqn); in hns_roce_v1_m_sqp()
2690 to_hr_cq(ibqp->send_cq)->cqn); in hns_roce_v1_m_sqp()
2731 hns_roce_v1_cq_clean(to_hr_cq(ibqp->recv_cq), hr_qp->qpn, in hns_roce_v1_m_sqp()
2732 ibqp->srq ? to_hr_srq(ibqp->srq) : NULL); in hns_roce_v1_m_sqp()
2733 if (ibqp->send_cq != ibqp->recv_cq) in hns_roce_v1_m_sqp()
2734 hns_roce_v1_cq_clean(to_hr_cq(ibqp->send_cq), in hns_roce_v1_m_sqp()
2752 static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr, in hns_roce_v1_m_qp() argument
2756 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v1_m_qp()
2757 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v1_m_qp()
2803 to_hr_qp_type(hr_qp->ibqp.qp_type)); in hns_roce_v1_m_qp()
2831 to_hr_pd(ibqp->pd)->pdn); in hns_roce_v1_m_qp()
2836 to_hr_cq(ibqp->send_cq)->cqn); in hns_roce_v1_m_qp()
2840 to_hr_cq(ibqp->recv_cq)->cqn); in hns_roce_v1_m_qp()
2842 if (ibqp->srq) in hns_roce_v1_m_qp()
2846 to_hr_srq(ibqp->srq)->srqn); in hns_roce_v1_m_qp()
2861 to_hr_qp_type(hr_qp->ibqp.qp_type)); in hns_roce_v1_m_qp()
2897 to_hr_pd(ibqp->pd)->pdn); in hns_roce_v1_m_qp()
2902 to_hr_cq(ibqp->send_cq)->cqn); in hns_roce_v1_m_qp()
2906 to_hr_cq(ibqp->recv_cq)->cqn); in hns_roce_v1_m_qp()
2908 if (ibqp->srq) in hns_roce_v1_m_qp()
2912 to_hr_srq(ibqp->srq)->srqn); in hns_roce_v1_m_qp()
3326 if (ibqp->uobject) { in hns_roce_v1_m_qp()
3344 if (new_state == IB_QPS_RESET && !ibqp->uobject) { in hns_roce_v1_m_qp()
3345 hns_roce_v1_cq_clean(to_hr_cq(ibqp->recv_cq), hr_qp->qpn, in hns_roce_v1_m_qp()
3346 ibqp->srq ? to_hr_srq(ibqp->srq) : NULL); in hns_roce_v1_m_qp()
3347 if (ibqp->send_cq != ibqp->recv_cq) in hns_roce_v1_m_qp()
3348 hns_roce_v1_cq_clean(to_hr_cq(ibqp->send_cq), in hns_roce_v1_m_qp()
3362 static int hns_roce_v1_modify_qp(struct ib_qp *ibqp, in hns_roce_v1_modify_qp() argument
3368 if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_SMI) in hns_roce_v1_modify_qp()
3369 return hns_roce_v1_m_sqp(ibqp, attr, attr_mask, cur_state, in hns_roce_v1_modify_qp()
3372 return hns_roce_v1_m_qp(ibqp, attr, attr_mask, cur_state, in hns_roce_v1_modify_qp()
3420 static int hns_roce_v1_q_sqp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, in hns_roce_v1_q_sqp() argument
3424 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v1_q_sqp()
3425 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v1_q_sqp()
3490 static int hns_roce_v1_q_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, in hns_roce_v1_q_qp() argument
3494 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v1_q_qp()
3495 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v1_q_qp()
3539 if (hr_qp->ibqp.qp_type == IB_QPT_UD) in hns_roce_v1_q_qp()
3558 if (hr_qp->ibqp.qp_type == IB_QPT_RC || in hns_roce_v1_q_qp()
3559 hr_qp->ibqp.qp_type == IB_QPT_UC) { in hns_roce_v1_q_qp()
3616 if (!ibqp->uobject) { in hns_roce_v1_q_qp()
3632 static int hns_roce_v1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, in hns_roce_v1_query_qp() argument
3636 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v1_query_qp()
3639 hns_roce_v1_q_sqp(ibqp, qp_attr, qp_attr_mask, qp_init_attr) : in hns_roce_v1_query_qp()
3640 hns_roce_v1_q_qp(ibqp, qp_attr, qp_attr_mask, qp_init_attr); in hns_roce_v1_query_qp()
3817 ret = hns_roce_v1_modify_qp(&hr_qp->ibqp, NULL, 0, hr_qp->state, in check_qp_reset_state()
3847 ret = hns_roce_v1_modify_qp(&hr_qp->ibqp, NULL, 0, hr_qp->state, in check_qp_reset_state()
3898 ret = hns_roce_v1_modify_qp(&hr_qp->ibqp, NULL, 0, hr_qp->state, in hns_roce_v1_destroy_qp_work_fn()
3908 if (hr_qp->ibqp.qp_type == IB_QPT_RC) { in hns_roce_v1_destroy_qp_work_fn()
3920 int hns_roce_v1_destroy_qp(struct ib_qp *ibqp) in hns_roce_v1_destroy_qp() argument
3922 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v1_destroy_qp()
3923 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_v1_destroy_qp()
3929 int is_user = !!ibqp->pd->uobject; in hns_roce_v1_destroy_qp()
3939 send_cq = to_hr_cq(hr_qp->ibqp.send_cq); in hns_roce_v1_destroy_qp()
3940 recv_cq = to_hr_cq(hr_qp->ibqp.recv_cq); in hns_roce_v1_destroy_qp()
3944 __hns_roce_v1_cq_clean(recv_cq, hr_qp->qpn, hr_qp->ibqp.srq ? in hns_roce_v1_destroy_qp()
3945 to_hr_srq(hr_qp->ibqp.srq) : NULL); in hns_roce_v1_destroy_qp()
3956 if (hr_qp->ibqp.qp_type == IB_QPT_RC) in hns_roce_v1_destroy_qp()
3972 if (hr_qp->ibqp.qp_type == IB_QPT_RC) in hns_roce_v1_destroy_qp()