RDS: IB: Initialize max_items based on underlying device attributes
authorAvinash Repaka <[email protected]>
Wed, 4 Oct 2017 19:11:29 +0000 (12:11 -0700)
committerDavid S. Miller <[email protected]>
Fri, 6 Oct 2017 04:16:33 +0000 (21:16 -0700)
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 <[email protected]>
Acked-by: Santosh Shilimkar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/rds/ib_rdma.c

index 9a3c54e659e9e08430ba4649df65ccfbaea6d939..e678699268a253d1e65aea63e64ac30b44ac6dcd 100644 (file)
@@ -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;