diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2020-10-04 01:20:06 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2020-10-26 23:27:58 +0100 |
commit | 26e990badde40b2fb824bfa3cb9d4288a79584bc (patch) | |
tree | 355d49a7b78e7c655941ae63844f56ac5e270d93 /drivers/infiniband/hw/hns/hns_roce_hw_v1.c | |
parent | RDMA: Check srq_type during create_srq (diff) | |
download | linux-26e990badde40b2fb824bfa3cb9d4288a79584bc.tar.xz linux-26e990badde40b2fb824bfa3cb9d4288a79584bc.zip |
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/hns/hns_roce_hw_v1.c')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c index b3d5ba8ef439..f18380f827dd 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c @@ -3256,6 +3256,8 @@ static int hns_roce_v1_modify_qp(struct ib_qp *ibqp, enum ib_qp_state cur_state, enum ib_qp_state new_state) { + if (attr_mask & ~IB_QP_ATTR_STANDARD_BITS) + return -EOPNOTSUPP; if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_SMI) return hns_roce_v1_m_sqp(ibqp, attr, attr_mask, cur_state, |