summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_profile.c
diff options
context:
space:
mode:
authorRoland Dreier <roland@topspin.com>2005-04-17 00:26:32 +0200
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 00:26:32 +0200
commitd10ddbf6d7f6699c386d1f41bf542189de32b6be (patch)
treeb2e3ab95925407472fa9c62bb6016d85f822cb68 /drivers/infiniband/hw/mthca/mthca_profile.c
parent[PATCH] IB/mthca: tweaks to mthca_cmd.c (diff)
downloadlinux-d10ddbf6d7f6699c386d1f41bf542189de32b6be.tar.xz
linux-d10ddbf6d7f6699c386d1f41bf542189de32b6be.zip
[PATCH] IB/mthca: encapsulate mem-free check into mthca_is_memfree()
Clean up mem-free mode support by introducing mthca_is_memfree() function, which encapsulates the logic of deciding if a device is mem-free. 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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_profile.c b/drivers/infiniband/hw/mthca/mthca_profile.c
index fd3f167e6460..4fedc32d5871 100644
--- a/drivers/infiniband/hw/mthca/mthca_profile.c
+++ b/drivers/infiniband/hw/mthca/mthca_profile.c
@@ -116,11 +116,11 @@ u64 mthca_make_profile(struct mthca_dev *dev,
profile[i].type = i;
profile[i].log_num = max(ffs(profile[i].num) - 1, 0);
profile[i].size *= profile[i].num;
- if (dev->hca_type == ARBEL_NATIVE)
+ if (mthca_is_memfree(dev))
profile[i].size = max(profile[i].size, (u64) PAGE_SIZE);
}
- if (dev->hca_type == ARBEL_NATIVE) {
+ if (mthca_is_memfree(dev)) {
mem_base = 0;
mem_avail = dev_lim->hca.arbel.max_icm_sz;
} else {
@@ -165,7 +165,7 @@ u64 mthca_make_profile(struct mthca_dev *dev,
(unsigned long long) profile[i].size);
}
- if (dev->hca_type == ARBEL_NATIVE)
+ if (mthca_is_memfree(dev))
mthca_dbg(dev, "HCA context memory: reserving %d KB\n",
(int) (total_size >> 10));
else
@@ -267,7 +267,7 @@ u64 mthca_make_profile(struct mthca_dev *dev,
* out of the MR pool. They don't use additional memory, but
* we assign them as part of the HCA profile anyway.
*/
- if (dev->hca_type == ARBEL_NATIVE)
+ if (mthca_is_memfree(dev))
dev->limits.fmr_reserved_mtts = 0;
else
dev->limits.fmr_reserved_mtts = request->fmr_reserved_mtts;