RDMA/bnxt_re: Fix the max CQ WQEs for older adapters
authorAbhishek Mohapatra <abhishek.mohapatra@broadcom.com>
Tue, 8 Oct 2024 07:41:33 +0000 (00:41 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 11 Oct 2024 23:49:00 +0000 (20:49 -0300)
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: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Link: https://patch.msgid.link/r/1728373302-19530-2-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Abhishek Mohapatra<abhishek.mohapatra@broadcom.com>
Reviewed-by: Chandramohan Akula <chandramohan.akula@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/qplib_sp.c
drivers/infiniband/hw/bnxt_re/qplib_sp.h

index 4f75e7e..32c1cc7 100644 (file)
@@ -140,6 +140,8 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw,
                            min_t(u32, sb->max_sge_var_wqe, BNXT_VAR_MAX_SGE) : 6;
        attr->max_cq = le32_to_cpu(sb->max_cq);
        attr->max_cq_wqes = le32_to_cpu(sb->max_cqe);
+       if (!bnxt_qplib_is_chip_gen_p7(rcfw->res->cctx))
+               attr->max_cq_wqes = min_t(u32, BNXT_QPLIB_MAX_CQ_WQES, attr->max_cq_wqes);
        attr->max_cq_sges = attr->max_qp_sges;
        attr->max_mr = le32_to_cpu(sb->max_mr);
        attr->max_mw = le32_to_cpu(sb->max_mw);
index acd9c14..ecf3f45 100644 (file)
@@ -56,6 +56,7 @@ struct bnxt_qplib_dev_attr {
        u32                             max_qp_wqes;
        u32                             max_qp_sges;
        u32                             max_cq;
+#define BNXT_QPLIB_MAX_CQ_WQES          0xfffff
        u32                             max_cq_wqes;
        u32                             max_cq_sges;
        u32                             max_mr;