]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
IB/mlx4: Limit size of fast registration WRs
authorEli Cohen <eli@dev.mellanox.co.il>
Thu, 7 Oct 2010 14:24:16 +0000 (16:24 +0200)
committerRoland Dreier <rolandd@cisco.com>
Mon, 11 Oct 2010 21:33:17 +0000 (14:33 -0700)
Fix the limit on the size of max fast registration WRs that can be
posted to match hardware capabilities.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx4/mr.c
include/linux/mlx4/device.h

index 4e94e360e43b42ed1f31685bdcb8b7387bc1b46e..62e8cd6f0371585408bed7854b28b7e7cae9e8af 100644 (file)
@@ -135,7 +135,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
        props->max_srq             = dev->dev->caps.num_srqs - dev->dev->caps.reserved_srqs;
        props->max_srq_wr          = dev->dev->caps.max_srq_wqes - 1;
        props->max_srq_sge         = dev->dev->caps.max_srq_sge;
-       props->max_fast_reg_page_list_len = PAGE_SIZE / sizeof (u64);
+       props->max_fast_reg_page_list_len = MLX4_MAX_FAST_REG_PAGES;
        props->local_ca_ack_delay  = dev->dev->caps.local_ca_ack_delay;
        props->atomic_cap          = dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_ATOMIC ?
                IB_ATOMIC_HCA : IB_ATOMIC_NONE;
index 1d27b9a8e2d6b6944e002296479116952456d73b..dca55b19a6f198ee9d9fee7b6f003306a55279a9 100644 (file)
@@ -226,7 +226,7 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device
        struct mlx4_ib_fast_reg_page_list *mfrpl;
        int size = page_list_len * sizeof (u64);
 
-       if (size > PAGE_SIZE)
+       if (page_list_len > MLX4_MAX_FAST_REG_PAGES)
                return ERR_PTR(-EINVAL);
 
        mfrpl = kmalloc(sizeof *mfrpl, GFP_KERNEL);
index 7a7f9c1e679a30e5b2f8366926cf7b7991360723..ada69389fb918b1d9e13dcc56cd2ec15b2757349 100644 (file)
@@ -171,6 +171,10 @@ enum {
        MLX4_NUM_FEXCH          = 64 * 1024,
 };
 
+enum {
+       MLX4_MAX_FAST_REG_PAGES = 511,
+};
+
 static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
 {
        return (major << 32) | (minor << 16) | subminor;