[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>
This commit is contained in:

committed by
Roland Dreier

parent
4ab6fb7e5b
commit
efaae8f71f
@@ -1112,8 +1112,10 @@ static int mthca_set_qp_size(struct mthca_dev *dev, struct ib_qp_cap *cap,
|
||||
struct mthca_qp *qp)
|
||||
{
|
||||
/* Sanity check QP size before proceeding */
|
||||
if (cap->max_send_wr > 65536 || cap->max_recv_wr > 65536 ||
|
||||
cap->max_send_sge > 64 || cap->max_recv_sge > 64)
|
||||
if (cap->max_send_wr > dev->limits.max_wqes ||
|
||||
cap->max_recv_wr > dev->limits.max_wqes ||
|
||||
cap->max_send_sge > dev->limits.max_sg ||
|
||||
cap->max_recv_sge > dev->limits.max_sg)
|
||||
return -EINVAL;
|
||||
|
||||
if (mthca_is_memfree(dev)) {
|
||||
|
Reference in New Issue
Block a user