Lines Matching refs:srq

38 	struct rvt_srq *srq = ibsrq_to_rvtsrq(ibsrq);  in rvt_create_srq()  local
54 srq->rq.size = srq_init_attr->attr.max_wr + 1; in rvt_create_srq()
55 srq->rq.max_sge = srq_init_attr->attr.max_sge; in rvt_create_srq()
56 sz = sizeof(struct ib_sge) * srq->rq.max_sge + in rvt_create_srq()
58 if (rvt_alloc_rq(&srq->rq, srq->rq.size * sz, in rvt_create_srq()
69 u32 s = sizeof(struct rvt_rwq) + srq->rq.size * sz; in rvt_create_srq()
71 srq->ip = rvt_create_mmap_info(dev, s, udata, srq->rq.wq); in rvt_create_srq()
72 if (IS_ERR(srq->ip)) { in rvt_create_srq()
73 ret = PTR_ERR(srq->ip); in rvt_create_srq()
77 ret = ib_copy_to_udata(udata, &srq->ip->offset, in rvt_create_srq()
78 sizeof(srq->ip->offset)); in rvt_create_srq()
86 spin_lock_init(&srq->rq.lock); in rvt_create_srq()
87 srq->limit = srq_init_attr->attr.srq_limit; in rvt_create_srq()
99 if (srq->ip) { in rvt_create_srq()
101 list_add(&srq->ip->pending_mmaps, &dev->pending_mmaps); in rvt_create_srq()
108 kfree(srq->ip); in rvt_create_srq()
110 rvt_free_rq(&srq->rq); in rvt_create_srq()
128 struct rvt_srq *srq = ibsrq_to_rvtsrq(ibsrq); in rvt_modify_srq() local
142 attr->srq_limit : srq->limit) > attr->max_wr) in rvt_modify_srq()
145 srq->rq.max_sge * sizeof(struct ib_sge); in rvt_modify_srq()
167 spin_lock_irq(&srq->rq.kwq->c_lock); in rvt_modify_srq()
173 owq = srq->rq.wq; in rvt_modify_srq()
177 okwq = srq->rq.kwq; in rvt_modify_srq()
181 if (head >= srq->rq.size || tail >= srq->rq.size) { in rvt_modify_srq()
187 n += srq->rq.size - tail; in rvt_modify_srq()
200 wqe = rvt_get_rwqe_ptr(&srq->rq, tail); in rvt_modify_srq()
207 if (++tail >= srq->rq.size) in rvt_modify_srq()
210 srq->rq.kwq = tmp_rq.kwq; in rvt_modify_srq()
212 srq->rq.wq = tmp_rq.wq; in rvt_modify_srq()
219 srq->rq.size = size; in rvt_modify_srq()
221 srq->limit = attr->srq_limit; in rvt_modify_srq()
222 spin_unlock_irq(&srq->rq.kwq->c_lock); in rvt_modify_srq()
227 if (srq->ip) { in rvt_modify_srq()
228 struct rvt_mmap_info *ip = srq->ip; in rvt_modify_srq()
229 struct rvt_dev_info *dev = ib_to_rvt(srq->ibsrq.device); in rvt_modify_srq()
256 spin_lock_irq(&srq->rq.kwq->c_lock); in rvt_modify_srq()
257 if (attr->srq_limit >= srq->rq.size) in rvt_modify_srq()
260 srq->limit = attr->srq_limit; in rvt_modify_srq()
261 spin_unlock_irq(&srq->rq.kwq->c_lock); in rvt_modify_srq()
266 spin_unlock_irq(&srq->rq.kwq->c_lock); in rvt_modify_srq()
281 struct rvt_srq *srq = ibsrq_to_rvtsrq(ibsrq); in rvt_query_srq() local
283 attr->max_wr = srq->rq.size - 1; in rvt_query_srq()
284 attr->max_sge = srq->rq.max_sge; in rvt_query_srq()
285 attr->srq_limit = srq->limit; in rvt_query_srq()
296 struct rvt_srq *srq = ibsrq_to_rvtsrq(ibsrq); in rvt_destroy_srq() local
302 if (srq->ip) in rvt_destroy_srq()
303 kref_put(&srq->ip->ref, rvt_release_mmap_info); in rvt_destroy_srq()
304 kvfree(srq->rq.kwq); in rvt_destroy_srq()