Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Yevgeny Petrilin and committed by
Roland Dreier
e463c7b1 7663c1e2

+6 -3
+1 -1
drivers/infiniband/hw/mlx4/cq.c
··· 221 221 } 222 222 223 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 225 if (err) 226 226 goto err_dbmap; 227 227
+3 -1
drivers/net/mlx4/cq.c
··· 188 188 EXPORT_SYMBOL_GPL(mlx4_cq_resize); 189 189 190 190 int 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 194 struct mlx4_priv *priv = mlx4_priv(dev); 194 195 struct mlx4_cq_table *cq_table = &priv->cq_table; ··· 225 224 cq_context = mailbox->buf; 226 225 memset(cq_context, 0, sizeof *cq_context); 227 226 227 + cq_context->flags = cpu_to_be32(!!collapsed << 18); 228 228 cq_context->logsize_usrpage = cpu_to_be32((ilog2(nent) << 24) | uar->index); 229 229 cq_context->comp_eqn = priv->eq_table.eq[MLX4_EQ_COMP].eqn; 230 230 cq_context->log_page_size = mtt->page_shift - MLX4_ICM_PAGE_SHIFT;
+2 -1
include/linux/mlx4/device.h
··· 382 382 int size); 383 383 384 384 int 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); 386 387 void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); 387 388 388 389 int mlx4_qp_alloc(struct mlx4_dev *dev, int sqpn, struct mlx4_qp *qp);