mlx4, mlx5, mthca: Expose max_sge_rd correctly
authorSagi Grimberg <sagig@mellanox.com>
Mon, 27 Jul 2015 23:10:01 +0000 (18:10 -0500)
committerDoug Ledford <dledford@redhat.com>
Sat, 29 Aug 2015 03:02:10 +0000 (23:02 -0400)
Applications must not assume that max_sge and max_sge_rd are the same,
Hence expose max_sge_rd correctly as well.

Reported-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/mthca/mthca_provider.c

index 8be6db81646049a741abebe1c4ab982fad7e6011..05166b7d8ca70f5ccb83e1edb362fa46d0a9012d 100644 (file)
@@ -229,6 +229,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
        props->max_qp_wr           = dev->dev->caps.max_wqes - MLX4_IB_SQ_MAX_SPARE;
        props->max_sge             = min(dev->dev->caps.max_sq_sg,
                                         dev->dev->caps.max_rq_sg);
+       props->max_sge_rd = props->max_sge;
        props->max_cq              = dev->dev->quotas.cq;
        props->max_cqe             = dev->dev->caps.max_cqes;
        props->max_mr              = dev->dev->quotas.mpt;
index 1ece3a7debd599d9b601349251dc63e9267474c1..bac5f98965d0acdfcfdc81479f646a141d0b0bbb 100644 (file)
@@ -274,6 +274,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
                     sizeof(struct mlx5_wqe_ctrl_seg)) /
                     sizeof(struct mlx5_wqe_data_seg);
        props->max_sge = min(max_rq_sg, max_sq_sg);
+       props->max_sge_rd = props->max_sge;
        props->max_cq              = 1 << MLX5_CAP_GEN(mdev, log_max_cq);
        props->max_cqe = (1 << MLX5_CAP_GEN(mdev, log_max_eq_sz)) - 1;
        props->max_mr              = 1 << MLX5_CAP_GEN(mdev, log_max_mkey);
index 93ae51dcf2ffaefb715363e2706855e66f1ce41b..dc2d48c59e6274c54e84af0d26b4da1b56271b13 100644 (file)
@@ -97,6 +97,7 @@ static int mthca_query_device(struct ib_device *ibdev, struct ib_device_attr *pr
        props->max_qp              = mdev->limits.num_qps - mdev->limits.reserved_qps;
        props->max_qp_wr           = mdev->limits.max_wqes;
        props->max_sge             = mdev->limits.max_sg;
+       props->max_sge_rd          = props->max_sge;
        props->max_cq              = mdev->limits.num_cqs - mdev->limits.reserved_cqs;
        props->max_cqe             = mdev->limits.max_cqes;
        props->max_mr              = mdev->limits.num_mpts - mdev->limits.reserved_mrws;