mlx5: Expose correct page_size_cap in device attributes
authorSagi Grimberg <sagig@mellanox.com>
Tue, 21 Jul 2015 11:40:12 +0000 (14:40 +0300)
committerDoug Ledford <dledford@redhat.com>
Sat, 29 Aug 2015 02:54:46 +0000 (22:54 -0400)
Should be all the page sizes that are supported by the
device.

Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/main.c

index 5ab5bb3feb975404ebeb8cd74c1e10e2269be423..1ece3a7debd599d9b601349251dc63e9267474c1 100644 (file)
@@ -212,6 +212,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
        int err = -ENOMEM;
        int max_rq_sg;
        int max_sq_sg;
+       u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz);
 
        if (uhw->inlen || uhw->outlen)
                return -EINVAL;
@@ -264,7 +265,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
        props->hw_ver              = mdev->pdev->revision;
 
        props->max_mr_size         = ~0ull;
-       props->page_size_cap       = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz);
+       props->page_size_cap       = ~(min_page_size - 1);
        props->max_qp              = 1 << MLX5_CAP_GEN(mdev, log_max_qp);
        props->max_qp_wr           = 1 << MLX5_CAP_GEN(mdev, log_max_qp_sz);
        max_rq_sg =  MLX5_CAP_GEN(mdev, max_wqe_sz_rq) /