]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/hns: Fix return value in hns_roce_map_mr_sg
authorZhengchao Shao <shaozhengchao@huawei.com>
Thu, 11 Apr 2024 03:38:51 +0000 (11:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:30 +0000 (13:39 +0200)
commited159691a29cb0b0f70cc06e4c4be202ba9d3bcb
treee93e5804fd15e9775fdabec6d5118ac8067855dc
parentf0b2483d45be05165d0628e68bae04b0c8dad7b0
RDMA/hns: Fix return value in hns_roce_map_mr_sg

[ Upstream commit 203b70fda63425a4eb29f03f9074859afe821a39 ]

As described in the ib_map_mr_sg function comment, it returns the number
of sg elements that were mapped to the memory region. However,
hns_roce_map_mr_sg returns the number of pages required for mapping the
DMA area. Fix it.

Fixes: 9b2cf76c9f05 ("RDMA/hns: Optimize PBL buffer allocation process")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Link: https://lore.kernel.org/r/20240411033851.2884771-1-shaozhengchao@huawei.com
Reviewed-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_mr.c