aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_profile.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2005-04-16 18:26:30 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:26:30 -0400
commite0f5fdca1ca9d1659b920827e5cf6dbad20e5391 (patch)
tree71e6410e14c4c285ce128e99070a38ded75a14f7 /drivers/infiniband/hw/mthca/mthca_profile.c
parentd0a9d25cdcd511dd523357bc902979220dc72a2e (diff)
[PATCH] IB/mthca: add fast memory region implementation
Implement fast memory regions (FMRs), where the driver writes directly into the HCA's translation tables rather than requiring a firmware command. For Tavor, MTTs for FMR are separate from regular MTTs, and are reserved at driver initialization. This is done to limit the amount of virtual memory needed to map the MTTs. For Arbel, there's no such limitation, and all MTTs and MPTs may be used for FMR or for regular MR. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_profile.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_profile.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_profile.c b/drivers/infiniband/hw/mthca/mthca_profile.c
index cfd6f70c8df3..fd3f167e6460 100644
--- a/drivers/infiniband/hw/mthca/mthca_profile.c
+++ b/drivers/infiniband/hw/mthca/mthca_profile.c
@@ -223,9 +223,10 @@ u64 mthca_make_profile(struct mthca_dev *dev,
223 init_hca->mc_hash_sz = 1 << (profile[i].log_num - 1); 223 init_hca->mc_hash_sz = 1 << (profile[i].log_num - 1);
224 break; 224 break;
225 case MTHCA_RES_MPT: 225 case MTHCA_RES_MPT:
226 dev->limits.num_mpts = profile[i].num; 226 dev->limits.num_mpts = profile[i].num;
227 init_hca->mpt_base = profile[i].start; 227 dev->mr_table.mpt_base = profile[i].start;
228 init_hca->log_mpt_sz = profile[i].log_num; 228 init_hca->mpt_base = profile[i].start;
229 init_hca->log_mpt_sz = profile[i].log_num;
229 break; 230 break;
230 case MTHCA_RES_MTT: 231 case MTHCA_RES_MTT:
231 dev->limits.num_mtt_segs = profile[i].num; 232 dev->limits.num_mtt_segs = profile[i].num;
@@ -259,6 +260,18 @@ u64 mthca_make_profile(struct mthca_dev *dev,
259 */ 260 */
260 dev->limits.num_pds = MTHCA_NUM_PDS; 261 dev->limits.num_pds = MTHCA_NUM_PDS;
261 262
263 /*
264 * For Tavor, FMRs use ioremapped PCI memory. For 32 bit
265 * systems it may use too much vmalloc space to map all MTT
266 * memory, so we reserve some MTTs for FMR access, taking them
267 * out of the MR pool. They don't use additional memory, but
268 * we assign them as part of the HCA profile anyway.
269 */
270 if (dev->hca_type == ARBEL_NATIVE)
271 dev->limits.fmr_reserved_mtts = 0;
272 else
273 dev->limits.fmr_reserved_mtts = request->fmr_reserved_mtts;
274
262 kfree(profile); 275 kfree(profile);
263 return total_size; 276 return total_size;
264} 277}