aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>2008-04-29 16:46:50 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-29 16:46:50 -0400
commite463c7b197dbe64b8a99b0612c65f286937e5bf1 (patch)
treeaadd360d04b9cdf7eaf7d4eed1f79bd29a3b12df
parent7663c1e2792a9662b23dec6e19bfcd3d55360b8f (diff)
mlx4_core: Add a way to set the "collapsed" CQ flag
Extend the mlx4_cq_resize() API with a way to set the "collapsed" flag for the CQ being created. Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/mlx4/cq.c2
-rw-r--r--drivers/net/mlx4/cq.c4
-rw-r--r--include/linux/mlx4/device.h3
3 files changed, 6 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index e3dddfc687f9..2f199c5c4a72 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -221,7 +221,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, int entries, int vector
221 } 221 }
222 222
223 err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar, 223 err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar,
224 cq->db.dma, &cq->mcq); 224 cq->db.dma, &cq->mcq, 0);
225 if (err) 225 if (err)
226 goto err_dbmap; 226 goto err_dbmap;
227 227
diff --git a/drivers/net/mlx4/cq.c b/drivers/net/mlx4/cq.c
index 6fda0af9d0a6..95e87a2f8896 100644
--- a/drivers/net/mlx4/cq.c
+++ b/drivers/net/mlx4/cq.c
@@ -188,7 +188,8 @@ int mlx4_cq_resize(struct mlx4_dev *dev, struct mlx4_cq *cq,
188EXPORT_SYMBOL_GPL(mlx4_cq_resize); 188EXPORT_SYMBOL_GPL(mlx4_cq_resize);
189 189
190int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, 190int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt,
191 struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq) 191 struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq,
192 int collapsed)
192{ 193{
193 struct mlx4_priv *priv = mlx4_priv(dev); 194 struct mlx4_priv *priv = mlx4_priv(dev);
194 struct mlx4_cq_table *cq_table = &priv->cq_table; 195 struct mlx4_cq_table *cq_table = &priv->cq_table;
@@ -224,6 +225,7 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt,
224 cq_context = mailbox->buf; 225 cq_context = mailbox->buf;
225 memset(cq_context, 0, sizeof *cq_context); 226 memset(cq_context, 0, sizeof *cq_context);
226 227
228 cq_context->flags = cpu_to_be32(!!collapsed << 18);
227 cq_context->logsize_usrpage = cpu_to_be32((ilog2(nent) << 24) | uar->index); 229 cq_context->logsize_usrpage = cpu_to_be32((ilog2(nent) << 24) | uar->index);
228 cq_context->comp_eqn = priv->eq_table.eq[MLX4_EQ_COMP].eqn; 230 cq_context->comp_eqn = priv->eq_table.eq[MLX4_EQ_COMP].eqn;
229 cq_context->log_page_size = mtt->page_shift - MLX4_ICM_PAGE_SHIFT; 231 cq_context->log_page_size = mtt->page_shift - MLX4_ICM_PAGE_SHIFT;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 9fa1a8002ce2..a744383d16e9 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -382,7 +382,8 @@ void mlx4_free_hwq_res(struct mlx4_dev *mdev, struct mlx4_hwq_resources *wqres,
382 int size); 382 int size);
383 383
384int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, 384int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt,
385 struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq); 385 struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq,
386 int collapsed);
386void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); 387void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq);
387 388
388int mlx4_qp_alloc(struct mlx4_dev *dev, int sqpn, struct mlx4_qp *qp); 389int mlx4_qp_alloc(struct mlx4_dev *dev, int sqpn, struct mlx4_qp *qp);