[openib-general] [PATCH] fix page_size_cap value in ib_query_device for mellanox provider
Jack Morgenstein
jackm at mellanox.co.il
Thu Oct 20 04:04:44 PDT 2005
NOTE!!
This patch also affects interpretation of page_size_cap field in the
ib_device_attr struct in file ib_verbs.h (i.e., for all providers).
The page_size_cap field is interpreted here as a bitmap of
power-of-2 page sizes supported by the device.
Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>
Index: linux-kernel/drivers/infiniband/include/rdma/ib_verbs.h
===================================================================
--- linux-kernel/drivers/infiniband/include/rdma/ib_verbs.h (revision 3827)
+++ linux-kernel/drivers/infiniband/include/rdma/ib_verbs.h (working copy)
@@ -91,6 +91,7 @@
__be64 node_guid;
__be64 sys_image_guid;
u64 max_mr_size;
+ /* page_size_cap is a bitmap of supported power-of-2 page sizes. */
u64 page_size_cap;
u32 vendor_id;
u32 vendor_part_id;
Index: linux-kernel/drivers/infiniband/hw/mthca/mthca_dev.h
===================================================================
--- linux-kernel/drivers/infiniband/hw/mthca/mthca_dev.h (revision 3827)
+++ linux-kernel/drivers/infiniband/hw/mthca/mthca_dev.h (working copy)
@@ -154,6 +154,8 @@
int reserved_mcgs;
int num_pds;
int reserved_pds;
+ /* page_size_cap is a bitmap of supported power-of-2 page sizes. */
+ u32 page_size_cap;
u32 flags;
u8 port_width_cap;
};
Index: linux-kernel/drivers/infiniband/hw/mthca/mthca_main.c
===================================================================
--- linux-kernel/drivers/infiniband/hw/mthca/mthca_main.c (revision 3827)
+++ linux-kernel/drivers/infiniband/hw/mthca/mthca_main.c (working copy)
@@ -168,6 +168,7 @@
mdev->limits.max_srq_wqes = dev_lim->max_srq_sz;
mdev->limits.reserved_srqs = dev_lim->reserved_srqs;
mdev->limits.reserved_eecs = dev_lim->reserved_eecs;
+ mdev->limits.page_size_cap = ~(u32)(dev_lim->min_page_sz - 1);
/*
* Subtract 1 from the limit because we need to allocate a
* spare CQE so the HCA HW can tell the difference between an
Index: linux-kernel/drivers/infiniband/hw/mthca/mthca_provider.c
===================================================================
--- linux-kernel/drivers/infiniband/hw/mthca/mthca_provider.c (revision 3827)
+++ linux-kernel/drivers/infiniband/hw/mthca/mthca_provider.c (working copy)
@@ -111,6 +111,7 @@
props->max_mcast_qp_attach = MTHCA_QP_PER_MGM;
props->max_total_mcast_qp_attach = props->max_mcast_qp_attach *
props->max_mcast_grp;
+ props->page_size_cap = (u64)mdev->limits.page_size_cap;
err = 0;
out:
More information about the general
mailing list