Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48303
b: refs/heads/master
c: c20e20a
h: refs/heads/master
i:
  48301: 3dd35ce
  48299: d748dda
  48295: 1461655
  48287: 765eda7
v: v3
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed Feb 13, 2007
1 parent 8a665e3 commit 28115d9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 391e4dea7189eef32b0c2d121e7e047110c1b83c
refs/heads/master: c20e20ab0f3af9a44842ea11287c9ecd034a5d33
20 changes: 15 additions & 5 deletions trunk/drivers/infiniband/hw/mthca/mthca_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr)
int mthca_init_mr_table(struct mthca_dev *dev)
{
unsigned long addr;
int err, i;
int mpts, mtts, err, i;

err = mthca_alloc_init(&dev->mr_table.mpt_alloc,
dev->limits.num_mpts,
Expand Down Expand Up @@ -799,13 +799,21 @@ int mthca_init_mr_table(struct mthca_dev *dev)
err = -EINVAL;
goto err_fmr_mpt;
}
mpts = mtts = 1 << i;
} else {
mpts = dev->limits.num_mtt_segs;
mtts = dev->limits.num_mpts;
}

if (!mthca_is_memfree(dev) &&
(dev->mthca_flags & MTHCA_FLAG_FMR)) {

addr = pci_resource_start(dev->pdev, 4) +
((pci_resource_len(dev->pdev, 4) - 1) &
dev->mr_table.mpt_base);

dev->mr_table.tavor_fmr.mpt_base =
ioremap(addr, (1 << i) * sizeof(struct mthca_mpt_entry));
ioremap(addr, mpts * sizeof(struct mthca_mpt_entry));

if (!dev->mr_table.tavor_fmr.mpt_base) {
mthca_warn(dev, "MPT ioremap for FMR failed.\n");
Expand All @@ -818,19 +826,21 @@ int mthca_init_mr_table(struct mthca_dev *dev)
dev->mr_table.mtt_base);

dev->mr_table.tavor_fmr.mtt_base =
ioremap(addr, (1 << i) * MTHCA_MTT_SEG_SIZE);
ioremap(addr, mtts * MTHCA_MTT_SEG_SIZE);
if (!dev->mr_table.tavor_fmr.mtt_base) {
mthca_warn(dev, "MTT ioremap for FMR failed.\n");
err = -ENOMEM;
goto err_fmr_mtt;
}
}

err = mthca_buddy_init(&dev->mr_table.tavor_fmr.mtt_buddy, i);
if (dev->limits.fmr_reserved_mtts) {
err = mthca_buddy_init(&dev->mr_table.tavor_fmr.mtt_buddy, fls(mtts - 1));
if (err)
goto err_fmr_mtt_buddy;

/* Prevent regular MRs from using FMR keys */
err = mthca_buddy_alloc(&dev->mr_table.mtt_buddy, i);
err = mthca_buddy_alloc(&dev->mr_table.mtt_buddy, fls(mtts - 1));
if (err)
goto err_reserve_fmr;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/mthca/mthca_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,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 (mthca_is_memfree(dev))
if (mthca_is_memfree(dev) || BITS_PER_LONG == 64)
dev->limits.fmr_reserved_mtts = 0;
else
dev->limits.fmr_reserved_mtts = request->fmr_reserved_mtts;
Expand Down

0 comments on commit 28115d9

Please sign in to comment.