aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2013-10-24 05:01:03 -0400
committerRoland Dreier <roland@purestorage.com>2013-11-08 17:43:01 -0500
commit1b77d2bd753d119eedcbc08fda58934307676554 (patch)
tree7f2e6dfe67f82b37c17e83a73dd5f00751a47505 /drivers/infiniband
parentc2a3431e6153ed90911704356bc1e869624e118d (diff)
mlx5: Use enum to indicate adapter page size
The Connect-IB adapter has an inherent page size which equals 4K. Define an new enum that equals the page shift and use it instead of using the value 12 throughout the code. Signed-off-by: Eli Cohen <eli@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx5/cq.c2
-rw-r--r--drivers/infiniband/hw/mlx5/qp.c5
-rw-r--r--drivers/infiniband/hw/mlx5/srq.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
index eecac7b52bcb..28344773f640 100644
--- a/drivers/infiniband/hw/mlx5/cq.c
+++ b/drivers/infiniband/hw/mlx5/cq.c
@@ -620,7 +620,7 @@ static int create_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
620 } 620 }
621 mlx5_fill_page_array(&cq->buf.buf, (*cqb)->pas); 621 mlx5_fill_page_array(&cq->buf.buf, (*cqb)->pas);
622 622
623 (*cqb)->ctx.log_pg_sz = cq->buf.buf.page_shift - 12; 623 (*cqb)->ctx.log_pg_sz = cq->buf.buf.page_shift - MLX5_ADAPTER_PAGE_SHIFT;
624 *index = dev->mdev.priv.uuari.uars[0].index; 624 *index = dev->mdev.priv.uuari.uars[0].index;
625 625
626 return 0; 626 return 0;
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 5bcf57943b84..7c6b4ba49bec 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -551,7 +551,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
551 } 551 }
552 mlx5_ib_populate_pas(dev, qp->umem, page_shift, (*in)->pas, 0); 552 mlx5_ib_populate_pas(dev, qp->umem, page_shift, (*in)->pas, 0);
553 (*in)->ctx.log_pg_sz_remote_qpn = 553 (*in)->ctx.log_pg_sz_remote_qpn =
554 cpu_to_be32((page_shift - 12) << 24); 554 cpu_to_be32((page_shift - MLX5_ADAPTER_PAGE_SHIFT) << 24);
555 (*in)->ctx.params2 = cpu_to_be32(offset << 6); 555 (*in)->ctx.params2 = cpu_to_be32(offset << 6);
556 556
557 (*in)->ctx.qp_counter_set_usr_page = cpu_to_be32(uar_index); 557 (*in)->ctx.qp_counter_set_usr_page = cpu_to_be32(uar_index);
@@ -648,7 +648,8 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev,
648 goto err_buf; 648 goto err_buf;
649 } 649 }
650 (*in)->ctx.qp_counter_set_usr_page = cpu_to_be32(uar_index); 650 (*in)->ctx.qp_counter_set_usr_page = cpu_to_be32(uar_index);
651 (*in)->ctx.log_pg_sz_remote_qpn = cpu_to_be32((qp->buf.page_shift - 12) << 24); 651 (*in)->ctx.log_pg_sz_remote_qpn =
652 cpu_to_be32((qp->buf.page_shift - MLX5_ADAPTER_PAGE_SHIFT) << 24);
652 /* Set "fast registration enabled" for all kernel QPs */ 653 /* Set "fast registration enabled" for all kernel QPs */
653 (*in)->ctx.params1 |= cpu_to_be32(1 << 11); 654 (*in)->ctx.params1 |= cpu_to_be32(1 << 11);
654 (*in)->ctx.sq_crq_size |= cpu_to_be16(1 << 4); 655 (*in)->ctx.sq_crq_size |= cpu_to_be16(1 << 4);
diff --git a/drivers/infiniband/hw/mlx5/srq.c b/drivers/infiniband/hw/mlx5/srq.c
index dbc2c7188c5e..210b3eaf188a 100644
--- a/drivers/infiniband/hw/mlx5/srq.c
+++ b/drivers/infiniband/hw/mlx5/srq.c
@@ -123,7 +123,7 @@ static int create_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq,
123 goto err_in; 123 goto err_in;
124 } 124 }
125 125
126 (*in)->ctx.log_pg_sz = page_shift - 12; 126 (*in)->ctx.log_pg_sz = page_shift - MLX5_ADAPTER_PAGE_SHIFT;
127 (*in)->ctx.pgoff_cqn = cpu_to_be32(offset << 26); 127 (*in)->ctx.pgoff_cqn = cpu_to_be32(offset << 26);
128 128
129 return 0; 129 return 0;
@@ -192,7 +192,7 @@ static int create_srq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_srq *srq,
192 } 192 }
193 srq->wq_sig = !!srq_signature; 193 srq->wq_sig = !!srq_signature;
194 194
195 (*in)->ctx.log_pg_sz = page_shift - 12; 195 (*in)->ctx.log_pg_sz = page_shift - MLX5_ADAPTER_PAGE_SHIFT;
196 196
197 return 0; 197 return 0;
198 198