Lines Matching refs:srq

65 	struct pvrdma_srq *srq = to_vsrq(ibsrq);  in pvrdma_query_srq()  local
74 cmd->srq_handle = srq->srq_handle; in pvrdma_query_srq()
102 struct pvrdma_srq *srq = to_vsrq(ibsrq); in pvrdma_create_srq() local
137 spin_lock_init(&srq->lock); in pvrdma_create_srq()
138 refcount_set(&srq->refcnt, 1); in pvrdma_create_srq()
139 init_completion(&srq->free); in pvrdma_create_srq()
149 srq->umem = ib_umem_get(ibsrq->device, ucmd.buf_addr, ucmd.buf_size, 0); in pvrdma_create_srq()
150 if (IS_ERR(srq->umem)) { in pvrdma_create_srq()
151 ret = PTR_ERR(srq->umem); in pvrdma_create_srq()
155 srq->npages = ib_umem_num_dma_blocks(srq->umem, PAGE_SIZE); in pvrdma_create_srq()
157 if (srq->npages < 0 || srq->npages > PVRDMA_PAGE_DIR_MAX_PAGES) { in pvrdma_create_srq()
164 ret = pvrdma_page_dir_init(dev, &srq->pdir, srq->npages, false); in pvrdma_create_srq()
171 pvrdma_page_dir_insert_umem(&srq->pdir, srq->umem, 0); in pvrdma_create_srq()
176 cmd->nchunks = srq->npages; in pvrdma_create_srq()
181 cmd->pdir_dma = srq->pdir.dir_dma; in pvrdma_create_srq()
191 srq->srq_handle = resp->srqn; in pvrdma_create_srq()
194 dev->srq_tbl[srq->srq_handle % dev->dsr->caps.max_srq] = srq; in pvrdma_create_srq()
200 pvrdma_destroy_srq(&srq->ibsrq, udata); in pvrdma_create_srq()
207 pvrdma_page_dir_cleanup(dev, &srq->pdir); in pvrdma_create_srq()
209 ib_umem_release(srq->umem); in pvrdma_create_srq()
216 static void pvrdma_free_srq(struct pvrdma_dev *dev, struct pvrdma_srq *srq) in pvrdma_free_srq() argument
221 dev->srq_tbl[srq->srq_handle] = NULL; in pvrdma_free_srq()
224 if (refcount_dec_and_test(&srq->refcnt)) in pvrdma_free_srq()
225 complete(&srq->free); in pvrdma_free_srq()
226 wait_for_completion(&srq->free); in pvrdma_free_srq()
229 ib_umem_release(srq->umem); in pvrdma_free_srq()
231 pvrdma_page_dir_cleanup(dev, &srq->pdir); in pvrdma_free_srq()
243 int pvrdma_destroy_srq(struct ib_srq *srq, struct ib_udata *udata) in pvrdma_destroy_srq() argument
245 struct pvrdma_srq *vsrq = to_vsrq(srq); in pvrdma_destroy_srq()
248 struct pvrdma_dev *dev = to_vdev(srq->device); in pvrdma_destroy_srq()