qhp 68 drivers/infiniband/hw/cxgb3/iwch.c struct iwch_qp *qhp; qhp 71 drivers/infiniband/hw/cxgb3/iwch.c xa_for_each(&rnicp->qps, index, qhp) qhp 72 drivers/infiniband/hw/cxgb3/iwch.c cxio_disable_wq_db(&qhp->wq); qhp 79 drivers/infiniband/hw/cxgb3/iwch.c struct iwch_qp *qhp; qhp 82 drivers/infiniband/hw/cxgb3/iwch.c xa_for_each(&rnicp->qps, index, qhp) { qhp 84 drivers/infiniband/hw/cxgb3/iwch.c ring_doorbell(qhp->rhp->rdev.ctrl_qp.doorbell, qhp 85 drivers/infiniband/hw/cxgb3/iwch.c qhp->wq.qpid); qhp 86 drivers/infiniband/hw/cxgb3/iwch.c cxio_enable_wq_db(&qhp->wq); qhp 36 drivers/infiniband/hw/cxgb3/iwch_cq.c struct iwch_qp *qhp, struct ib_wc *wc) qhp 38 drivers/infiniband/hw/cxgb3/iwch_cq.c struct t3_wq *wq = qhp ? &qhp->wq : NULL; qhp 60 drivers/infiniband/hw/cxgb3/iwch_cq.c wc->qp = qhp ? &qhp->ibqp : NULL; qhp 178 drivers/infiniband/hw/cxgb3/iwch_cq.c struct iwch_qp *qhp; qhp 187 drivers/infiniband/hw/cxgb3/iwch_cq.c qhp = get_qhp(rhp, CQE_QPID(*rd_cqe)); qhp 188 drivers/infiniband/hw/cxgb3/iwch_cq.c if (qhp) { qhp 189 drivers/infiniband/hw/cxgb3/iwch_cq.c spin_lock(&qhp->lock); qhp 190 drivers/infiniband/hw/cxgb3/iwch_cq.c ret = __iwch_poll_cq_one(rhp, chp, qhp, wc); qhp 191 drivers/infiniband/hw/cxgb3/iwch_cq.c spin_unlock(&qhp->lock); qhp 48 drivers/infiniband/hw/cxgb3/iwch_ev.c struct iwch_qp *qhp; qhp 52 drivers/infiniband/hw/cxgb3/iwch_ev.c qhp = xa_load(&rnicp->qps, CQE_QPID(rsp_msg->cqe)); qhp 54 drivers/infiniband/hw/cxgb3/iwch_ev.c if (!qhp) { qhp 62 drivers/infiniband/hw/cxgb3/iwch_ev.c if ((qhp->attr.state == IWCH_QP_STATE_ERROR) || qhp 63 drivers/infiniband/hw/cxgb3/iwch_ev.c (qhp->attr.state == IWCH_QP_STATE_TERMINATE)) { qhp 66 drivers/infiniband/hw/cxgb3/iwch_ev.c qhp->attr.state, qhp->wq.qpid, qhp 78 drivers/infiniband/hw/cxgb3/iwch_ev.c atomic_inc(&qhp->refcnt); qhp 81 drivers/infiniband/hw/cxgb3/iwch_ev.c if (qhp->attr.state == IWCH_QP_STATE_RTS) { qhp 83 drivers/infiniband/hw/cxgb3/iwch_ev.c iwch_modify_qp(qhp->rhp, qhp, IWCH_QP_ATTR_NEXT_STATE, qhp 86 drivers/infiniband/hw/cxgb3/iwch_ev.c iwch_post_terminate(qhp, rsp_msg); qhp 94 drivers/infiniband/hw/cxgb3/iwch_ev.c event.element.qp = &qhp->ibqp; qhp 96 drivers/infiniband/hw/cxgb3/iwch_ev.c if (qhp->ibqp.event_handler) qhp 97 drivers/infiniband/hw/cxgb3/iwch_ev.c (*qhp->ibqp.event_handler)(&event, qhp->ibqp.qp_context); qhp 103 drivers/infiniband/hw/cxgb3/iwch_ev.c if (atomic_dec_and_test(&qhp->refcnt)) qhp 104 drivers/infiniband/hw/cxgb3/iwch_ev.c wake_up(&qhp->wait); qhp 112 drivers/infiniband/hw/cxgb3/iwch_ev.c struct iwch_qp *qhp; qhp 119 drivers/infiniband/hw/cxgb3/iwch_ev.c qhp = xa_load(&rnicp->qps, CQE_QPID(rsp_msg->cqe)); qhp 120 drivers/infiniband/hw/cxgb3/iwch_ev.c if (!chp || !qhp) { qhp 129 drivers/infiniband/hw/cxgb3/iwch_ev.c iwch_qp_add_ref(&qhp->ibqp); qhp 141 drivers/infiniband/hw/cxgb3/iwch_ev.c __func__, qhp->wq.qpid, qhp->ep); qhp 142 drivers/infiniband/hw/cxgb3/iwch_ev.c iwch_ep_disconnect(qhp->ep, 0, GFP_ATOMIC); qhp 145 drivers/infiniband/hw/cxgb3/iwch_ev.c qhp->wq.qpid); qhp 148 drivers/infiniband/hw/cxgb3/iwch_ev.c iwch_ep_disconnect(qhp->ep, 0, GFP_ATOMIC); qhp 175 drivers/infiniband/hw/cxgb3/iwch_ev.c if (qhp->ep && SQ_TYPE(rsp_msg->cqe)) qhp 176 drivers/infiniband/hw/cxgb3/iwch_ev.c dst_confirm(qhp->ep->dst); qhp 222 drivers/infiniband/hw/cxgb3/iwch_ev.c CQE_STATUS(rsp_msg->cqe), qhp->wq.qpid); qhp 229 drivers/infiniband/hw/cxgb3/iwch_ev.c iwch_qp_rem_ref(&qhp->ibqp); qhp 668 drivers/infiniband/hw/cxgb3/iwch_provider.c struct iwch_qp *qhp; qhp 672 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp = to_iwch_qp(ib_qp); qhp 673 drivers/infiniband/hw/cxgb3/iwch_provider.c rhp = qhp->rhp; qhp 676 drivers/infiniband/hw/cxgb3/iwch_provider.c iwch_modify_qp(rhp, qhp, IWCH_QP_ATTR_NEXT_STATE, &attrs, 0); qhp 677 drivers/infiniband/hw/cxgb3/iwch_provider.c wait_event(qhp->wait, !qhp->ep); qhp 679 drivers/infiniband/hw/cxgb3/iwch_provider.c xa_erase_irq(&rhp->qps, qhp->wq.qpid); qhp 681 drivers/infiniband/hw/cxgb3/iwch_provider.c atomic_dec(&qhp->refcnt); qhp 682 drivers/infiniband/hw/cxgb3/iwch_provider.c wait_event(qhp->wait, !atomic_read(&qhp->refcnt)); qhp 686 drivers/infiniband/hw/cxgb3/iwch_provider.c cxio_destroy_qp(&rhp->rdev, &qhp->wq, qhp 690 drivers/infiniband/hw/cxgb3/iwch_provider.c ib_qp, qhp->wq.qpid, qhp); qhp 691 drivers/infiniband/hw/cxgb3/iwch_provider.c kfree(qhp); qhp 700 drivers/infiniband/hw/cxgb3/iwch_provider.c struct iwch_qp *qhp; qhp 752 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp = kzalloc(sizeof(*qhp), GFP_KERNEL); qhp 753 drivers/infiniband/hw/cxgb3/iwch_provider.c if (!qhp) qhp 755 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->wq.size_log2 = ilog2(wqsize); qhp 756 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->wq.rq_size_log2 = ilog2(rqsize); qhp 757 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->wq.sq_size_log2 = ilog2(sqsize); qhp 758 drivers/infiniband/hw/cxgb3/iwch_provider.c if (cxio_create_qp(&rhp->rdev, !udata, &qhp->wq, qhp 760 drivers/infiniband/hw/cxgb3/iwch_provider.c kfree(qhp); qhp 768 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->rhp = rhp; qhp 769 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.pd = php->pdid; qhp 770 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.scq = ((struct iwch_cq *) attrs->send_cq)->cq.cqid; qhp 771 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.rcq = ((struct iwch_cq *) attrs->recv_cq)->cq.cqid; qhp 772 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.sq_num_entries = attrs->cap.max_send_wr; qhp 773 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.rq_num_entries = attrs->cap.max_recv_wr; qhp 774 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.sq_max_sges = attrs->cap.max_send_sge; qhp 775 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.sq_max_sges_rdma_write = attrs->cap.max_send_sge; qhp 776 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.rq_max_sges = attrs->cap.max_recv_sge; qhp 777 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.state = IWCH_QP_STATE_IDLE; qhp 778 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.next_state = IWCH_QP_STATE_IDLE; qhp 785 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.enable_rdma_read = 1; qhp 786 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.enable_rdma_write = 1; qhp 787 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.enable_bind = 1; qhp 788 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.max_ord = 1; qhp 789 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->attr.max_ird = 1; qhp 791 drivers/infiniband/hw/cxgb3/iwch_provider.c spin_lock_init(&qhp->lock); qhp 792 drivers/infiniband/hw/cxgb3/iwch_provider.c init_waitqueue_head(&qhp->wait); qhp 793 drivers/infiniband/hw/cxgb3/iwch_provider.c atomic_set(&qhp->refcnt, 1); qhp 795 drivers/infiniband/hw/cxgb3/iwch_provider.c if (xa_store_irq(&rhp->qps, qhp->wq.qpid, qhp, GFP_KERNEL)) { qhp 796 drivers/infiniband/hw/cxgb3/iwch_provider.c cxio_destroy_qp(&rhp->rdev, &qhp->wq, qhp 798 drivers/infiniband/hw/cxgb3/iwch_provider.c kfree(qhp); qhp 808 drivers/infiniband/hw/cxgb3/iwch_provider.c iwch_destroy_qp(&qhp->ibqp, udata); qhp 815 drivers/infiniband/hw/cxgb3/iwch_provider.c iwch_destroy_qp(&qhp->ibqp, udata); qhp 819 drivers/infiniband/hw/cxgb3/iwch_provider.c uresp.qpid = qhp->wq.qpid; qhp 820 drivers/infiniband/hw/cxgb3/iwch_provider.c uresp.size_log2 = qhp->wq.size_log2; qhp 821 drivers/infiniband/hw/cxgb3/iwch_provider.c uresp.sq_size_log2 = qhp->wq.sq_size_log2; qhp 822 drivers/infiniband/hw/cxgb3/iwch_provider.c uresp.rq_size_log2 = qhp->wq.rq_size_log2; qhp 832 drivers/infiniband/hw/cxgb3/iwch_provider.c iwch_destroy_qp(&qhp->ibqp, udata); qhp 836 drivers/infiniband/hw/cxgb3/iwch_provider.c mm1->addr = virt_to_phys(qhp->wq.queue); qhp 840 drivers/infiniband/hw/cxgb3/iwch_provider.c mm2->addr = qhp->wq.udb & PAGE_MASK; qhp 844 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->ibqp.qp_num = qhp->wq.qpid; qhp 847 drivers/infiniband/hw/cxgb3/iwch_provider.c __func__, qhp->attr.sq_num_entries, qhp->attr.rq_num_entries, qhp 848 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->wq.qpid, qhp, &qhp->wq.dma_addr, 1 << qhp->wq.size_log2, qhp 849 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp->wq.rq_addr); qhp 850 drivers/infiniband/hw/cxgb3/iwch_provider.c return &qhp->ibqp; qhp 857 drivers/infiniband/hw/cxgb3/iwch_provider.c struct iwch_qp *qhp; qhp 871 drivers/infiniband/hw/cxgb3/iwch_provider.c qhp = to_iwch_qp(ibqp); qhp 872 drivers/infiniband/hw/cxgb3/iwch_provider.c rhp = qhp->rhp; qhp 888 drivers/infiniband/hw/cxgb3/iwch_provider.c return iwch_modify_qp(rhp, qhp, mask, &attrs, 0); qhp 173 drivers/infiniband/hw/cxgb3/iwch_provider.h static inline int qp_quiesced(struct iwch_qp *qhp) qhp 175 drivers/infiniband/hw/cxgb3/iwch_provider.h return qhp->flags & QP_QUIESCED; qhp 261 drivers/infiniband/hw/cxgb3/iwch_provider.h struct iwch_qp *qhp, qhp 328 drivers/infiniband/hw/cxgb3/iwch_provider.h u16 iwch_rqes_posted(struct iwch_qp *qhp); qhp 334 drivers/infiniband/hw/cxgb3/iwch_provider.h int iwch_post_terminate(struct iwch_qp *qhp, struct respQ_msg_t *rsp_msg); qhp 338 drivers/infiniband/hw/cxgb3/iwch_provider.h void stop_read_rep_timer(struct iwch_qp *qhp); qhp 248 drivers/infiniband/hw/cxgb3/iwch_qp.c static int build_rdma_recv(struct iwch_qp *qhp, union t3_wr *wqe, qhp 255 drivers/infiniband/hw/cxgb3/iwch_qp.c err = iwch_sgl2pbl_map(qhp->rhp, wr->sg_list, wr->num_sge, pbl_addr, qhp 281 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.rq[Q_PTR2IDX(qhp->wq.rq_wptr, qhp 282 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.rq_size_log2)].wr_id = wr->wr_id; qhp 283 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.rq[Q_PTR2IDX(qhp->wq.rq_wptr, qhp 284 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.rq_size_log2)].pbl_addr = 0; qhp 288 drivers/infiniband/hw/cxgb3/iwch_qp.c static int build_zero_stag_recv(struct iwch_qp *qhp, union t3_wr *wqe, qhp 302 drivers/infiniband/hw/cxgb3/iwch_qp.c pbl_addr = cxio_hal_pblpool_alloc(&qhp->rhp->rdev, T3_STAG0_PBL_SIZE); qhp 309 drivers/infiniband/hw/cxgb3/iwch_qp.c pbl_offset = (pbl_addr - qhp->rhp->rdev.rnic_info.pbl_base) >> 3; qhp 344 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.rq[Q_PTR2IDX(qhp->wq.rq_wptr, qhp 345 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.rq_size_log2)].wr_id = wr->wr_id; qhp 346 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.rq[Q_PTR2IDX(qhp->wq.rq_wptr, qhp 347 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.rq_size_log2)].pbl_addr = pbl_addr; qhp 358 drivers/infiniband/hw/cxgb3/iwch_qp.c struct iwch_qp *qhp; qhp 366 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp = to_iwch_qp(ibqp); qhp 367 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_lock_irqsave(&qhp->lock, flag); qhp 368 drivers/infiniband/hw/cxgb3/iwch_qp.c if (qhp->attr.state > IWCH_QP_STATE_RTS) { qhp 369 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 373 drivers/infiniband/hw/cxgb3/iwch_qp.c num_wrs = Q_FREECNT(qhp->wq.sq_rptr, qhp->wq.sq_wptr, qhp 374 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.sq_size_log2); qhp 376 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 385 drivers/infiniband/hw/cxgb3/iwch_qp.c idx = Q_PTR2IDX(qhp->wq.wptr, qhp->wq.size_log2); qhp 386 drivers/infiniband/hw/cxgb3/iwch_qp.c wqe = (union t3_wr *) (qhp->wq.queue + idx); qhp 392 drivers/infiniband/hw/cxgb3/iwch_qp.c sqp = qhp->wq.sq + qhp 393 drivers/infiniband/hw/cxgb3/iwch_qp.c Q_PTR2IDX(qhp->wq.sq_wptr, qhp->wq.sq_size_log2); qhp 415 drivers/infiniband/hw/cxgb3/iwch_qp.c if (!qhp->wq.oldest_read) qhp 416 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.oldest_read = sqp; qhp 421 drivers/infiniband/hw/cxgb3/iwch_qp.c &wr_cnt, &qhp->wq); qhp 436 drivers/infiniband/hw/cxgb3/iwch_qp.c wqe->send.wrid.id0.hi = qhp->wq.sq_wptr; qhp 439 drivers/infiniband/hw/cxgb3/iwch_qp.c sqp->sq_wptr = qhp->wq.sq_wptr; qhp 444 drivers/infiniband/hw/cxgb3/iwch_qp.c Q_GENBIT(qhp->wq.wptr, qhp->wq.size_log2), qhp 449 drivers/infiniband/hw/cxgb3/iwch_qp.c Q_PTR2IDX(qhp->wq.sq_wptr, qhp->wq.sq_size_log2), qhp 453 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.wptr += wr_cnt; qhp 454 drivers/infiniband/hw/cxgb3/iwch_qp.c ++(qhp->wq.sq_wptr); qhp 456 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 457 drivers/infiniband/hw/cxgb3/iwch_qp.c if (cxio_wq_db_enabled(&qhp->wq)) qhp 458 drivers/infiniband/hw/cxgb3/iwch_qp.c ring_doorbell(qhp->wq.doorbell, qhp->wq.qpid); qhp 470 drivers/infiniband/hw/cxgb3/iwch_qp.c struct iwch_qp *qhp; qhp 476 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp = to_iwch_qp(ibqp); qhp 477 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_lock_irqsave(&qhp->lock, flag); qhp 478 drivers/infiniband/hw/cxgb3/iwch_qp.c if (qhp->attr.state > IWCH_QP_STATE_RTS) { qhp 479 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 483 drivers/infiniband/hw/cxgb3/iwch_qp.c num_wrs = Q_FREECNT(qhp->wq.rq_rptr, qhp->wq.rq_wptr, qhp 484 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.rq_size_log2) - 1; qhp 486 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 495 drivers/infiniband/hw/cxgb3/iwch_qp.c idx = Q_PTR2IDX(qhp->wq.wptr, qhp->wq.size_log2); qhp 496 drivers/infiniband/hw/cxgb3/iwch_qp.c wqe = (union t3_wr *) (qhp->wq.queue + idx); qhp 499 drivers/infiniband/hw/cxgb3/iwch_qp.c err = build_rdma_recv(qhp, wqe, wr); qhp 501 drivers/infiniband/hw/cxgb3/iwch_qp.c err = build_zero_stag_recv(qhp, wqe, wr); qhp 509 drivers/infiniband/hw/cxgb3/iwch_qp.c Q_GENBIT(qhp->wq.wptr, qhp->wq.size_log2), qhp 513 drivers/infiniband/hw/cxgb3/iwch_qp.c idx, qhp->wq.rq_wptr, qhp->wq.rq_rptr, wqe); qhp 514 drivers/infiniband/hw/cxgb3/iwch_qp.c ++(qhp->wq.rq_wptr); qhp 515 drivers/infiniband/hw/cxgb3/iwch_qp.c ++(qhp->wq.wptr); qhp 519 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 520 drivers/infiniband/hw/cxgb3/iwch_qp.c if (cxio_wq_db_enabled(&qhp->wq)) qhp 521 drivers/infiniband/hw/cxgb3/iwch_qp.c ring_doorbell(qhp->wq.doorbell, qhp->wq.qpid); qhp 692 drivers/infiniband/hw/cxgb3/iwch_qp.c int iwch_post_terminate(struct iwch_qp *qhp, struct respQ_msg_t *rsp_msg) qhp 715 drivers/infiniband/hw/cxgb3/iwch_qp.c wqe->send.wrh.gen_tid_len = cpu_to_be32(V_FW_RIWR_TID(qhp->ep->hwtid)); qhp 717 drivers/infiniband/hw/cxgb3/iwch_qp.c return iwch_cxgb3_ofld_send(qhp->rhp->rdev.t3cdev_p, skb); qhp 723 drivers/infiniband/hw/cxgb3/iwch_qp.c static void __flush_qp(struct iwch_qp *qhp, struct iwch_cq *rchp, qhp 725 drivers/infiniband/hw/cxgb3/iwch_qp.c __releases(&qhp->lock) qhp 726 drivers/infiniband/hw/cxgb3/iwch_qp.c __acquires(&qhp->lock) qhp 731 drivers/infiniband/hw/cxgb3/iwch_qp.c lockdep_assert_held(&qhp->lock); qhp 733 drivers/infiniband/hw/cxgb3/iwch_qp.c pr_debug("%s qhp %p rchp %p schp %p\n", __func__, qhp, rchp, schp); qhp 735 drivers/infiniband/hw/cxgb3/iwch_qp.c atomic_inc(&qhp->refcnt); qhp 736 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock(&qhp->lock); qhp 740 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_lock(&qhp->lock); qhp 742 drivers/infiniband/hw/cxgb3/iwch_qp.c cxio_count_rcqes(&rchp->cq, &qhp->wq, &count); qhp 743 drivers/infiniband/hw/cxgb3/iwch_qp.c flushed = cxio_flush_rq(&qhp->wq, &rchp->cq, count); qhp 744 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock(&qhp->lock); qhp 754 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_lock(&qhp->lock); qhp 756 drivers/infiniband/hw/cxgb3/iwch_qp.c cxio_count_scqes(&schp->cq, &qhp->wq, &count); qhp 757 drivers/infiniband/hw/cxgb3/iwch_qp.c flushed = cxio_flush_sq(&qhp->wq, &schp->cq, count); qhp 758 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock(&qhp->lock); qhp 767 drivers/infiniband/hw/cxgb3/iwch_qp.c if (atomic_dec_and_test(&qhp->refcnt)) qhp 768 drivers/infiniband/hw/cxgb3/iwch_qp.c wake_up(&qhp->wait); qhp 770 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_lock(&qhp->lock); qhp 773 drivers/infiniband/hw/cxgb3/iwch_qp.c static void flush_qp(struct iwch_qp *qhp) qhp 777 drivers/infiniband/hw/cxgb3/iwch_qp.c rchp = get_chp(qhp->rhp, qhp->attr.rcq); qhp 778 drivers/infiniband/hw/cxgb3/iwch_qp.c schp = get_chp(qhp->rhp, qhp->attr.scq); qhp 780 drivers/infiniband/hw/cxgb3/iwch_qp.c if (qhp->ibqp.uobject) { qhp 781 drivers/infiniband/hw/cxgb3/iwch_qp.c cxio_set_wq_in_error(&qhp->wq); qhp 795 drivers/infiniband/hw/cxgb3/iwch_qp.c __flush_qp(qhp, rchp, schp); qhp 802 drivers/infiniband/hw/cxgb3/iwch_qp.c u16 iwch_rqes_posted(struct iwch_qp *qhp) qhp 804 drivers/infiniband/hw/cxgb3/iwch_qp.c union t3_wr *wqe = qhp->wq.queue; qhp 811 drivers/infiniband/hw/cxgb3/iwch_qp.c pr_debug("%s qhp %p count %u\n", __func__, qhp, count); qhp 815 drivers/infiniband/hw/cxgb3/iwch_qp.c static int rdma_init(struct iwch_dev *rhp, struct iwch_qp *qhp, qhp 822 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.tid = qhp->ep->hwtid; qhp 823 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.qpid = qhp->wq.qpid; qhp 824 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.pdid = qhp->attr.pd; qhp 825 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.scqid = qhp->attr.scq; qhp 826 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.rcqid = qhp->attr.rcq; qhp 827 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.rq_addr = qhp->wq.rq_addr; qhp 828 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.rq_size = 1 << qhp->wq.rq_size_log2; qhp 830 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.mpa_attr.recv_marker_enabled | qhp 831 drivers/infiniband/hw/cxgb3/iwch_qp.c (qhp->attr.mpa_attr.xmit_marker_enabled << 1) | qhp 832 drivers/infiniband/hw/cxgb3/iwch_qp.c (qhp->attr.mpa_attr.crc_enabled << 2); qhp 837 drivers/infiniband/hw/cxgb3/iwch_qp.c if (!qhp->ibqp.uobject) qhp 841 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.tcp_emss = qhp->ep->emss; qhp 842 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.ord = qhp->attr.max_ord; qhp 843 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.ird = qhp->attr.max_ird; qhp 844 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.qp_dma_addr = qhp->wq.dma_addr; qhp 845 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.qp_dma_size = (1UL << qhp->wq.size_log2); qhp 846 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.rqe_count = iwch_rqes_posted(qhp); qhp 847 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.flags = qhp->attr.mpa_attr.initiator ? MPA_INITIATOR : 0; qhp 848 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.chan = qhp->ep->l2t->smt_idx; qhp 851 drivers/infiniband/hw/cxgb3/iwch_qp.c if (init_attr.ord == 0 && qhp->attr.mpa_attr.initiator) qhp 853 drivers/infiniband/hw/cxgb3/iwch_qp.c if (init_attr.ird == 0 && !qhp->attr.mpa_attr.initiator) qhp 857 drivers/infiniband/hw/cxgb3/iwch_qp.c init_attr.irs = qhp->ep->rcv_seq; qhp 867 drivers/infiniband/hw/cxgb3/iwch_qp.c int iwch_modify_qp(struct iwch_dev *rhp, struct iwch_qp *qhp, qhp 873 drivers/infiniband/hw/cxgb3/iwch_qp.c struct iwch_qp_attributes newattr = qhp->attr; qhp 882 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp, qhp->wq.qpid, qhp->ep, qhp->attr.state, qhp 885 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_lock_irqsave(&qhp->lock, flag); qhp 889 drivers/infiniband/hw/cxgb3/iwch_qp.c if (qhp->attr.state != IWCH_QP_STATE_IDLE) { qhp 915 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr = newattr; qhp 920 drivers/infiniband/hw/cxgb3/iwch_qp.c if (qhp->attr.state == attrs->next_state) qhp 923 drivers/infiniband/hw/cxgb3/iwch_qp.c switch (qhp->attr.state) { qhp 935 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.mpa_attr = attrs->mpa_attr; qhp 936 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.llp_stream_handle = attrs->llp_stream_handle; qhp 937 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->ep = qhp->attr.llp_stream_handle; qhp 938 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.state = IWCH_QP_STATE_RTS; qhp 946 drivers/infiniband/hw/cxgb3/iwch_qp.c get_ep(&qhp->ep->com); qhp 947 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 948 drivers/infiniband/hw/cxgb3/iwch_qp.c ret = rdma_init(rhp, qhp, mask, attrs); qhp 949 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_lock_irqsave(&qhp->lock, flag); qhp 954 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.state = IWCH_QP_STATE_ERROR; qhp 955 drivers/infiniband/hw/cxgb3/iwch_qp.c flush_qp(qhp); qhp 965 drivers/infiniband/hw/cxgb3/iwch_qp.c BUG_ON(kref_read(&qhp->ep->com.kref) < 2); qhp 966 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.state = IWCH_QP_STATE_CLOSING; qhp 970 drivers/infiniband/hw/cxgb3/iwch_qp.c ep = qhp->ep; qhp 975 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.state = IWCH_QP_STATE_TERMINATE; qhp 976 drivers/infiniband/hw/cxgb3/iwch_qp.c if (qhp->ibqp.uobject) qhp 977 drivers/infiniband/hw/cxgb3/iwch_qp.c cxio_set_wq_in_error(&qhp->wq); qhp 982 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.state = IWCH_QP_STATE_ERROR; qhp 986 drivers/infiniband/hw/cxgb3/iwch_qp.c ep = qhp->ep; qhp 1003 drivers/infiniband/hw/cxgb3/iwch_qp.c flush_qp(qhp); qhp 1004 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.state = IWCH_QP_STATE_IDLE; qhp 1005 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.llp_stream_handle = NULL; qhp 1006 drivers/infiniband/hw/cxgb3/iwch_qp.c put_ep(&qhp->ep->com); qhp 1007 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->ep = NULL; qhp 1008 drivers/infiniband/hw/cxgb3/iwch_qp.c wake_up(&qhp->wait); qhp 1023 drivers/infiniband/hw/cxgb3/iwch_qp.c if (!Q_EMPTY(qhp->wq.sq_rptr, qhp->wq.sq_wptr) || qhp 1024 drivers/infiniband/hw/cxgb3/iwch_qp.c !Q_EMPTY(qhp->wq.rq_rptr, qhp->wq.rq_wptr)) { qhp 1028 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.state = IWCH_QP_STATE_IDLE; qhp 1038 drivers/infiniband/hw/cxgb3/iwch_qp.c pr_err("%s in a bad state %d\n", __func__, qhp->attr.state); qhp 1045 drivers/infiniband/hw/cxgb3/iwch_qp.c pr_debug("%s disassociating ep %p qpid 0x%x\n", __func__, qhp->ep, qhp 1046 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->wq.qpid); qhp 1049 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.llp_stream_handle = NULL; qhp 1050 drivers/infiniband/hw/cxgb3/iwch_qp.c ep = qhp->ep; qhp 1051 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->ep = NULL; qhp 1052 drivers/infiniband/hw/cxgb3/iwch_qp.c qhp->attr.state = IWCH_QP_STATE_ERROR; qhp 1054 drivers/infiniband/hw/cxgb3/iwch_qp.c wake_up(&qhp->wait); qhp 1056 drivers/infiniband/hw/cxgb3/iwch_qp.c flush_qp(qhp); qhp 1058 drivers/infiniband/hw/cxgb3/iwch_qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1061 drivers/infiniband/hw/cxgb3/iwch_qp.c iwch_post_terminate(qhp, NULL); qhp 1080 drivers/infiniband/hw/cxgb3/iwch_qp.c pr_debug("%s exit state %d\n", __func__, qhp->attr.state); qhp 238 drivers/infiniband/hw/cxgb4/cq.c int c4iw_flush_sq(struct c4iw_qp *qhp) qhp 241 drivers/infiniband/hw/cxgb4/cq.c struct t4_wq *wq = &qhp->wq; qhp 242 drivers/infiniband/hw/cxgb4/cq.c struct c4iw_cq *chp = to_c4iw_cq(qhp->ibqp.send_cq); qhp 338 drivers/infiniband/hw/cxgb4/cq.c struct c4iw_qp *qhp; qhp 351 drivers/infiniband/hw/cxgb4/cq.c qhp = get_qhp(chp->rhp, CQE_QPID(hw_cqe)); qhp 356 drivers/infiniband/hw/cxgb4/cq.c if (qhp == NULL) qhp 359 drivers/infiniband/hw/cxgb4/cq.c if (flush_qhp != qhp) { qhp 360 drivers/infiniband/hw/cxgb4/cq.c spin_lock(&qhp->lock); qhp 362 drivers/infiniband/hw/cxgb4/cq.c if (qhp->wq.flushed == 1) qhp 386 drivers/infiniband/hw/cxgb4/cq.c if (!qhp->wq.sq.oldest_read->signaled) { qhp 387 drivers/infiniband/hw/cxgb4/cq.c advance_oldest_read(&qhp->wq); qhp 395 drivers/infiniband/hw/cxgb4/cq.c create_read_req_cqe(&qhp->wq, hw_cqe, &read_cqe); qhp 397 drivers/infiniband/hw/cxgb4/cq.c advance_oldest_read(&qhp->wq); qhp 404 drivers/infiniband/hw/cxgb4/cq.c swsqe = &qhp->wq.sq.sw_sq[CQE_WRID_SQ_IDX(hw_cqe)]; qhp 407 drivers/infiniband/hw/cxgb4/cq.c flush_completed_wrs(&qhp->wq, &chp->cq); qhp 417 drivers/infiniband/hw/cxgb4/cq.c if (qhp && flush_qhp != qhp) qhp 418 drivers/infiniband/hw/cxgb4/cq.c spin_unlock(&qhp->lock); qhp 754 drivers/infiniband/hw/cxgb4/cq.c static int __c4iw_poll_cq_one(struct c4iw_cq *chp, struct c4iw_qp *qhp, qhp 758 drivers/infiniband/hw/cxgb4/cq.c struct t4_wq *wq = qhp ? &qhp->wq : NULL; qhp 770 drivers/infiniband/hw/cxgb4/cq.c wc->qp = qhp ? &qhp->ibqp : NULL; qhp 803 drivers/infiniband/hw/cxgb4/cq.c c4iw_invalidate_mr(qhp->rhp, wc->ex.invalidate_rkey); qhp 844 drivers/infiniband/hw/cxgb4/cq.c c4iw_invalidate_mr(qhp->rhp, qhp 924 drivers/infiniband/hw/cxgb4/cq.c struct c4iw_qp *qhp = NULL; qhp 933 drivers/infiniband/hw/cxgb4/cq.c qhp = get_qhp(chp->rhp, CQE_QPID(rd_cqe)); qhp 934 drivers/infiniband/hw/cxgb4/cq.c if (qhp) { qhp 935 drivers/infiniband/hw/cxgb4/cq.c spin_lock(&qhp->lock); qhp 936 drivers/infiniband/hw/cxgb4/cq.c srq = qhp->srq; qhp 939 drivers/infiniband/hw/cxgb4/cq.c ret = __c4iw_poll_cq_one(chp, qhp, wc, srq); qhp 940 drivers/infiniband/hw/cxgb4/cq.c spin_unlock(&qhp->lock); qhp 1166 drivers/infiniband/hw/cxgb4/cq.c void c4iw_flush_srqidx(struct c4iw_qp *qhp, u32 srqidx) qhp 1168 drivers/infiniband/hw/cxgb4/cq.c struct c4iw_cq *rchp = to_c4iw_cq(qhp->ibqp.recv_cq); qhp 1173 drivers/infiniband/hw/cxgb4/cq.c spin_lock(&qhp->lock); qhp 1176 drivers/infiniband/hw/cxgb4/cq.c insert_recv_cqe(&qhp->wq, &rchp->cq, srqidx); qhp 1178 drivers/infiniband/hw/cxgb4/cq.c spin_unlock(&qhp->lock); qhp 88 drivers/infiniband/hw/cxgb4/ev.c struct c4iw_qp *qhp, qhp 98 drivers/infiniband/hw/cxgb4/ev.c if (qhp->attr.state == C4IW_QP_STATE_RTS) { qhp 100 drivers/infiniband/hw/cxgb4/ev.c c4iw_modify_qp(qhp->rhp, qhp, C4IW_QP_ATTR_NEXT_STATE, qhp 109 drivers/infiniband/hw/cxgb4/ev.c event.element.qp = &qhp->ibqp; qhp 110 drivers/infiniband/hw/cxgb4/ev.c if (qhp->ibqp.event_handler) qhp 111 drivers/infiniband/hw/cxgb4/ev.c (*qhp->ibqp.event_handler)(&event, qhp->ibqp.qp_context); qhp 123 drivers/infiniband/hw/cxgb4/ev.c struct c4iw_qp *qhp; qhp 127 drivers/infiniband/hw/cxgb4/ev.c qhp = xa_load(&dev->qps, CQE_QPID(err_cqe)); qhp 128 drivers/infiniband/hw/cxgb4/ev.c if (!qhp) { qhp 139 drivers/infiniband/hw/cxgb4/ev.c cqid = qhp->attr.scq; qhp 141 drivers/infiniband/hw/cxgb4/ev.c cqid = qhp->attr.rcq; qhp 153 drivers/infiniband/hw/cxgb4/ev.c c4iw_qp_add_ref(&qhp->ibqp); qhp 160 drivers/infiniband/hw/cxgb4/ev.c post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_QP_REQ_ERR); qhp 179 drivers/infiniband/hw/cxgb4/ev.c post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_QP_ACCESS_ERR); qhp 186 drivers/infiniband/hw/cxgb4/ev.c post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_DEVICE_FATAL); qhp 206 drivers/infiniband/hw/cxgb4/ev.c post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_QP_FATAL); qhp 211 drivers/infiniband/hw/cxgb4/ev.c CQE_STATUS(err_cqe), qhp->wq.sq.qid); qhp 212 drivers/infiniband/hw/cxgb4/ev.c post_qp_event(dev, chp, qhp, err_cqe, IB_EVENT_QP_FATAL); qhp 218 drivers/infiniband/hw/cxgb4/ev.c c4iw_qp_rem_ref(&qhp->ibqp); qhp 604 drivers/infiniband/hw/cxgb4/iw_cxgb4.h struct c4iw_qp *qhp, qhp 1024 drivers/infiniband/hw/cxgb4/iw_cxgb4.h int c4iw_flush_sq(struct c4iw_qp *qhp); qhp 1026 drivers/infiniband/hw/cxgb4/iw_cxgb4.h u16 c4iw_rqes_posted(struct c4iw_qp *qhp); qhp 1027 drivers/infiniband/hw/cxgb4/iw_cxgb4.h int c4iw_post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe); qhp 1051 drivers/infiniband/hw/cxgb4/iw_cxgb4.h void c4iw_flush_srqidx(struct c4iw_qp *qhp, u32 srqidx); qhp 87 drivers/infiniband/hw/cxgb4/qp.c static void set_state(struct c4iw_qp *qhp, enum c4iw_qp_state state) qhp 90 drivers/infiniband/hw/cxgb4/qp.c spin_lock_irqsave(&qhp->lock, flag); qhp 91 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.state = state; qhp 92 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 689 drivers/infiniband/hw/cxgb4/qp.c static void post_write_cmpl(struct c4iw_qp *qhp, const struct ib_send_wr *wr) qhp 692 drivers/infiniband/hw/cxgb4/qp.c qhp->sq_sig_all; qhp 694 drivers/infiniband/hw/cxgb4/qp.c qhp->sq_sig_all; qhp 705 drivers/infiniband/hw/cxgb4/qp.c wqe = (union t4_wr *)((u8 *)qhp->wq.sq.queue + qhp 706 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.wq_pidx * T4_EQ_ENTRY_SIZE); qhp 707 drivers/infiniband/hw/cxgb4/qp.c build_rdma_write_cmpl(&qhp->wq.sq, &wqe->write_cmpl, wr, &len16); qhp 710 drivers/infiniband/hw/cxgb4/qp.c swsqe = &qhp->wq.sq.sw_sq[qhp->wq.sq.pidx]; qhp 712 drivers/infiniband/hw/cxgb4/qp.c swsqe->idx = qhp->wq.sq.pidx; qhp 719 drivers/infiniband/hw/cxgb4/qp.c cxgb4_read_sge_timestamp(qhp->rhp->rdev.lldi.ports[0]); qhp 723 drivers/infiniband/hw/cxgb4/qp.c write_wrid = qhp->wq.sq.pidx; qhp 726 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.in_use++; qhp 727 drivers/infiniband/hw/cxgb4/qp.c if (++qhp->wq.sq.pidx == qhp->wq.sq.size) qhp 728 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.pidx = 0; qhp 731 drivers/infiniband/hw/cxgb4/qp.c swsqe = &qhp->wq.sq.sw_sq[qhp->wq.sq.pidx]; qhp 736 drivers/infiniband/hw/cxgb4/qp.c swsqe->idx = qhp->wq.sq.pidx; qhp 743 drivers/infiniband/hw/cxgb4/qp.c cxgb4_read_sge_timestamp(qhp->rhp->rdev.lldi.ports[0]); qhp 748 drivers/infiniband/hw/cxgb4/qp.c wqe->write_cmpl.wrid_send = qhp->wq.sq.pidx; qhp 752 drivers/infiniband/hw/cxgb4/qp.c t4_sq_produce(&qhp->wq, len16); qhp 755 drivers/infiniband/hw/cxgb4/qp.c t4_ring_sq_db(&qhp->wq, idx, wqe); qhp 758 drivers/infiniband/hw/cxgb4/qp.c static int build_rdma_recv(struct c4iw_qp *qhp, union t4_recv_wr *wqe, qhp 763 drivers/infiniband/hw/cxgb4/qp.c ret = build_isgl((__be64 *)qhp->wq.rq.queue, qhp 764 drivers/infiniband/hw/cxgb4/qp.c (__be64 *)&qhp->wq.rq.queue[qhp->wq.rq.size], qhp 911 drivers/infiniband/hw/cxgb4/qp.c static int ring_kernel_sq_db(struct c4iw_qp *qhp, u16 inc) qhp 915 drivers/infiniband/hw/cxgb4/qp.c xa_lock_irqsave(&qhp->rhp->qps, flags); qhp 916 drivers/infiniband/hw/cxgb4/qp.c spin_lock(&qhp->lock); qhp 917 drivers/infiniband/hw/cxgb4/qp.c if (qhp->rhp->db_state == NORMAL) qhp 918 drivers/infiniband/hw/cxgb4/qp.c t4_ring_sq_db(&qhp->wq, inc, NULL); qhp 920 drivers/infiniband/hw/cxgb4/qp.c add_to_fc_list(&qhp->rhp->db_fc_list, &qhp->db_fc_entry); qhp 921 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.wq_pidx_inc += inc; qhp 923 drivers/infiniband/hw/cxgb4/qp.c spin_unlock(&qhp->lock); qhp 924 drivers/infiniband/hw/cxgb4/qp.c xa_unlock_irqrestore(&qhp->rhp->qps, flags); qhp 928 drivers/infiniband/hw/cxgb4/qp.c static int ring_kernel_rq_db(struct c4iw_qp *qhp, u16 inc) qhp 932 drivers/infiniband/hw/cxgb4/qp.c xa_lock_irqsave(&qhp->rhp->qps, flags); qhp 933 drivers/infiniband/hw/cxgb4/qp.c spin_lock(&qhp->lock); qhp 934 drivers/infiniband/hw/cxgb4/qp.c if (qhp->rhp->db_state == NORMAL) qhp 935 drivers/infiniband/hw/cxgb4/qp.c t4_ring_rq_db(&qhp->wq, inc, NULL); qhp 937 drivers/infiniband/hw/cxgb4/qp.c add_to_fc_list(&qhp->rhp->db_fc_list, &qhp->db_fc_entry); qhp 938 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.rq.wq_pidx_inc += inc; qhp 940 drivers/infiniband/hw/cxgb4/qp.c spin_unlock(&qhp->lock); qhp 941 drivers/infiniband/hw/cxgb4/qp.c xa_unlock_irqrestore(&qhp->rhp->qps, flags); qhp 978 drivers/infiniband/hw/cxgb4/qp.c static int complete_sq_drain_wr(struct c4iw_qp *qhp, qhp 987 drivers/infiniband/hw/cxgb4/qp.c schp = to_c4iw_cq(qhp->ibqp.send_cq); qhp 1000 drivers/infiniband/hw/cxgb4/qp.c CQE_QPID_V(qhp->wq.sq.qid)); qhp 1017 drivers/infiniband/hw/cxgb4/qp.c static int complete_sq_drain_wrs(struct c4iw_qp *qhp, qhp 1024 drivers/infiniband/hw/cxgb4/qp.c ret = complete_sq_drain_wr(qhp, wr); qhp 1034 drivers/infiniband/hw/cxgb4/qp.c static void complete_rq_drain_wr(struct c4iw_qp *qhp, qhp 1042 drivers/infiniband/hw/cxgb4/qp.c rchp = to_c4iw_cq(qhp->ibqp.recv_cq); qhp 1051 drivers/infiniband/hw/cxgb4/qp.c CQE_QPID_V(qhp->wq.sq.qid)); qhp 1067 drivers/infiniband/hw/cxgb4/qp.c static void complete_rq_drain_wrs(struct c4iw_qp *qhp, qhp 1071 drivers/infiniband/hw/cxgb4/qp.c complete_rq_drain_wr(qhp, wr); qhp 1083 drivers/infiniband/hw/cxgb4/qp.c struct c4iw_qp *qhp; qhp 1091 drivers/infiniband/hw/cxgb4/qp.c qhp = to_c4iw_qp(ibqp); qhp 1092 drivers/infiniband/hw/cxgb4/qp.c rhp = qhp->rhp; qhp 1093 drivers/infiniband/hw/cxgb4/qp.c spin_lock_irqsave(&qhp->lock, flag); qhp 1099 drivers/infiniband/hw/cxgb4/qp.c if (qhp->wq.flushed) { qhp 1100 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1101 drivers/infiniband/hw/cxgb4/qp.c err = complete_sq_drain_wrs(qhp, wr, bad_wr); qhp 1104 drivers/infiniband/hw/cxgb4/qp.c num_wrs = t4_sq_avail(&qhp->wq); qhp 1106 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1120 drivers/infiniband/hw/cxgb4/qp.c if (qhp->rhp->rdev.lldi.write_cmpl_support && qhp 1121 drivers/infiniband/hw/cxgb4/qp.c CHELSIO_CHIP_VERSION(qhp->rhp->rdev.lldi.adapter_type) >= qhp 1130 drivers/infiniband/hw/cxgb4/qp.c post_write_cmpl(qhp, wr); qhp 1131 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1141 drivers/infiniband/hw/cxgb4/qp.c wqe = (union t4_wr *)((u8 *)qhp->wq.sq.queue + qhp 1142 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.wq_pidx * T4_EQ_ENTRY_SIZE); qhp 1147 drivers/infiniband/hw/cxgb4/qp.c if (wr->send_flags & IB_SEND_SIGNALED || qhp->sq_sig_all) qhp 1149 drivers/infiniband/hw/cxgb4/qp.c swsqe = &qhp->wq.sq.sw_sq[qhp->wq.sq.pidx]; qhp 1160 drivers/infiniband/hw/cxgb4/qp.c err = build_rdma_send(&qhp->wq.sq, wqe, wr, &len16); qhp 1172 drivers/infiniband/hw/cxgb4/qp.c err = build_rdma_write(&qhp->wq.sq, wqe, wr, &len16); qhp 1188 drivers/infiniband/hw/cxgb4/qp.c if (!qhp->wq.sq.oldest_read) qhp 1189 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.oldest_read = swsqe; qhp 1202 drivers/infiniband/hw/cxgb4/qp.c err = build_memreg(&qhp->wq.sq, wqe, reg_wr(wr), qhp 1228 drivers/infiniband/hw/cxgb4/qp.c swsqe->idx = qhp->wq.sq.pidx; qhp 1231 drivers/infiniband/hw/cxgb4/qp.c qhp->sq_sig_all; qhp 1240 drivers/infiniband/hw/cxgb4/qp.c init_wr_hdr(wqe, qhp->wq.sq.pidx, fw_opcode, fw_flags, len16); qhp 1243 drivers/infiniband/hw/cxgb4/qp.c (unsigned long long)wr->wr_id, qhp->wq.sq.pidx, qhp 1247 drivers/infiniband/hw/cxgb4/qp.c t4_sq_produce(&qhp->wq, len16); qhp 1251 drivers/infiniband/hw/cxgb4/qp.c t4_ring_sq_db(&qhp->wq, idx, wqe); qhp 1252 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1254 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1255 drivers/infiniband/hw/cxgb4/qp.c ring_kernel_sq_db(qhp, idx); qhp 1264 drivers/infiniband/hw/cxgb4/qp.c struct c4iw_qp *qhp; qhp 1271 drivers/infiniband/hw/cxgb4/qp.c qhp = to_c4iw_qp(ibqp); qhp 1272 drivers/infiniband/hw/cxgb4/qp.c spin_lock_irqsave(&qhp->lock, flag); qhp 1278 drivers/infiniband/hw/cxgb4/qp.c if (qhp->wq.flushed) { qhp 1279 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1280 drivers/infiniband/hw/cxgb4/qp.c complete_rq_drain_wrs(qhp, wr); qhp 1283 drivers/infiniband/hw/cxgb4/qp.c num_wrs = t4_rq_avail(&qhp->wq); qhp 1285 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1295 drivers/infiniband/hw/cxgb4/qp.c wqe = (union t4_recv_wr *)((u8 *)qhp->wq.rq.queue + qhp 1296 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.rq.wq_pidx * qhp 1299 drivers/infiniband/hw/cxgb4/qp.c err = build_rdma_recv(qhp, wqe, wr, &len16); qhp 1307 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.rq.sw_rq[qhp->wq.rq.pidx].wr_id = wr->wr_id; qhp 1309 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.rq.sw_rq[qhp->wq.rq.pidx].sge_ts = qhp 1311 drivers/infiniband/hw/cxgb4/qp.c qhp->rhp->rdev.lldi.ports[0]); qhp 1312 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.rq.sw_rq[qhp->wq.rq.pidx].host_time = qhp 1318 drivers/infiniband/hw/cxgb4/qp.c wqe->recv.wrid = qhp->wq.rq.pidx; qhp 1324 drivers/infiniband/hw/cxgb4/qp.c (unsigned long long)wr->wr_id, qhp->wq.rq.pidx); qhp 1325 drivers/infiniband/hw/cxgb4/qp.c t4_rq_produce(&qhp->wq, len16); qhp 1330 drivers/infiniband/hw/cxgb4/qp.c if (!qhp->rhp->rdev.status_page->db_off) { qhp 1331 drivers/infiniband/hw/cxgb4/qp.c t4_ring_rq_db(&qhp->wq, idx, wqe); qhp 1332 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1334 drivers/infiniband/hw/cxgb4/qp.c spin_unlock_irqrestore(&qhp->lock, flag); qhp 1335 drivers/infiniband/hw/cxgb4/qp.c ring_kernel_rq_db(qhp, idx); qhp 1559 drivers/infiniband/hw/cxgb4/qp.c static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe, qhp 1566 drivers/infiniband/hw/cxgb4/qp.c pr_debug("qhp %p qid 0x%x tid %u\n", qhp, qhp->wq.sq.qid, qhp 1567 drivers/infiniband/hw/cxgb4/qp.c qhp->ep->hwtid); qhp 1569 drivers/infiniband/hw/cxgb4/qp.c skb = skb_dequeue(&qhp->ep->com.ep_skb_list); qhp 1573 drivers/infiniband/hw/cxgb4/qp.c set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx); qhp 1578 drivers/infiniband/hw/cxgb4/qp.c FW_WR_FLOWID_V(qhp->ep->hwtid) | qhp 1584 drivers/infiniband/hw/cxgb4/qp.c if (qhp->attr.layer_etype == (LAYER_MPA|DDP_LLP)) { qhp 1585 drivers/infiniband/hw/cxgb4/qp.c term->layer_etype = qhp->attr.layer_etype; qhp 1586 drivers/infiniband/hw/cxgb4/qp.c term->ecode = qhp->attr.ecode; qhp 1589 drivers/infiniband/hw/cxgb4/qp.c c4iw_ofld_send(&qhp->rhp->rdev, skb); qhp 1595 drivers/infiniband/hw/cxgb4/qp.c static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp, qhp 1602 drivers/infiniband/hw/cxgb4/qp.c pr_debug("qhp %p rchp %p schp %p\n", qhp, rchp, schp); qhp 1608 drivers/infiniband/hw/cxgb4/qp.c spin_lock(&qhp->lock); qhp 1610 drivers/infiniband/hw/cxgb4/qp.c if (qhp->wq.flushed) { qhp 1611 drivers/infiniband/hw/cxgb4/qp.c spin_unlock(&qhp->lock); qhp 1617 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.flushed = 1; qhp 1618 drivers/infiniband/hw/cxgb4/qp.c t4_set_wq_in_error(&qhp->wq, 0); qhp 1620 drivers/infiniband/hw/cxgb4/qp.c c4iw_flush_hw_cq(rchp, qhp); qhp 1621 drivers/infiniband/hw/cxgb4/qp.c if (!qhp->srq) { qhp 1622 drivers/infiniband/hw/cxgb4/qp.c c4iw_count_rcqes(&rchp->cq, &qhp->wq, &count); qhp 1623 drivers/infiniband/hw/cxgb4/qp.c rq_flushed = c4iw_flush_rq(&qhp->wq, &rchp->cq, count); qhp 1627 drivers/infiniband/hw/cxgb4/qp.c c4iw_flush_hw_cq(schp, qhp); qhp 1628 drivers/infiniband/hw/cxgb4/qp.c sq_flushed = c4iw_flush_sq(qhp); qhp 1630 drivers/infiniband/hw/cxgb4/qp.c spin_unlock(&qhp->lock); qhp 1659 drivers/infiniband/hw/cxgb4/qp.c static void flush_qp(struct c4iw_qp *qhp) qhp 1664 drivers/infiniband/hw/cxgb4/qp.c rchp = to_c4iw_cq(qhp->ibqp.recv_cq); qhp 1665 drivers/infiniband/hw/cxgb4/qp.c schp = to_c4iw_cq(qhp->ibqp.send_cq); qhp 1667 drivers/infiniband/hw/cxgb4/qp.c if (qhp->ibqp.uobject) { qhp 1670 drivers/infiniband/hw/cxgb4/qp.c if (qhp->wq.flushed) qhp 1673 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.flushed = 1; qhp 1674 drivers/infiniband/hw/cxgb4/qp.c t4_set_wq_in_error(&qhp->wq, 0); qhp 1688 drivers/infiniband/hw/cxgb4/qp.c __flush_qp(qhp, rchp, schp); qhp 1691 drivers/infiniband/hw/cxgb4/qp.c static int rdma_fini(struct c4iw_dev *rhp, struct c4iw_qp *qhp, qhp 1698 drivers/infiniband/hw/cxgb4/qp.c pr_debug("qhp %p qid 0x%x tid %u\n", qhp, qhp->wq.sq.qid, ep->hwtid); qhp 1718 drivers/infiniband/hw/cxgb4/qp.c qhp->ep->hwtid, qhp->wq.sq.qid, __func__); qhp 1748 drivers/infiniband/hw/cxgb4/qp.c static int rdma_init(struct c4iw_dev *rhp, struct c4iw_qp *qhp) qhp 1754 drivers/infiniband/hw/cxgb4/qp.c pr_debug("qhp %p qid 0x%x tid %u ird %u ord %u\n", qhp, qhp 1755 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.qid, qhp->ep->hwtid, qhp->ep->ird, qhp->ep->ord); qhp 1762 drivers/infiniband/hw/cxgb4/qp.c ret = alloc_ird(rhp, qhp->attr.max_ird); qhp 1764 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.max_ird = 0; qhp 1768 drivers/infiniband/hw/cxgb4/qp.c set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx); qhp 1775 drivers/infiniband/hw/cxgb4/qp.c FW_WR_FLOWID_V(qhp->ep->hwtid) | qhp 1778 drivers/infiniband/hw/cxgb4/qp.c wqe->cookie = (uintptr_t)qhp->ep->com.wr_waitp; qhp 1782 drivers/infiniband/hw/cxgb4/qp.c FW_RI_WR_MPAREQBIT_V(qhp->attr.mpa_attr.initiator) | qhp 1783 drivers/infiniband/hw/cxgb4/qp.c FW_RI_WR_P2PTYPE_V(qhp->attr.mpa_attr.p2p_type); qhp 1785 drivers/infiniband/hw/cxgb4/qp.c if (qhp->attr.mpa_attr.recv_marker_enabled) qhp 1787 drivers/infiniband/hw/cxgb4/qp.c if (qhp->attr.mpa_attr.xmit_marker_enabled) qhp 1789 drivers/infiniband/hw/cxgb4/qp.c if (qhp->attr.mpa_attr.crc_enabled) qhp 1795 drivers/infiniband/hw/cxgb4/qp.c if (!qhp->ibqp.uobject) qhp 1798 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.nrqe = cpu_to_be16(t4_rqes_posted(&qhp->wq)); qhp 1799 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.pdid = cpu_to_be32(qhp->attr.pd); qhp 1800 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.qpid = cpu_to_be32(qhp->wq.sq.qid); qhp 1801 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.sq_eqid = cpu_to_be32(qhp->wq.sq.qid); qhp 1802 drivers/infiniband/hw/cxgb4/qp.c if (qhp->srq) { qhp 1804 drivers/infiniband/hw/cxgb4/qp.c qhp->srq->idx); qhp 1806 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.rq_eqid = cpu_to_be32(qhp->wq.rq.qid); qhp 1807 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.hwrqsize = cpu_to_be32(qhp->wq.rq.rqt_size); qhp 1808 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.hwrqaddr = cpu_to_be32(qhp->wq.rq.rqt_hwaddr - qhp 1811 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.scqid = cpu_to_be32(qhp->attr.scq); qhp 1812 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.rcqid = cpu_to_be32(qhp->attr.rcq); qhp 1813 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.ord_max = cpu_to_be32(qhp->attr.max_ord); qhp 1814 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.ird_max = cpu_to_be32(qhp->attr.max_ird); qhp 1815 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.iss = cpu_to_be32(qhp->ep->snd_seq); qhp 1816 drivers/infiniband/hw/cxgb4/qp.c wqe->u.init.irs = cpu_to_be32(qhp->ep->rcv_seq); qhp 1817 drivers/infiniband/hw/cxgb4/qp.c if (qhp->attr.mpa_attr.initiator) qhp 1818 drivers/infiniband/hw/cxgb4/qp.c build_rtr_msg(qhp->attr.mpa_attr.p2p_type, &wqe->u.init); qhp 1820 drivers/infiniband/hw/cxgb4/qp.c ret = c4iw_ref_send_wait(&rhp->rdev, skb, qhp->ep->com.wr_waitp, qhp 1821 drivers/infiniband/hw/cxgb4/qp.c qhp->ep->hwtid, qhp->wq.sq.qid, __func__); qhp 1825 drivers/infiniband/hw/cxgb4/qp.c free_ird(rhp, qhp->attr.max_ird); qhp 1831 drivers/infiniband/hw/cxgb4/qp.c int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp, qhp 1837 drivers/infiniband/hw/cxgb4/qp.c struct c4iw_qp_attributes newattr = qhp->attr; qhp 1845 drivers/infiniband/hw/cxgb4/qp.c qhp, qhp->wq.sq.qid, qhp->wq.rq.qid, qhp->ep, qhp->attr.state, qhp 1848 drivers/infiniband/hw/cxgb4/qp.c mutex_lock(&qhp->mutex); qhp 1852 drivers/infiniband/hw/cxgb4/qp.c if (qhp->attr.state != C4IW_QP_STATE_IDLE) { qhp 1876 drivers/infiniband/hw/cxgb4/qp.c qhp->attr = newattr; qhp 1880 drivers/infiniband/hw/cxgb4/qp.c ret = ring_kernel_sq_db(qhp, attrs->sq_db_inc); qhp 1884 drivers/infiniband/hw/cxgb4/qp.c ret = ring_kernel_rq_db(qhp, attrs->rq_db_inc); qhp 1890 drivers/infiniband/hw/cxgb4/qp.c if (qhp->attr.state == attrs->next_state) qhp 1893 drivers/infiniband/hw/cxgb4/qp.c switch (qhp->attr.state) { qhp 1905 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.mpa_attr = attrs->mpa_attr; qhp 1906 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.llp_stream_handle = attrs->llp_stream_handle; qhp 1907 drivers/infiniband/hw/cxgb4/qp.c qhp->ep = qhp->attr.llp_stream_handle; qhp 1908 drivers/infiniband/hw/cxgb4/qp.c set_state(qhp, C4IW_QP_STATE_RTS); qhp 1916 drivers/infiniband/hw/cxgb4/qp.c c4iw_get_ep(&qhp->ep->com); qhp 1917 drivers/infiniband/hw/cxgb4/qp.c ret = rdma_init(rhp, qhp); qhp 1922 drivers/infiniband/hw/cxgb4/qp.c set_state(qhp, C4IW_QP_STATE_ERROR); qhp 1923 drivers/infiniband/hw/cxgb4/qp.c flush_qp(qhp); qhp 1933 drivers/infiniband/hw/cxgb4/qp.c t4_set_wq_in_error(&qhp->wq, 0); qhp 1934 drivers/infiniband/hw/cxgb4/qp.c set_state(qhp, C4IW_QP_STATE_CLOSING); qhp 1935 drivers/infiniband/hw/cxgb4/qp.c ep = qhp->ep; qhp 1939 drivers/infiniband/hw/cxgb4/qp.c c4iw_get_ep(&qhp->ep->com); qhp 1941 drivers/infiniband/hw/cxgb4/qp.c ret = rdma_fini(rhp, qhp, ep); qhp 1946 drivers/infiniband/hw/cxgb4/qp.c t4_set_wq_in_error(&qhp->wq, 0); qhp 1947 drivers/infiniband/hw/cxgb4/qp.c set_state(qhp, C4IW_QP_STATE_TERMINATE); qhp 1948 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.layer_etype = attrs->layer_etype; qhp 1949 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.ecode = attrs->ecode; qhp 1950 drivers/infiniband/hw/cxgb4/qp.c ep = qhp->ep; qhp 1956 drivers/infiniband/hw/cxgb4/qp.c terminate = qhp->attr.send_term; qhp 1957 drivers/infiniband/hw/cxgb4/qp.c ret = rdma_fini(rhp, qhp, ep); qhp 1963 drivers/infiniband/hw/cxgb4/qp.c t4_set_wq_in_error(&qhp->wq, 0); qhp 1964 drivers/infiniband/hw/cxgb4/qp.c set_state(qhp, C4IW_QP_STATE_ERROR); qhp 1968 drivers/infiniband/hw/cxgb4/qp.c ep = qhp->ep; qhp 1969 drivers/infiniband/hw/cxgb4/qp.c c4iw_get_ep(&qhp->ep->com); qhp 1983 drivers/infiniband/hw/cxgb4/qp.c if (!internal && (qhp->ibqp.uobject || attrs->next_state != qhp 1990 drivers/infiniband/hw/cxgb4/qp.c flush_qp(qhp); qhp 1991 drivers/infiniband/hw/cxgb4/qp.c set_state(qhp, C4IW_QP_STATE_IDLE); qhp 1992 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.llp_stream_handle = NULL; qhp 1993 drivers/infiniband/hw/cxgb4/qp.c c4iw_put_ep(&qhp->ep->com); qhp 1994 drivers/infiniband/hw/cxgb4/qp.c qhp->ep = NULL; qhp 1995 drivers/infiniband/hw/cxgb4/qp.c wake_up(&qhp->wait); qhp 2009 drivers/infiniband/hw/cxgb4/qp.c if (!t4_sq_empty(&qhp->wq) || !t4_rq_empty(&qhp->wq)) { qhp 2013 drivers/infiniband/hw/cxgb4/qp.c set_state(qhp, C4IW_QP_STATE_IDLE); qhp 2023 drivers/infiniband/hw/cxgb4/qp.c pr_err("%s in a bad state %d\n", __func__, qhp->attr.state); qhp 2030 drivers/infiniband/hw/cxgb4/qp.c pr_debug("disassociating ep %p qpid 0x%x\n", qhp->ep, qhp 2031 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.qid); qhp 2034 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.llp_stream_handle = NULL; qhp 2036 drivers/infiniband/hw/cxgb4/qp.c ep = qhp->ep; qhp 2037 drivers/infiniband/hw/cxgb4/qp.c qhp->ep = NULL; qhp 2038 drivers/infiniband/hw/cxgb4/qp.c set_state(qhp, C4IW_QP_STATE_ERROR); qhp 2041 drivers/infiniband/hw/cxgb4/qp.c flush_qp(qhp); qhp 2042 drivers/infiniband/hw/cxgb4/qp.c wake_up(&qhp->wait); qhp 2044 drivers/infiniband/hw/cxgb4/qp.c mutex_unlock(&qhp->mutex); qhp 2047 drivers/infiniband/hw/cxgb4/qp.c post_terminate(qhp, NULL, internal ? GFP_ATOMIC : GFP_KERNEL); qhp 2066 drivers/infiniband/hw/cxgb4/qp.c pr_debug("exit state %d\n", qhp->attr.state); qhp 2073 drivers/infiniband/hw/cxgb4/qp.c struct c4iw_qp *qhp; qhp 2077 drivers/infiniband/hw/cxgb4/qp.c qhp = to_c4iw_qp(ib_qp); qhp 2078 drivers/infiniband/hw/cxgb4/qp.c rhp = qhp->rhp; qhp 2079 drivers/infiniband/hw/cxgb4/qp.c ucontext = qhp->ucontext; qhp 2082 drivers/infiniband/hw/cxgb4/qp.c if (qhp->attr.state == C4IW_QP_STATE_TERMINATE) qhp 2083 drivers/infiniband/hw/cxgb4/qp.c c4iw_modify_qp(rhp, qhp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); qhp 2085 drivers/infiniband/hw/cxgb4/qp.c c4iw_modify_qp(rhp, qhp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); qhp 2086 drivers/infiniband/hw/cxgb4/qp.c wait_event(qhp->wait, !qhp->ep); qhp 2089 drivers/infiniband/hw/cxgb4/qp.c __xa_erase(&rhp->qps, qhp->wq.sq.qid); qhp 2090 drivers/infiniband/hw/cxgb4/qp.c if (!list_empty(&qhp->db_fc_entry)) qhp 2091 drivers/infiniband/hw/cxgb4/qp.c list_del_init(&qhp->db_fc_entry); qhp 2093 drivers/infiniband/hw/cxgb4/qp.c free_ird(rhp, qhp->attr.max_ird); qhp 2097 drivers/infiniband/hw/cxgb4/qp.c wait_for_completion(&qhp->qp_rel_comp); qhp 2099 drivers/infiniband/hw/cxgb4/qp.c pr_debug("ib_qp %p qpid 0x%0x\n", ib_qp, qhp->wq.sq.qid); qhp 2100 drivers/infiniband/hw/cxgb4/qp.c pr_debug("qhp %p ucontext %p\n", qhp, ucontext); qhp 2102 drivers/infiniband/hw/cxgb4/qp.c destroy_qp(&rhp->rdev, &qhp->wq, qhp 2103 drivers/infiniband/hw/cxgb4/qp.c ucontext ? &ucontext->uctx : &rhp->rdev.uctx, !qhp->srq); qhp 2105 drivers/infiniband/hw/cxgb4/qp.c c4iw_put_wr_wait(qhp->wr_waitp); qhp 2107 drivers/infiniband/hw/cxgb4/qp.c kfree(qhp); qhp 2115 drivers/infiniband/hw/cxgb4/qp.c struct c4iw_qp *qhp; qhp 2156 drivers/infiniband/hw/cxgb4/qp.c qhp = kzalloc(sizeof(*qhp), GFP_KERNEL); qhp 2157 drivers/infiniband/hw/cxgb4/qp.c if (!qhp) qhp 2160 drivers/infiniband/hw/cxgb4/qp.c qhp->wr_waitp = c4iw_alloc_wr_wait(GFP_KERNEL); qhp 2161 drivers/infiniband/hw/cxgb4/qp.c if (!qhp->wr_waitp) { qhp 2166 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.size = sqsize; qhp 2167 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.memsize = qhp 2169 drivers/infiniband/hw/cxgb4/qp.c sizeof(*qhp->wq.sq.queue) + 16 * sizeof(__be64); qhp 2170 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.flush_cidx = -1; qhp 2172 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.rq.size = rqsize; qhp 2173 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.rq.memsize = qhp 2175 drivers/infiniband/hw/cxgb4/qp.c sizeof(*qhp->wq.rq.queue); qhp 2179 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.memsize = roundup(qhp->wq.sq.memsize, PAGE_SIZE); qhp 2181 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.rq.memsize = qhp 2182 drivers/infiniband/hw/cxgb4/qp.c roundup(qhp->wq.rq.memsize, PAGE_SIZE); qhp 2185 drivers/infiniband/hw/cxgb4/qp.c ret = create_qp(&rhp->rdev, &qhp->wq, &schp->cq, &rchp->cq, qhp 2187 drivers/infiniband/hw/cxgb4/qp.c qhp->wr_waitp, !attrs->srq); qhp 2195 drivers/infiniband/hw/cxgb4/qp.c qhp->rhp = rhp; qhp 2196 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.pd = php->pdid; qhp 2197 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.scq = ((struct c4iw_cq *) attrs->send_cq)->cq.cqid; qhp 2198 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.rcq = ((struct c4iw_cq *) attrs->recv_cq)->cq.cqid; qhp 2199 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.sq_num_entries = attrs->cap.max_send_wr; qhp 2200 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.sq_max_sges = attrs->cap.max_send_sge; qhp 2201 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.sq_max_sges_rdma_write = attrs->cap.max_send_sge; qhp 2203 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.rq_num_entries = attrs->cap.max_recv_wr; qhp 2204 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.rq_max_sges = attrs->cap.max_recv_sge; qhp 2206 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.state = C4IW_QP_STATE_IDLE; qhp 2207 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.next_state = C4IW_QP_STATE_IDLE; qhp 2208 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.enable_rdma_read = 1; qhp 2209 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.enable_rdma_write = 1; qhp 2210 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.enable_bind = 1; qhp 2211 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.max_ord = 0; qhp 2212 drivers/infiniband/hw/cxgb4/qp.c qhp->attr.max_ird = 0; qhp 2213 drivers/infiniband/hw/cxgb4/qp.c qhp->sq_sig_all = attrs->sq_sig_type == IB_SIGNAL_ALL_WR; qhp 2214 drivers/infiniband/hw/cxgb4/qp.c spin_lock_init(&qhp->lock); qhp 2215 drivers/infiniband/hw/cxgb4/qp.c mutex_init(&qhp->mutex); qhp 2216 drivers/infiniband/hw/cxgb4/qp.c init_waitqueue_head(&qhp->wait); qhp 2217 drivers/infiniband/hw/cxgb4/qp.c init_completion(&qhp->qp_rel_comp); qhp 2218 drivers/infiniband/hw/cxgb4/qp.c refcount_set(&qhp->qp_refcnt, 1); qhp 2220 drivers/infiniband/hw/cxgb4/qp.c ret = xa_insert_irq(&rhp->qps, qhp->wq.sq.qid, qhp, GFP_KERNEL); qhp 2251 drivers/infiniband/hw/cxgb4/qp.c if (t4_sq_onchip(&qhp->wq.sq)) { qhp 2263 drivers/infiniband/hw/cxgb4/qp.c uresp.sqid = qhp->wq.sq.qid; qhp 2264 drivers/infiniband/hw/cxgb4/qp.c uresp.sq_size = qhp->wq.sq.size; qhp 2265 drivers/infiniband/hw/cxgb4/qp.c uresp.sq_memsize = qhp->wq.sq.memsize; qhp 2267 drivers/infiniband/hw/cxgb4/qp.c uresp.rqid = qhp->wq.rq.qid; qhp 2268 drivers/infiniband/hw/cxgb4/qp.c uresp.rq_size = qhp->wq.rq.size; qhp 2269 drivers/infiniband/hw/cxgb4/qp.c uresp.rq_memsize = qhp->wq.rq.memsize; qhp 2293 drivers/infiniband/hw/cxgb4/qp.c sq_key_mm->addr = qhp->wq.sq.phys_addr; qhp 2294 drivers/infiniband/hw/cxgb4/qp.c sq_key_mm->len = PAGE_ALIGN(qhp->wq.sq.memsize); qhp 2298 drivers/infiniband/hw/cxgb4/qp.c rq_key_mm->addr = virt_to_phys(qhp->wq.rq.queue); qhp 2299 drivers/infiniband/hw/cxgb4/qp.c rq_key_mm->len = PAGE_ALIGN(qhp->wq.rq.memsize); qhp 2303 drivers/infiniband/hw/cxgb4/qp.c sq_db_key_mm->addr = (u64)(unsigned long)qhp->wq.sq.bar2_pa; qhp 2309 drivers/infiniband/hw/cxgb4/qp.c (u64)(unsigned long)qhp->wq.rq.bar2_pa; qhp 2322 drivers/infiniband/hw/cxgb4/qp.c qhp->ucontext = ucontext; qhp 2325 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.qp_errp = qhp 2326 drivers/infiniband/hw/cxgb4/qp.c &qhp->wq.rq.queue[qhp->wq.rq.size].status.qp_err; qhp 2328 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.qp_errp = qhp 2329 drivers/infiniband/hw/cxgb4/qp.c &qhp->wq.sq.queue[qhp->wq.sq.size].status.qp_err; qhp 2330 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.srqidxp = qhp 2331 drivers/infiniband/hw/cxgb4/qp.c &qhp->wq.sq.queue[qhp->wq.sq.size].status.srqidx; qhp 2334 drivers/infiniband/hw/cxgb4/qp.c qhp->ibqp.qp_num = qhp->wq.sq.qid; qhp 2336 drivers/infiniband/hw/cxgb4/qp.c qhp->srq = to_c4iw_srq(attrs->srq); qhp 2337 drivers/infiniband/hw/cxgb4/qp.c INIT_LIST_HEAD(&qhp->db_fc_entry); qhp 2339 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.sq.qid, qhp->wq.sq.size, qhp->wq.sq.memsize, qhp 2340 drivers/infiniband/hw/cxgb4/qp.c attrs->cap.max_send_wr, qhp->wq.rq.qid, qhp->wq.rq.size, qhp 2341 drivers/infiniband/hw/cxgb4/qp.c qhp->wq.rq.memsize, attrs->cap.max_recv_wr); qhp 2342 drivers/infiniband/hw/cxgb4/qp.c return &qhp->ibqp; qhp 2356 drivers/infiniband/hw/cxgb4/qp.c xa_erase_irq(&rhp->qps, qhp->wq.sq.qid); qhp 2358 drivers/infiniband/hw/cxgb4/qp.c destroy_qp(&rhp->rdev, &qhp->wq, qhp 2361 drivers/infiniband/hw/cxgb4/qp.c c4iw_put_wr_wait(qhp->wr_waitp); qhp 2363 drivers/infiniband/hw/cxgb4/qp.c kfree(qhp); qhp 2371 drivers/infiniband/hw/cxgb4/qp.c struct c4iw_qp *qhp; qhp 2385 drivers/infiniband/hw/cxgb4/qp.c qhp = to_c4iw_qp(ibqp); qhp 2386 drivers/infiniband/hw/cxgb4/qp.c rhp = qhp->rhp; qhp 2415 drivers/infiniband/hw/cxgb4/qp.c return c4iw_modify_qp(rhp, qhp, mask, &attrs, 0); qhp 2466 drivers/infiniband/hw/cxgb4/qp.c struct c4iw_qp *qhp = to_c4iw_qp(ibqp); qhp 2470 drivers/infiniband/hw/cxgb4/qp.c attr->qp_state = to_ib_qp_state(qhp->attr.state); qhp 2471 drivers/infiniband/hw/cxgb4/qp.c init_attr->cap.max_send_wr = qhp->attr.sq_num_entries; qhp 2472 drivers/infiniband/hw/cxgb4/qp.c init_attr->cap.max_recv_wr = qhp->attr.rq_num_entries; qhp 2473 drivers/infiniband/hw/cxgb4/qp.c init_attr->cap.max_send_sge = qhp->attr.sq_max_sges; qhp 2474 drivers/infiniband/hw/cxgb4/qp.c init_attr->cap.max_recv_sge = qhp->attr.sq_max_sges; qhp 2476 drivers/infiniband/hw/cxgb4/qp.c init_attr->sq_sig_type = qhp->sq_sig_all ? IB_SIGNAL_ALL_WR : 0; qhp 142 drivers/infiniband/hw/cxgb4/restrack.c struct c4iw_qp *qhp = to_c4iw_qp(ibqp); qhp 149 drivers/infiniband/hw/cxgb4/restrack.c if (qhp->ucontext) qhp 157 drivers/infiniband/hw/cxgb4/restrack.c spin_lock_irq(&qhp->lock); qhp 158 drivers/infiniband/hw/cxgb4/restrack.c wq = qhp->wq; qhp 163 drivers/infiniband/hw/cxgb4/restrack.c first_sqe = qhp->wq.sq.sw_sq[first_sq_idx]; qhp 169 drivers/infiniband/hw/cxgb4/restrack.c last_sqe = qhp->wq.sq.sw_sq[last_sq_idx]; qhp 173 drivers/infiniband/hw/cxgb4/restrack.c spin_unlock_irq(&qhp->lock);