From: Shunfeng Yang yangshunfeng2@huawei.com
mainline inclusion from mainline-v5.12 commit b5df9b7a2f965b7903850d8f89846ffe0080b84b category: bugfix bugzilla: NA CVE: NA
According to the IB Specification, srq_limit shouldn't be configured during SRQ creation. If a user set srq_limit at this time, the driver should forced it to zero, or the result of creating SRQ will conflict with the result of querying SRQ.
Signed-off-by: Shunfeng Yang yangshunfeng2@huawei.com Signed-off-by: Yangyang Li liyangyang20@huawei.com Reviewed-by: chunzhi hu huchunzhi@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/infiniband/hw/hns/hns_roce_srq.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/hns/hns_roce_srq.c b/drivers/infiniband/hw/hns/hns_roce_srq.c index 630bf17c281c9..14724df9c8e94 100644 --- a/drivers/infiniband/hw/hns/hns_roce_srq.c +++ b/drivers/infiniband/hw/hns/hns_roce_srq.c @@ -529,6 +529,7 @@ struct ib_srq *hns_roce_create_srq(struct ib_pd *pd, srq->ibsrq.ext.xrc.srq_num = srq->srqn; srq_init_attr->attr.max_wr = srq->max; srq_init_attr->attr.max_sge = srq->max_gs - srq->rsv_sge; + srq_init_attr->attr.srq_limit = 0;
if (pd->uobject) { if (ib_copy_to_udata(udata, &srq->srqn, sizeof(__u32))) {