summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYangyang Li <liyangyang20@huawei.com>2020-09-19 18:03:16 +0800
committerJason Gunthorpe <jgg@nvidia.com>2020-09-24 15:56:26 -0300
commit221109e64316e089b79e604adaec9057e0c4785a (patch)
treec83339f4ce48cf5851f49e1b94124dbfc5539bb1
parent12542f1de179e5adf0701f63dff3506e5072c209 (diff)
downloadlinux-221109e64316e089b79e604adaec9057e0c4785a.tar.bz2
RDMA/hns: Add interception for resizing SRQs
HIP08 doesn't support modifying the maximum number of outstanding WR in an SRQ. However, the driver does not return a failure message, and users may mistakenly think that the resizing is executed successfully. So the driver needs to intercept this operation. Fixes: ffb1308b88b6 ("RDMA/hns: Move SRQ code to the reasonable place") Link: https://lore.kernel.org/r/1600509802-44382-3-git-send-email-liweihang@huawei.com Signed-off-by: Yangyang Li <liyangyang20@huawei.com> Signed-off-by: Weihang Li <liweihang@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 00d7cc9f107d..b7605a967860 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -5118,6 +5118,10 @@ static int hns_roce_v2_modify_srq(struct ib_srq *ibsrq,
struct hns_roce_cmd_mailbox *mailbox;
int ret;
+ /* Resizing SRQs is not supported yet */
+ if (srq_attr_mask & IB_SRQ_MAX_WR)
+ return -EINVAL;
+
if (srq_attr_mask & IB_SRQ_LIMIT) {
if (srq_attr->srq_limit >= srq->wqe_cnt)
return -EINVAL;