Lines Matching refs:rdev
73 dev_warn(&dev->rdev.lldi.pdev->dev, in alloc_ird()
94 static void dealloc_oc_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) in dealloc_oc_sq() argument
96 c4iw_ocqp_pool_free(rdev, sq->dma_addr, sq->memsize); in dealloc_oc_sq()
99 static void dealloc_host_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) in dealloc_host_sq() argument
101 dma_free_coherent(&(rdev->lldi.pdev->dev), sq->memsize, sq->queue, in dealloc_host_sq()
105 static void dealloc_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) in dealloc_sq() argument
108 dealloc_oc_sq(rdev, sq); in dealloc_sq()
110 dealloc_host_sq(rdev, sq); in dealloc_sq()
113 static int alloc_oc_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) in alloc_oc_sq() argument
115 if (!ocqp_support || !ocqp_supported(&rdev->lldi)) in alloc_oc_sq()
117 sq->dma_addr = c4iw_ocqp_pool_alloc(rdev, sq->memsize); in alloc_oc_sq()
120 sq->phys_addr = rdev->oc_mw_pa + sq->dma_addr - in alloc_oc_sq()
121 rdev->lldi.vr->ocq.start; in alloc_oc_sq()
122 sq->queue = (__force union t4_wr *)(rdev->oc_mw_kva + sq->dma_addr - in alloc_oc_sq()
123 rdev->lldi.vr->ocq.start); in alloc_oc_sq()
128 static int alloc_host_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) in alloc_host_sq() argument
130 sq->queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), sq->memsize, in alloc_host_sq()
139 static int alloc_sq(struct c4iw_rdev *rdev, struct t4_sq *sq, int user) in alloc_sq() argument
143 ret = alloc_oc_sq(rdev, sq); in alloc_sq()
145 ret = alloc_host_sq(rdev, sq); in alloc_sq()
149 static int destroy_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, in destroy_qp() argument
156 dma_free_coherent(&(rdev->lldi.pdev->dev), in destroy_qp()
159 dealloc_sq(rdev, &wq->sq); in destroy_qp()
160 c4iw_rqtpool_free(rdev, wq->rq.rqt_hwaddr, wq->rq.rqt_size); in destroy_qp()
163 c4iw_put_qpid(rdev, wq->rq.qid, uctx); in destroy_qp()
164 c4iw_put_qpid(rdev, wq->sq.qid, uctx); in destroy_qp()
168 static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, in create_qp() argument
172 int user = (uctx != &rdev->uctx); in create_qp()
181 wq->sq.qid = c4iw_get_qpid(rdev, uctx); in create_qp()
185 wq->rq.qid = c4iw_get_qpid(rdev, uctx); in create_qp()
211 wq->rq.rqt_hwaddr = c4iw_rqtpool_alloc(rdev, wq->rq.rqt_size); in create_qp()
217 ret = alloc_sq(rdev, &wq->sq, user); in create_qp()
223 wq->rq.queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), in create_qp()
238 wq->db = rdev->lldi.db_reg; in create_qp()
239 wq->gts = rdev->lldi.gts_reg; in create_qp()
240 if (user || is_t5(rdev->lldi.adapter_type)) { in create_qp()
243 off = (wq->sq.qid << rdev->qpshift) & PAGE_MASK; in create_qp()
245 wq->sq.udb = (u64 __iomem *)(rdev->bar2_pa + off); in create_qp()
247 off += 128 * (wq->sq.qid & rdev->qpmask) + 8; in create_qp()
248 wq->sq.udb = (u64 __iomem *)(rdev->bar2_kva + off); in create_qp()
250 off = (wq->rq.qid << rdev->qpshift) & PAGE_MASK; in create_qp()
252 wq->rq.udb = (u64 __iomem *)(rdev->bar2_pa + off); in create_qp()
254 off += 128 * (wq->rq.qid & rdev->qpmask) + 8; in create_qp()
255 wq->rq.udb = (u64 __iomem *)(rdev->bar2_kva + off); in create_qp()
258 wq->rdev = rdev; in create_qp()
287 rdev->hw_queue.t4_eq_status_entries; in create_qp()
313 rdev->hw_queue.t4_eq_status_entries; in create_qp()
332 ret = c4iw_ofld_send(rdev, skb); in create_qp()
335 ret = c4iw_wait_for_reply(rdev, &wr_wait, 0, wq->sq.qid, __func__); in create_qp()
346 dma_free_coherent(&(rdev->lldi.pdev->dev), in create_qp()
350 dealloc_sq(rdev, &wq->sq); in create_qp()
352 c4iw_rqtpool_free(rdev, wq->rq.rqt_hwaddr, wq->rq.rqt_size); in create_qp()
358 c4iw_put_qpid(rdev, wq->rq.qid, uctx); in create_qp()
360 c4iw_put_qpid(rdev, wq->sq.qid, uctx); in create_qp()
696 is_t5(qhp->rhp->rdev.lldi.adapter_type), NULL); in ring_kernel_sq_db()
714 is_t5(qhp->rhp->rdev.lldi.adapter_type), NULL); in ring_kernel_rq_db()
801 qhp->rhp->rdev.lldi.adapter_type) ? in c4iw_post_send()
828 qhp->rhp->rdev.lldi.ports[0]); in c4iw_post_send()
842 if (!qhp->rhp->rdev.status_page->db_off) { in c4iw_post_send()
844 is_t5(qhp->rhp->rdev.lldi.adapter_type), wqe); in c4iw_post_send()
897 qhp->rhp->rdev.lldi.ports[0]); in c4iw_post_receive()
916 if (!qhp->rhp->rdev.status_page->db_off) { in c4iw_post_receive()
918 is_t5(qhp->rhp->rdev.lldi.adapter_type), wqe); in c4iw_post_receive()
1098 c4iw_ofld_send(&qhp->rhp->rdev, skb); in post_terminate()
1215 ret = c4iw_ofld_send(&rhp->rdev, skb); in rdma_fini()
1219 ret = c4iw_wait_for_reply(&rhp->rdev, &ep->com.wr_wait, qhp->ep->hwtid, in rdma_fini()
1315 rhp->rdev.lldi.vr->rq.start); in rdma_init()
1319 ret = c4iw_ofld_send(&rhp->rdev, skb); in rdma_init()
1323 ret = c4iw_wait_for_reply(&rhp->rdev, &qhp->ep->com.wr_wait, in rdma_init()
1600 destroy_qp(&rhp->rdev, &qhp->wq, in c4iw_destroy_qp()
1601 ucontext ? &ucontext->uctx : &rhp->rdev.uctx); in c4iw_destroy_qp()
1637 if (attrs->cap.max_recv_wr > rhp->rdev.hw_queue.t4_max_rq_size) in c4iw_create_qp()
1643 if (attrs->cap.max_send_wr > rhp->rdev.hw_queue.t4_max_sq_size) in c4iw_create_qp()
1656 (sqsize + rhp->rdev.hw_queue.t4_eq_status_entries) * in c4iw_create_qp()
1661 (rqsize + rhp->rdev.hw_queue.t4_eq_status_entries) * in c4iw_create_qp()
1669 ret = create_qp(&rhp->rdev, &qhp->wq, &schp->cq, &rchp->cq, in c4iw_create_qp()
1670 ucontext ? &ucontext->uctx : &rhp->rdev.uctx); in c4iw_create_qp()
1734 uresp.qid_mask = rhp->rdev.qpmask; in c4iw_create_qp()
1778 mm5->addr = (pci_resource_start(rhp->rdev.lldi.pdev, 0) in c4iw_create_qp()
1806 destroy_qp(&rhp->rdev, &qhp->wq, in c4iw_create_qp()
1807 ucontext ? &ucontext->uctx : &rhp->rdev.uctx); in c4iw_create_qp()
1858 if (is_t5(to_c4iw_qp(ibqp)->rhp->rdev.lldi.adapter_type) && in c4iw_ib_modify_qp()