[openib-general] Re: [PATCH] fix page_size_cap value in ib_query_device for mellanox provider
Roland Dreier
rolandd at cisco.com
Thu Nov 3 15:05:37 PST 2005
Can we just use something like this instead? I don't think we need
the comments talking about the semantics of page_size_cap, since we
don't say what any other field means.
And I don't see what casting mdev->limits.page_size_cap to u64
accomplishes -- it will get promoted to u64 anyway, since
props->page_size_cap is a u64.
- R.
--- infiniband/hw/mthca/mthca_provider.c (revision 3965)
+++ infiniband/hw/mthca/mthca_provider.c (working copy)
@@ -94,6 +94,7 @@ static int mthca_query_device(struct ib_
memcpy(&props->node_guid, out_mad->data + 12, 8);
props->max_mr_size = ~0ull;
+ props->page_size_cap = mdev->limits.page_size_cap;
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;
--- infiniband/hw/mthca/mthca_main.c (revision 3965)
+++ infiniband/hw/mthca/mthca_main.c (working copy)
@@ -181,6 +181,7 @@ static int __devinit mthca_dev_lim(struc
mdev->limits.reserved_uars = dev_lim->reserved_uars;
mdev->limits.reserved_pds = dev_lim->reserved_pds;
mdev->limits.port_width_cap = dev_lim->max_port_width;
+ mdev->limits.page_size_cap = ~(u32) (dev_lim->min_page_sz - 1);
mdev->limits.flags = dev_lim->flags;
/* IB_DEVICE_RESIZE_MAX_WR not supported by driver.
More information about the general
mailing list