diff options
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_hw.c')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 9343a1522977..71942af4fce9 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c | |||
@@ -990,8 +990,6 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev, | |||
990 | struct ocrdma_dev_attr *attr, | 990 | struct ocrdma_dev_attr *attr, |
991 | struct ocrdma_mbx_query_config *rsp) | 991 | struct ocrdma_mbx_query_config *rsp) |
992 | { | 992 | { |
993 | int max_q_mem; | ||
994 | |||
995 | attr->max_pd = | 993 | attr->max_pd = |
996 | (rsp->max_pd_ca_ack_delay & OCRDMA_MBX_QUERY_CFG_MAX_PD_MASK) >> | 994 | (rsp->max_pd_ca_ack_delay & OCRDMA_MBX_QUERY_CFG_MAX_PD_MASK) >> |
997 | OCRDMA_MBX_QUERY_CFG_MAX_PD_SHIFT; | 995 | OCRDMA_MBX_QUERY_CFG_MAX_PD_SHIFT; |
@@ -1004,6 +1002,9 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev, | |||
1004 | attr->max_recv_sge = (rsp->max_write_send_sge & | 1002 | attr->max_recv_sge = (rsp->max_write_send_sge & |
1005 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_MASK) >> | 1003 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_MASK) >> |
1006 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_SHIFT; | 1004 | OCRDMA_MBX_QUERY_CFG_MAX_SEND_SGE_SHIFT; |
1005 | attr->max_srq_sge = (rsp->max_srq_rqe_sge & | ||
1006 | OCRDMA_MBX_QUERY_CFG_MAX_SRQ_SGE_MASK) >> | ||
1007 | OCRDMA_MBX_QUERY_CFG_MAX_SRQ_SGE_OFFSET; | ||
1007 | attr->max_ord_per_qp = (rsp->max_ird_ord_per_qp & | 1008 | attr->max_ord_per_qp = (rsp->max_ird_ord_per_qp & |
1008 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_MASK) >> | 1009 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_MASK) >> |
1009 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_SHIFT; | 1010 | OCRDMA_MBX_QUERY_CFG_MAX_ORD_PER_QP_SHIFT; |
@@ -1037,18 +1038,15 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev, | |||
1037 | attr->max_inline_data = | 1038 | attr->max_inline_data = |
1038 | attr->wqe_size - (sizeof(struct ocrdma_hdr_wqe) + | 1039 | attr->wqe_size - (sizeof(struct ocrdma_hdr_wqe) + |
1039 | sizeof(struct ocrdma_sge)); | 1040 | sizeof(struct ocrdma_sge)); |
1040 | max_q_mem = OCRDMA_Q_PAGE_BASE_SIZE << (OCRDMA_MAX_Q_PAGE_SIZE_CNT - 1); | ||
1041 | /* hw can queue one less then the configured size, | ||
1042 | * so publish less by one to stack. | ||
1043 | */ | ||
1044 | if (dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) { | 1041 | if (dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) { |
1045 | dev->attr.max_wqe = max_q_mem / dev->attr.wqe_size; | ||
1046 | attr->ird = 1; | 1042 | attr->ird = 1; |
1047 | attr->ird_page_size = OCRDMA_MIN_Q_PAGE_SIZE; | 1043 | attr->ird_page_size = OCRDMA_MIN_Q_PAGE_SIZE; |
1048 | attr->num_ird_pages = MAX_OCRDMA_IRD_PAGES; | 1044 | attr->num_ird_pages = MAX_OCRDMA_IRD_PAGES; |
1049 | } else | 1045 | } |
1050 | dev->attr.max_wqe = (max_q_mem / dev->attr.wqe_size) - 1; | 1046 | dev->attr.max_wqe = rsp->max_wqes_rqes_per_q >> |
1051 | dev->attr.max_rqe = (max_q_mem / dev->attr.rqe_size) - 1; | 1047 | OCRDMA_MBX_QUERY_CFG_MAX_WQES_PER_WQ_OFFSET; |
1048 | dev->attr.max_rqe = rsp->max_wqes_rqes_per_q & | ||
1049 | OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_MASK; | ||
1052 | } | 1050 | } |
1053 | 1051 | ||
1054 | static int ocrdma_check_fw_config(struct ocrdma_dev *dev, | 1052 | static int ocrdma_check_fw_config(struct ocrdma_dev *dev, |