Lines Matching refs:cqn
104 void mlx4_cq_completion(struct mlx4_dev *dev, u32 cqn) in mlx4_cq_completion() argument
110 cqn & (dev->caps.num_cqs - 1)); in mlx4_cq_completion()
114 mlx4_dbg(dev, "Completion event for bogus CQ %08x\n", cqn); in mlx4_cq_completion()
126 void mlx4_cq_event(struct mlx4_dev *dev, u32 cqn, int event_type) in mlx4_cq_event() argument
132 cq = radix_tree_lookup(&cq_table->tree, cqn & (dev->caps.num_cqs - 1)); in mlx4_cq_event()
136 mlx4_dbg(dev, "Async event for bogus CQ %08x\n", cqn); in mlx4_cq_event()
184 err = mlx4_MODIFY_CQ(dev, mailbox, cq->cqn, 1); in mlx4_cq_modify()
210 err = mlx4_MODIFY_CQ(dev, mailbox, cq->cqn, 0); in mlx4_cq_resize()
217 int __mlx4_cq_alloc_icm(struct mlx4_dev *dev, int *cqn) in __mlx4_cq_alloc_icm() argument
223 *cqn = mlx4_bitmap_alloc(&cq_table->bitmap); in __mlx4_cq_alloc_icm()
224 if (*cqn == -1) in __mlx4_cq_alloc_icm()
227 err = mlx4_table_get(dev, &cq_table->table, *cqn); in __mlx4_cq_alloc_icm()
231 err = mlx4_table_get(dev, &cq_table->cmpt_table, *cqn); in __mlx4_cq_alloc_icm()
237 mlx4_table_put(dev, &cq_table->table, *cqn); in __mlx4_cq_alloc_icm()
240 mlx4_bitmap_free(&cq_table->bitmap, *cqn, MLX4_NO_RR); in __mlx4_cq_alloc_icm()
244 static int mlx4_cq_alloc_icm(struct mlx4_dev *dev, int *cqn, u8 usage) in mlx4_cq_alloc_icm() argument
257 *cqn = get_param_l(&out_param); in mlx4_cq_alloc_icm()
261 return __mlx4_cq_alloc_icm(dev, cqn); in mlx4_cq_alloc_icm()
264 void __mlx4_cq_free_icm(struct mlx4_dev *dev, int cqn) in __mlx4_cq_free_icm() argument
269 mlx4_table_put(dev, &cq_table->cmpt_table, cqn); in __mlx4_cq_free_icm()
270 mlx4_table_put(dev, &cq_table->table, cqn); in __mlx4_cq_free_icm()
271 mlx4_bitmap_free(&cq_table->bitmap, cqn, MLX4_NO_RR); in __mlx4_cq_free_icm()
274 static void mlx4_cq_free_icm(struct mlx4_dev *dev, int cqn) in mlx4_cq_free_icm() argument
280 set_param_l(&in_param, cqn); in mlx4_cq_free_icm()
285 mlx4_warn(dev, "Failed freeing cq:%d\n", cqn); in mlx4_cq_free_icm()
287 __mlx4_cq_free_icm(dev, cqn); in mlx4_cq_free_icm()
360 err = mlx4_cq_alloc_icm(dev, &cq->cqn, cq->usage); in mlx4_cq_alloc()
365 err = radix_tree_insert(&cq_table->tree, cq->cqn, cq); in mlx4_cq_alloc()
404 err = mlx4_SW2HW_CQ(dev, mailbox, cq->cqn, sw_cq_init); in mlx4_cq_alloc()
426 radix_tree_delete(&cq_table->tree, cq->cqn); in mlx4_cq_alloc()
430 mlx4_cq_free_icm(dev, cq->cqn); in mlx4_cq_alloc()
442 err = mlx4_HW2SW_CQ(dev, NULL, cq->cqn); in mlx4_cq_free()
444 mlx4_warn(dev, "HW2SW_CQ failed (%d) for CQN %06x\n", err, cq->cqn); in mlx4_cq_free()
447 radix_tree_delete(&cq_table->tree, cq->cqn); in mlx4_cq_free()
459 mlx4_cq_free_icm(dev, cq->cqn); in mlx4_cq_free()