[PATCH] IB/ipath: enforce device resource limits
These limits are somewhat artificial in that we don't actually have any device limits. However, the verbs layer expects that such limits exist and are enforced, so we make up arbitrary (but sensible) limits. Signed-off-by: Robert Walsh <robert.walsh@qlogic.com> Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Cc: "Michael S. Tsirkin" <mst@mellanox.co.il> Cc: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

vanhempi
e8a88f09f2
commit
fe62546a6a
@@ -661,8 +661,10 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
|
||||
size_t sz;
|
||||
struct ib_qp *ret;
|
||||
|
||||
if (init_attr->cap.max_send_sge > 255 ||
|
||||
init_attr->cap.max_recv_sge > 255) {
|
||||
if (init_attr->cap.max_send_sge > ib_ipath_max_sges ||
|
||||
init_attr->cap.max_recv_sge > ib_ipath_max_sges ||
|
||||
init_attr->cap.max_send_wr > ib_ipath_max_qp_wrs ||
|
||||
init_attr->cap.max_recv_wr > ib_ipath_max_qp_wrs) {
|
||||
ret = ERR_PTR(-ENOMEM);
|
||||
goto bail;
|
||||
}
|
||||
|
Viittaa uudesa ongelmassa
Block a user