Lines Matching refs:srq

46 	struct mlx4_srq *srq;  in mlx4_srq_event()  local
49 srq = radix_tree_lookup(&srq_table->tree, srqn & (dev->caps.num_srqs - 1)); in mlx4_srq_event()
51 if (srq) in mlx4_srq_event()
52 refcount_inc(&srq->refcount); in mlx4_srq_event()
58 srq->event(srq, event_type); in mlx4_srq_event()
60 if (refcount_dec_and_test(&srq->refcount)) in mlx4_srq_event()
61 complete(&srq->free); in mlx4_srq_event()
163 struct mlx4_mtt *mtt, u64 db_rec, struct mlx4_srq *srq) in mlx4_srq_alloc() argument
171 err = mlx4_srq_alloc_icm(dev, &srq->srqn); in mlx4_srq_alloc()
176 err = radix_tree_insert(&srq_table->tree, srq->srqn, srq); in mlx4_srq_alloc()
188 srq_context->state_logsize_srqn = cpu_to_be32((ilog2(srq->max) << 24) | in mlx4_srq_alloc()
189 srq->srqn); in mlx4_srq_alloc()
190 srq_context->logstride = srq->wqe_shift - 4; in mlx4_srq_alloc()
201 err = mlx4_SW2HW_SRQ(dev, mailbox, srq->srqn); in mlx4_srq_alloc()
206 refcount_set(&srq->refcount, 1); in mlx4_srq_alloc()
207 init_completion(&srq->free); in mlx4_srq_alloc()
213 radix_tree_delete(&srq_table->tree, srq->srqn); in mlx4_srq_alloc()
217 mlx4_srq_free_icm(dev, srq->srqn); in mlx4_srq_alloc()
222 void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq) in mlx4_srq_free() argument
227 err = mlx4_HW2SW_SRQ(dev, NULL, srq->srqn); in mlx4_srq_free()
229 mlx4_warn(dev, "HW2SW_SRQ failed (%d) for SRQN %06x\n", err, srq->srqn); in mlx4_srq_free()
232 radix_tree_delete(&srq_table->tree, srq->srqn); in mlx4_srq_free()
235 if (refcount_dec_and_test(&srq->refcount)) in mlx4_srq_free()
236 complete(&srq->free); in mlx4_srq_free()
237 wait_for_completion(&srq->free); in mlx4_srq_free()
239 mlx4_srq_free_icm(dev, srq->srqn); in mlx4_srq_free()
243 int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark) in mlx4_srq_arm() argument
245 return mlx4_ARM_SRQ(dev, srq->srqn, limit_watermark); in mlx4_srq_arm()
249 int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark) in mlx4_srq_query() argument
261 err = mlx4_QUERY_SRQ(dev, mailbox, srq->srqn); in mlx4_srq_query()
295 struct mlx4_srq *srq; in mlx4_srq_lookup() local
298 srq = radix_tree_lookup(&srq_table->tree, in mlx4_srq_lookup()
302 return srq; in mlx4_srq_lookup()