Skip to content

Commit 847b978

Browse files
nareshkumarpbsjgunthorpe
authored andcommitted
RDMA/bnxt_re: Restrict the max_gids to 256
Some adapters report more than 256 gid entries. Restrict it to 256 for now. Fixes: 1ac5a40("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent f86b31c commit 847b978

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

drivers/infiniband/hw/bnxt_re/qplib_sp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
149149
attr->max_inline_data = le32_to_cpu(sb->max_inline_data);
150150
attr->l2_db_size = (sb->l2_db_space_size + 1) *
151151
(0x01 << RCFW_DBR_BASE_PAGE_SHIFT);
152-
attr->max_sgid = le32_to_cpu(sb->max_gid);
152+
attr->max_sgid = BNXT_QPLIB_NUM_GIDS_SUPPORTED;
153153

154154
bnxt_qplib_query_version(rcfw, attr->fw_ver);
155155

drivers/infiniband/hw/bnxt_re/qplib_sp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
struct bnxt_qplib_dev_attr {
4848
#define FW_VER_ARR_LEN 4
4949
u8 fw_ver[FW_VER_ARR_LEN];
50+
#define BNXT_QPLIB_NUM_GIDS_SUPPORTED 256
5051
u16 max_sgid;
5152
u16 max_mrw;
5253
u32 max_qp;

0 commit comments

Comments
 (0)