Skip to content

Commit ac6df53

Browse files
Abhishek Mohapatrajgunthorpe
authored andcommitted
RDMA/bnxt_re: Fix the max CQ WQEs for older adapters
Older adapters doesn't support the MAX CQ WQEs reported by older FW. So restrict the value reported to 1M always for older adapters. Fixes: 1ac5a40 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://patch.msgid.link/r/[email protected] Signed-off-by: Abhishek Mohapatra<[email protected]> Reviewed-by: Chandramohan Akula <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 4d784c0 commit ac6df53

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

drivers/infiniband/hw/bnxt_re/qplib_sp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
140140
min_t(u32, sb->max_sge_var_wqe, BNXT_VAR_MAX_SGE) : 6;
141141
attr->max_cq = le32_to_cpu(sb->max_cq);
142142
attr->max_cq_wqes = le32_to_cpu(sb->max_cqe);
143+
if (!bnxt_qplib_is_chip_gen_p7(rcfw->res->cctx))
144+
attr->max_cq_wqes = min_t(u32, BNXT_QPLIB_MAX_CQ_WQES, attr->max_cq_wqes);
143145
attr->max_cq_sges = attr->max_qp_sges;
144146
attr->max_mr = le32_to_cpu(sb->max_mr);
145147
attr->max_mw = le32_to_cpu(sb->max_mw);

drivers/infiniband/hw/bnxt_re/qplib_sp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ struct bnxt_qplib_dev_attr {
5656
u32 max_qp_wqes;
5757
u32 max_qp_sges;
5858
u32 max_cq;
59+
#define BNXT_QPLIB_MAX_CQ_WQES 0xfffff
5960
u32 max_cq_wqes;
6061
u32 max_cq_sges;
6162
u32 max_mr;

0 commit comments

Comments
 (0)