Commit 07bb5424 authored by Mahesh Vardhamanaiah's avatar Mahesh Vardhamanaiah Committed by Roland Dreier

RDMA/ocrdma: Correct reported max queue sizes

Fix code to read the max wqe and max rqe values from mailbox response.
Signed-off-by: default avatarMahesh Vardhamanaiah <mahesh.vardhamanaiah@emulex.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 6ab6827e
...@@ -990,8 +990,6 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev, ...@@ -990,8 +990,6 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev,
struct ocrdma_dev_attr *attr, struct ocrdma_dev_attr *attr,
struct ocrdma_mbx_query_config *rsp) struct ocrdma_mbx_query_config *rsp)
{ {
int max_q_mem;
attr->max_pd = attr->max_pd =
(rsp->max_pd_ca_ack_delay & OCRDMA_MBX_QUERY_CFG_MAX_PD_MASK) >> (rsp->max_pd_ca_ack_delay & OCRDMA_MBX_QUERY_CFG_MAX_PD_MASK) >>
OCRDMA_MBX_QUERY_CFG_MAX_PD_SHIFT; OCRDMA_MBX_QUERY_CFG_MAX_PD_SHIFT;
...@@ -1037,18 +1035,15 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev, ...@@ -1037,18 +1035,15 @@ static void ocrdma_get_attr(struct ocrdma_dev *dev,
attr->max_inline_data = attr->max_inline_data =
attr->wqe_size - (sizeof(struct ocrdma_hdr_wqe) + attr->wqe_size - (sizeof(struct ocrdma_hdr_wqe) +
sizeof(struct ocrdma_sge)); sizeof(struct ocrdma_sge));
max_q_mem = OCRDMA_Q_PAGE_BASE_SIZE << (OCRDMA_MAX_Q_PAGE_SIZE_CNT - 1);
/* hw can queue one less then the configured size,
* so publish less by one to stack.
*/
if (dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) { if (dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) {
dev->attr.max_wqe = max_q_mem / dev->attr.wqe_size;
attr->ird = 1; attr->ird = 1;
attr->ird_page_size = OCRDMA_MIN_Q_PAGE_SIZE; attr->ird_page_size = OCRDMA_MIN_Q_PAGE_SIZE;
attr->num_ird_pages = MAX_OCRDMA_IRD_PAGES; attr->num_ird_pages = MAX_OCRDMA_IRD_PAGES;
} else }
dev->attr.max_wqe = (max_q_mem / dev->attr.wqe_size) - 1; dev->attr.max_wqe = rsp->max_wqes_rqes_per_q >>
dev->attr.max_rqe = (max_q_mem / dev->attr.rqe_size) - 1; OCRDMA_MBX_QUERY_CFG_MAX_WQES_PER_WQ_OFFSET;
dev->attr.max_rqe = rsp->max_wqes_rqes_per_q &
OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_MASK;
} }
static int ocrdma_check_fw_config(struct ocrdma_dev *dev, static int ocrdma_check_fw_config(struct ocrdma_dev *dev,
......
...@@ -458,7 +458,7 @@ enum { ...@@ -458,7 +458,7 @@ enum {
OCRDMA_MBX_QUERY_CFG_MAX_WQES_PER_WQ_OFFSET, OCRDMA_MBX_QUERY_CFG_MAX_WQES_PER_WQ_OFFSET,
OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_OFFSET = 0, OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_OFFSET = 0,
OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_MASK = 0xFFFF << OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_MASK = 0xFFFF <<
OCRDMA_MBX_QUERY_CFG_MAX_WQES_PER_WQ_OFFSET, OCRDMA_MBX_QUERY_CFG_MAX_RQES_PER_RQ_OFFSET,
OCRDMA_MBX_QUERY_CFG_MAX_CQ_OFFSET = 16, OCRDMA_MBX_QUERY_CFG_MAX_CQ_OFFSET = 16,
OCRDMA_MBX_QUERY_CFG_MAX_CQ_MASK = 0xFFFF << OCRDMA_MBX_QUERY_CFG_MAX_CQ_MASK = 0xFFFF <<
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment