Skip to content

Commit

Permalink
RDS: IB: Initialize max_items based on underlying device attributes
Browse files Browse the repository at this point in the history
Use max_1m_mrs/max_8k_mrs while setting max_items, as the former
variables are set based on the underlying device attributes.

Signed-off-by: Avinash Repaka <avinash.repaka@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Avinash Repaka authored and David S. Miller committed Oct 6, 2017
1 parent 9dff993 commit b1fb67f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/rds/ib_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,11 @@ struct rds_ib_mr_pool *rds_ib_create_mr_pool(struct rds_ib_device *rds_ibdev,
if (pool_type == RDS_IB_MR_1M_POOL) {
/* +1 allows for unaligned MRs */
pool->fmr_attr.max_pages = RDS_MR_1M_MSG_SIZE + 1;
pool->max_items = RDS_MR_1M_POOL_SIZE;
pool->max_items = rds_ibdev->max_1m_mrs;
} else {
/* pool_type == RDS_IB_MR_8K_POOL */
pool->fmr_attr.max_pages = RDS_MR_8K_MSG_SIZE + 1;
pool->max_items = RDS_MR_8K_POOL_SIZE;
pool->max_items = rds_ibdev->max_8k_mrs;
}

pool->max_free_pinned = pool->max_items * pool->fmr_attr.max_pages / 4;
Expand Down

0 comments on commit b1fb67f

Please sign in to comment.