Lines Matching refs:qp
519 struct mthca_qp *qp; in mthca_create_qp() local
532 qp = kmalloc(sizeof *qp, GFP_KERNEL); in mthca_create_qp()
533 if (!qp) in mthca_create_qp()
540 kfree(qp); in mthca_create_qp()
548 kfree(qp); in mthca_create_qp()
560 kfree(qp); in mthca_create_qp()
564 qp->mr.ibmr.lkey = ucmd.lkey; in mthca_create_qp()
565 qp->sq.db_index = ucmd.sq_db_index; in mthca_create_qp()
566 qp->rq.db_index = ucmd.rq_db_index; in mthca_create_qp()
573 &init_attr->cap, qp); in mthca_create_qp()
588 qp->ibqp.qp_num = qp->qpn; in mthca_create_qp()
598 qp = kmalloc(sizeof (struct mthca_sqp), GFP_KERNEL); in mthca_create_qp()
599 if (!qp) in mthca_create_qp()
602 qp->ibqp.qp_num = init_attr->qp_type == IB_QPT_SMI ? 0 : 1; in mthca_create_qp()
608 qp->ibqp.qp_num, init_attr->port_num, in mthca_create_qp()
609 to_msqp(qp)); in mthca_create_qp()
618 kfree(qp); in mthca_create_qp()
622 init_attr->cap.max_send_wr = qp->sq.max; in mthca_create_qp()
623 init_attr->cap.max_recv_wr = qp->rq.max; in mthca_create_qp()
624 init_attr->cap.max_send_sge = qp->sq.max_gs; in mthca_create_qp()
625 init_attr->cap.max_recv_sge = qp->rq.max_gs; in mthca_create_qp()
626 init_attr->cap.max_inline_data = qp->max_inline_data; in mthca_create_qp()
628 return &qp->ibqp; in mthca_create_qp()
631 static int mthca_destroy_qp(struct ib_qp *qp) in mthca_destroy_qp() argument
633 if (qp->uobject) { in mthca_destroy_qp()
634 mthca_unmap_user_db(to_mdev(qp->device), in mthca_destroy_qp()
635 &to_mucontext(qp->uobject->context)->uar, in mthca_destroy_qp()
636 to_mucontext(qp->uobject->context)->db_tab, in mthca_destroy_qp()
637 to_mqp(qp)->sq.db_index); in mthca_destroy_qp()
638 mthca_unmap_user_db(to_mdev(qp->device), in mthca_destroy_qp()
639 &to_mucontext(qp->uobject->context)->uar, in mthca_destroy_qp()
640 to_mucontext(qp->uobject->context)->db_tab, in mthca_destroy_qp()
641 to_mqp(qp)->rq.db_index); in mthca_destroy_qp()
643 mthca_free_qp(to_mdev(qp->device), to_mqp(qp)); in mthca_destroy_qp()
644 kfree(qp); in mthca_destroy_qp()