Commit 60093dc0 authored by Or Gerlitz's avatar Or Gerlitz Committed by Roland Dreier

IB: Return error for unsupported QP creation flags

Fix the usnic and thw qib drivers to err when QP creation flags that
they don't understand are provided.
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent d6d211db
...@@ -985,7 +985,8 @@ struct ib_qp *qib_create_qp(struct ib_pd *ibpd, ...@@ -985,7 +985,8 @@ struct ib_qp *qib_create_qp(struct ib_pd *ibpd,
struct ib_qp *ret; struct ib_qp *ret;
if (init_attr->cap.max_send_sge > ib_qib_max_sges || if (init_attr->cap.max_send_sge > ib_qib_max_sges ||
init_attr->cap.max_send_wr > ib_qib_max_qp_wrs) { init_attr->cap.max_send_wr > ib_qib_max_qp_wrs ||
init_attr->create_flags) {
ret = ERR_PTR(-EINVAL); ret = ERR_PTR(-EINVAL);
goto bail; goto bail;
} }
......
...@@ -466,6 +466,9 @@ struct ib_qp *usnic_ib_create_qp(struct ib_pd *pd, ...@@ -466,6 +466,9 @@ struct ib_qp *usnic_ib_create_qp(struct ib_pd *pd,
ucontext = to_uucontext(pd->uobject->context); ucontext = to_uucontext(pd->uobject->context);
us_ibdev = to_usdev(pd->device); us_ibdev = to_usdev(pd->device);
if (init_attr->create_flags)
return ERR_PTR(-EINVAL);
err = ib_copy_from_udata(&cmd, udata, sizeof(cmd)); err = ib_copy_from_udata(&cmd, udata, sizeof(cmd));
if (err) { if (err) {
usnic_err("%s: cannot copy udata for create_qp\n", usnic_err("%s: cannot copy udata for create_qp\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment