]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/hns: Fix the modification of max_send_sge
authorwenglianfa <wenglianfa@huawei.com>
Thu, 16 Oct 2025 11:40:49 +0000 (19:40 +0800)
committerLeon Romanovsky <leon@kernel.org>
Mon, 27 Oct 2025 09:44:00 +0000 (05:44 -0400)
The actual sge number may exceed the value specified in init_attr->cap
when HW needs extra sge to enable inline feature. Since these extra
sges are not expected by ULP, return the user-specified value to ULP
instead of the expanded sge number.

Fixes: 0c5e259b06a8 ("RDMA/hns: Fix incorrect sge nums calculation")
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20251016114051.1963197-3-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_qp.c

index 6ff1b8ce580c502312645021b0fefc20a180b7ce..bdd879ac12dda2e95427758b60f9541c1e8a14c2 100644 (file)
@@ -662,7 +662,6 @@ static int set_user_sq_size(struct hns_roce_dev *hr_dev,
 
        hr_qp->sq.wqe_shift = ucmd->log_sq_stride;
        hr_qp->sq.wqe_cnt = cnt;
-       cap->max_send_sge = hr_qp->sq.max_gs;
 
        return 0;
 }
@@ -744,7 +743,6 @@ static int set_kernel_sq_size(struct hns_roce_dev *hr_dev,
 
        /* sync the parameters of kernel QP to user's configuration */
        cap->max_send_wr = cnt;
-       cap->max_send_sge = hr_qp->sq.max_gs;
 
        return 0;
 }