mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
RDMA/hns: Fix GMV table pagesize
[ Upstream commit ee045493283403969591087bd405fa280103282a ]
GMV's BA table only supports 4K pages. Currently, PAGESIZE is used to
calculate gmv_bt_num, which will cause an abnormal number of gmv_bt_num
in a 64K OS.
Fixes: d6d91e4621 ("RDMA/hns: Add support for configuring GMV table")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20240412091616.370789-8-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
763780ef03
commit
e88f5ea8db
@@ -2229,7 +2229,7 @@ static void apply_func_caps(struct hns_roce_dev *hr_dev)
|
|||||||
caps->gid_table_len[0] = caps->gmv_bt_num *
|
caps->gid_table_len[0] = caps->gmv_bt_num *
|
||||||
(HNS_HW_PAGE_SIZE / caps->gmv_entry_sz);
|
(HNS_HW_PAGE_SIZE / caps->gmv_entry_sz);
|
||||||
|
|
||||||
caps->gmv_entry_num = caps->gmv_bt_num * (PAGE_SIZE /
|
caps->gmv_entry_num = caps->gmv_bt_num * (HNS_HW_PAGE_SIZE /
|
||||||
caps->gmv_entry_sz);
|
caps->gmv_entry_sz);
|
||||||
} else {
|
} else {
|
||||||
u32 func_num = max_t(u32, 1, hr_dev->func_num);
|
u32 func_num = max_t(u32, 1, hr_dev->func_num);
|
||||||
|
|||||||
Reference in New Issue
Block a user