Lines Matching defs:cq

40 #include <linux/mlx4/cq.h>
57 struct mlx4_cq *cq;
61 cq = radix_tree_lookup(&mlx4_priv(dev)->cq_table.tree,
63 if (cq)
64 atomic_inc(&cq->refcount);
68 if (!cq) {
73 ++cq->arm_sn;
75 cq->comp(cq);
77 if (atomic_dec_and_test(&cq->refcount))
78 complete(&cq->free);
84 struct mlx4_cq *cq;
88 cq = radix_tree_lookup(&cq_table->tree, cqn & (dev->caps.num_cqs - 1));
89 if (cq)
90 atomic_inc(&cq->refcount);
94 if (!cq) {
99 cq->event(cq, event_type);
101 if (atomic_dec_and_test(&cq->refcount))
102 complete(&cq->free);
128 int mlx4_cq_modify(struct mlx4_dev *dev, struct mlx4_cq *cq,
145 err = mlx4_MODIFY_CQ(dev, mailbox, cq->cqn, 1);
152 int mlx4_cq_resize(struct mlx4_dev *dev, struct mlx4_cq *cq,
173 err = mlx4_MODIFY_CQ(dev, mailbox, cq->cqn, 0);
180 int mlx4_cq_ignore_overrun(struct mlx4_dev *dev, struct mlx4_cq *cq)
195 err = mlx4_MODIFY_CQ(dev, mailbox, cq->cqn, 3);
269 mlx4_warn(dev, "Failed freeing cq:%d\n", cqn);
276 struct mlx4_cq *cq, unsigned vector, int collapsed,
289 cq->vector = vector;
291 err = mlx4_cq_alloc_icm(dev, &cq->cqn);
296 err = radix_tree_insert(&cq_table->tree, cq->cqn, cq);
323 err = mlx4_SW2HW_CQ(dev, mailbox, cq->cqn);
328 cq->cons_index = 0;
329 cq->arm_sn = 1;
330 cq->uar = uar;
331 atomic_set(&cq->refcount, 1);
332 init_completion(&cq->free);
334 cq->eqn = priv->eq_table.eq[cq->vector].eqn;
335 cq->irq = priv->eq_table.eq[cq->vector].irq;
341 radix_tree_delete(&cq_table->tree, cq->cqn);
345 mlx4_cq_free_icm(dev, cq->cqn);
351 void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq)
357 err = mlx4_HW2SW_CQ(dev, NULL, cq->cqn);
359 mlx4_warn(dev, "HW2SW_CQ failed (%d) for CQN %06x\n", err, cq->cqn);
361 synchronize_irq(priv->eq_table.eq[cq->vector].irq);
364 radix_tree_delete(&cq_table->tree, cq->cqn);
367 if (atomic_dec_and_test(&cq->refcount))
368 complete(&cq->free);
369 wait_for_completion(&cq->free);
371 mlx4_cq_free_icm(dev, cq->cqn);