Lines Matching refs:msrq
44 return mlx4_buf_offset(&srq->buf, n << srq->msrq.wqe_shift); in get_wqe()
100 srq->msrq.max = roundup_pow_of_two(init_attr->attr.max_wr + 1); in mlx4_ib_create_srq()
101 srq->msrq.max_gs = init_attr->attr.max_sge; in mlx4_ib_create_srq()
105 srq->msrq.max_gs * in mlx4_ib_create_srq()
107 srq->msrq.wqe_shift = ilog2(desc_size); in mlx4_ib_create_srq()
109 buf_size = srq->msrq.max * desc_size; in mlx4_ib_create_srq()
149 srq->tail = srq->msrq.max - 1; in mlx4_ib_create_srq()
152 for (i = 0; i < srq->msrq.max; ++i) { in mlx4_ib_create_srq()
155 cpu_to_be16((i + 1) & (srq->msrq.max - 1)); in mlx4_ib_create_srq()
172 srq->wrid = kvmalloc_array(srq->msrq.max, in mlx4_ib_create_srq()
186 &srq->mtt, srq->db.dma, &srq->msrq); in mlx4_ib_create_srq()
190 srq->msrq.event = mlx4_ib_srq_event; in mlx4_ib_create_srq()
191 srq->ibsrq.ext.xrc.srq_num = srq->msrq.srqn; in mlx4_ib_create_srq()
194 if (ib_copy_to_udata(udata, &srq->msrq.srqn, sizeof (__u32))) { in mlx4_ib_create_srq()
199 init_attr->attr.max_wr = srq->msrq.max - 1; in mlx4_ib_create_srq()
236 if (attr->srq_limit >= srq->msrq.max) in mlx4_ib_modify_srq()
240 ret = mlx4_srq_arm(dev->dev, &srq->msrq, attr->srq_limit); in mlx4_ib_modify_srq()
257 ret = mlx4_srq_query(dev->dev, &srq->msrq, &limit_watermark); in mlx4_ib_query_srq()
262 srq_attr->max_wr = srq->msrq.max - 1; in mlx4_ib_query_srq()
263 srq_attr->max_sge = srq->msrq.max_gs; in mlx4_ib_query_srq()
271 struct mlx4_ib_srq *msrq = to_msrq(srq); in mlx4_ib_destroy_srq() local
273 mlx4_srq_free(dev->dev, &msrq->msrq); in mlx4_ib_destroy_srq()
274 mlx4_mtt_cleanup(dev->dev, &msrq->mtt); in mlx4_ib_destroy_srq()
282 &msrq->db); in mlx4_ib_destroy_srq()
284 kvfree(msrq->wrid); in mlx4_ib_destroy_srq()
285 mlx4_buf_free(dev->dev, msrq->msrq.max << msrq->msrq.wqe_shift, in mlx4_ib_destroy_srq()
286 &msrq->buf); in mlx4_ib_destroy_srq()
287 mlx4_db_free(dev->dev, &msrq->db); in mlx4_ib_destroy_srq()
289 ib_umem_release(msrq->umem); in mlx4_ib_destroy_srq()
328 if (unlikely(wr->num_sge > srq->msrq.max_gs)) { in mlx4_ib_post_srq_recv()
352 if (i < srq->msrq.max_gs) { in mlx4_ib_post_srq_recv()