aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsantosh.shilimkar@oracle.com <santosh.shilimkar@oracle.com>2016-03-01 18:20:52 -0500
committerDavid S. Miller <davem@davemloft.net>2016-03-02 14:13:19 -0500
commit2cb2912d65633e751d3f8397377174501412aa47 (patch)
tree690fc1a19547289d37f9cf831f03d49e5e5a17ee
parentdb42753adb638b63572583162bb08ea193947309 (diff)
RDS: IB: add Fastreg MR (FRMR) detection support
Discovere Fast Memmory Registration support using IB device IB_DEVICE_MEM_MGT_EXTENSIONS. Certain HCA might support just FRMR or FMR or both FMR and FRWR. In case both mr type are supported, default FMR is used. Default MR is still kept as FMR against what everyone else is following. Default will be changed to FRMR once the RDS performance with FRMR is comparable with FMR. The work is in progress for the same. Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/rds/ib.c10
-rw-r--r--net/rds/ib.h4
-rw-r--r--net/rds/ib_mr.h1
3 files changed, 15 insertions, 0 deletions
diff --git a/net/rds/ib.c b/net/rds/ib.c
index bb32cb9d85f1..b5342fddaf98 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -140,6 +140,12 @@ static void rds_ib_add_one(struct ib_device *device)
140 rds_ibdev->max_wrs = device->attrs.max_qp_wr; 140 rds_ibdev->max_wrs = device->attrs.max_qp_wr;
141 rds_ibdev->max_sge = min(device->attrs.max_sge, RDS_IB_MAX_SGE); 141 rds_ibdev->max_sge = min(device->attrs.max_sge, RDS_IB_MAX_SGE);
142 142
143 rds_ibdev->has_fr = (device->attrs.device_cap_flags &
144 IB_DEVICE_MEM_MGT_EXTENSIONS);
145 rds_ibdev->has_fmr = (device->alloc_fmr && device->dealloc_fmr &&
146 device->map_phys_fmr && device->unmap_fmr);
147 rds_ibdev->use_fastreg = (rds_ibdev->has_fr && !rds_ibdev->has_fmr);
148
143 rds_ibdev->fmr_max_remaps = device->attrs.max_map_per_fmr?: 32; 149 rds_ibdev->fmr_max_remaps = device->attrs.max_map_per_fmr?: 32;
144 rds_ibdev->max_1m_mrs = device->attrs.max_mr ? 150 rds_ibdev->max_1m_mrs = device->attrs.max_mr ?
145 min_t(unsigned int, (device->attrs.max_mr / 2), 151 min_t(unsigned int, (device->attrs.max_mr / 2),
@@ -178,6 +184,10 @@ static void rds_ib_add_one(struct ib_device *device)
178 rds_ibdev->fmr_max_remaps, rds_ibdev->max_1m_mrs, 184 rds_ibdev->fmr_max_remaps, rds_ibdev->max_1m_mrs,
179 rds_ibdev->max_8k_mrs); 185 rds_ibdev->max_8k_mrs);
180 186
187 pr_info("RDS/IB: %s: %s supported and preferred\n",
188 device->name,
189 rds_ibdev->use_fastreg ? "FRMR" : "FMR");
190
181 INIT_LIST_HEAD(&rds_ibdev->ipaddr_list); 191 INIT_LIST_HEAD(&rds_ibdev->ipaddr_list);
182 INIT_LIST_HEAD(&rds_ibdev->conn_list); 192 INIT_LIST_HEAD(&rds_ibdev->conn_list);
183 193
diff --git a/net/rds/ib.h b/net/rds/ib.h
index 62fe7d5330ad..c5eddc2086ff 100644
--- a/net/rds/ib.h
+++ b/net/rds/ib.h
@@ -200,6 +200,10 @@ struct rds_ib_device {
200 struct list_head conn_list; 200 struct list_head conn_list;
201 struct ib_device *dev; 201 struct ib_device *dev;
202 struct ib_pd *pd; 202 struct ib_pd *pd;
203 bool has_fmr;
204 bool has_fr;
205 bool use_fastreg;
206
203 unsigned int max_mrs; 207 unsigned int max_mrs;
204 struct rds_ib_mr_pool *mr_1m_pool; 208 struct rds_ib_mr_pool *mr_1m_pool;
205 struct rds_ib_mr_pool *mr_8k_pool; 209 struct rds_ib_mr_pool *mr_8k_pool;
diff --git a/net/rds/ib_mr.h b/net/rds/ib_mr.h
index add7725bc062..2f9b9c3afc59 100644
--- a/net/rds/ib_mr.h
+++ b/net/rds/ib_mr.h
@@ -93,6 +93,7 @@ struct rds_ib_mr_pool {
93extern struct workqueue_struct *rds_ib_mr_wq; 93extern struct workqueue_struct *rds_ib_mr_wq;
94extern unsigned int rds_ib_mr_1m_pool_size; 94extern unsigned int rds_ib_mr_1m_pool_size;
95extern unsigned int rds_ib_mr_8k_pool_size; 95extern unsigned int rds_ib_mr_8k_pool_size;
96extern bool prefer_frmr;
96 97
97struct rds_ib_mr_pool *rds_ib_create_mr_pool(struct rds_ib_device *rds_dev, 98struct rds_ib_mr_pool *rds_ib_create_mr_pool(struct rds_ib_device *rds_dev,
98 int npages); 99 int npages);