diff options
author | Jack Morgenstein <jackm@mellanox.co.il> | 2005-10-10 16:48:07 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2005-10-17 18:20:29 -0400 |
commit | efaae8f71f3088cc73c9e5ceabbd314aa82ac768 (patch) | |
tree | b19084ae0a9dc6837cb2837cbd21386c9f1b2e0e /drivers/infiniband/hw/mthca/mthca_main.c | |
parent | 4ab6fb7e5b3d34b65a1c3473d80d9d1a462d3a49 (diff) |
[IB] mthca: Better limit checking and reporting
Check the sizes of CQs, QPs and SRQs when creating objects, and fail
instead of creating too-big queues. Also return real limits instead
of just plausible-sounding values from mthca_query_device().
Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_main.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c index 576e7fcd053c..7c35abec81ea 100644 --- a/drivers/infiniband/hw/mthca/mthca_main.c +++ b/drivers/infiniband/hw/mthca/mthca_main.c | |||
@@ -162,9 +162,18 @@ static int __devinit mthca_dev_lim(struct mthca_dev *mdev, struct mthca_dev_lim | |||
162 | mdev->limits.pkey_table_len = dev_lim->max_pkeys; | 162 | mdev->limits.pkey_table_len = dev_lim->max_pkeys; |
163 | mdev->limits.local_ca_ack_delay = dev_lim->local_ca_ack_delay; | 163 | mdev->limits.local_ca_ack_delay = dev_lim->local_ca_ack_delay; |
164 | mdev->limits.max_sg = dev_lim->max_sg; | 164 | mdev->limits.max_sg = dev_lim->max_sg; |
165 | mdev->limits.max_wqes = dev_lim->max_qp_sz; | ||
166 | mdev->limits.max_qp_init_rdma = dev_lim->max_requester_per_qp; | ||
165 | mdev->limits.reserved_qps = dev_lim->reserved_qps; | 167 | mdev->limits.reserved_qps = dev_lim->reserved_qps; |
168 | mdev->limits.max_srq_wqes = dev_lim->max_srq_sz; | ||
166 | mdev->limits.reserved_srqs = dev_lim->reserved_srqs; | 169 | mdev->limits.reserved_srqs = dev_lim->reserved_srqs; |
167 | mdev->limits.reserved_eecs = dev_lim->reserved_eecs; | 170 | mdev->limits.reserved_eecs = dev_lim->reserved_eecs; |
171 | /* | ||
172 | * Subtract 1 from the limit because we need to allocate a | ||
173 | * spare CQE so the HCA HW can tell the difference between an | ||
174 | * empty CQ and a full CQ. | ||
175 | */ | ||
176 | mdev->limits.max_cqes = dev_lim->max_cq_sz - 1; | ||
168 | mdev->limits.reserved_cqs = dev_lim->reserved_cqs; | 177 | mdev->limits.reserved_cqs = dev_lim->reserved_cqs; |
169 | mdev->limits.reserved_eqs = dev_lim->reserved_eqs; | 178 | mdev->limits.reserved_eqs = dev_lim->reserved_eqs; |
170 | mdev->limits.reserved_mtts = dev_lim->reserved_mtts; | 179 | mdev->limits.reserved_mtts = dev_lim->reserved_mtts; |