diff mbox

IB/mlx5: Expose correct max_fast_reg_page_list_len

Message ID 1457005071-4900-1-git-send-email-sagig@mellanox.com (mailing list archive)
State Accepted
Headers show

Commit Message

Sagi Grimberg March 3, 2016, 11:37 a.m. UTC
While documentation indicates that the number of translation
entries per memory key is unlimited, in practice, we can
only fit a finite amount of translation entries in a single
registration wqe (which is log_max_klm_list_size).

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
---
 drivers/infiniband/hw/mlx5/main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Doug Ledford March 3, 2016, 4:27 p.m. UTC | #1
On 03/03/2016 06:37 AM, Sagi Grimberg wrote:
> While documentation indicates that the number of translation
> entries per memory key is unlimited, in practice, we can
> only fit a finite amount of translation entries in a single
> registration wqe (which is log_max_klm_list_size).
> 
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> ---
>  drivers/infiniband/hw/mlx5/main.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index 90c5e24..136ed67 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -536,7 +536,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
>  	props->local_ca_ack_delay  = MLX5_CAP_GEN(mdev, local_ca_ack_delay);
>  	props->max_res_rd_atom	   = props->max_qp_rd_atom * props->max_qp;
>  	props->max_srq_sge	   = max_rq_sg - 1;
> -	props->max_fast_reg_page_list_len = (unsigned int)-1;
> +	props->max_fast_reg_page_list_len =
> +		1 << MLX5_CAP_GEN(mdev, log_max_klm_list_size);
>  	get_atomic_caps(dev, props);
>  	props->masked_atomic_cap   = IB_ATOMIC_NONE;
>  	props->max_mcast_grp	   = 1 << MLX5_CAP_GEN(mdev, log_max_mcg);
> 

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 90c5e24..136ed67 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -536,7 +536,8 @@  static int mlx5_ib_query_device(struct ib_device *ibdev,
 	props->local_ca_ack_delay  = MLX5_CAP_GEN(mdev, local_ca_ack_delay);
 	props->max_res_rd_atom	   = props->max_qp_rd_atom * props->max_qp;
 	props->max_srq_sge	   = max_rq_sg - 1;
-	props->max_fast_reg_page_list_len = (unsigned int)-1;
+	props->max_fast_reg_page_list_len =
+		1 << MLX5_CAP_GEN(mdev, log_max_klm_list_size);
 	get_atomic_caps(dev, props);
 	props->masked_atomic_cap   = IB_ATOMIC_NONE;
 	props->max_mcast_grp	   = 1 << MLX5_CAP_GEN(mdev, log_max_mcg);