summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/qedr
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2020-10-04 02:20:06 +0300
committerJason Gunthorpe <jgg@nvidia.com>2020-10-27 01:27:58 +0300
commit26e990badde40b2fb824bfa3cb9d4288a79584bc (patch)
tree355d49a7b78e7c655941ae63844f56ac5e270d93 /drivers/infiniband/hw/qedr
parent652caba5b5501258a46d4b9279e0dbb6e5d42d75 (diff)
downloadlinux-26e990badde40b2fb824bfa3cb9d4288a79584bc.tar.xz
RDMA: Check attr_mask during modify_qp
Each driver should check that it can support the provided attr_mask during modify_qp. IB_USER_VERBS_EX_CMD_MODIFY_QP was being used to block modify_qp_ex because the driver didn't check RATE_LIMIT. Link: https://lore.kernel.org/r/6-v1-caa70ba3d1ab+1436e-ucmd_mask_jgg@nvidia.com Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/qedr')
-rw-r--r--drivers/infiniband/hw/qedr/verbs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c
index 29a96ff6fc66..34c07a18c2c2 100644
--- a/drivers/infiniband/hw/qedr/verbs.c
+++ b/drivers/infiniband/hw/qedr/verbs.c
@@ -2472,6 +2472,9 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
"modify qp: qp %p attr_mask=0x%x, state=%d", qp, attr_mask,
attr->qp_state);
+ if (attr_mask & ~IB_QP_ATTR_STANDARD_BITS)
+ return -EOPNOTSUPP;
+
old_qp_state = qedr_get_ibqp_state(qp->state);
if (attr_mask & IB_QP_STATE)
new_qp_state = attr->qp_state;