Commit c9171ea9 authored by Roland Dreier's avatar Roland Dreier Committed by Linus Torvalds

[PATCH] IB/mthca: mem-free multicast table

Tie up one last loose end by mapping enough context memory to cover
the whole multicast table during initialization, and then enable
mem-free mode.  mthca now supports enough of mem-free mode so that
IPoIB works with a mem-free HCA.
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 86a637df
......@@ -209,6 +209,7 @@ struct mthca_av_table {
struct mthca_mcg_table {
struct semaphore sem;
struct mthca_alloc alloc;
struct mthca_icm_table *table;
};
struct mthca_dev {
......
......@@ -412,8 +412,29 @@ static int __devinit mthca_init_icm(struct mthca_dev *mdev,
goto err_unmap_eqp;
}
/*
* It's not strictly required, but for simplicity just map the
* whole multicast group table now. The table isn't very big
* and it's a lot easier than trying to track ref counts.
*/
mdev->mcg_table.table = mthca_alloc_icm_table(mdev, init_hca->mc_base,
MTHCA_MGM_ENTRY_SIZE,
mdev->limits.num_mgms +
mdev->limits.num_amgms,
mdev->limits.num_mgms +
mdev->limits.num_amgms,
0);
if (!mdev->mcg_table.table) {
mthca_err(mdev, "Failed to map MCG context memory, aborting.\n");
err = -ENOMEM;
goto err_unmap_cq;
}
return 0;
err_unmap_cq:
mthca_free_icm_table(mdev, mdev->cq_table.table);
err_unmap_eqp:
mthca_free_icm_table(mdev, mdev->qp_table.eqp_table);
......@@ -635,13 +656,6 @@ static int __devinit mthca_setup_hca(struct mthca_dev *dev)
mthca_dbg(dev, "NOP command IRQ test passed\n");
if (dev->hca_type == ARBEL_NATIVE) {
mthca_warn(dev, "Sorry, native MT25208 mode support is not complete, "
"aborting.\n");
err = -ENODEV;
goto err_cmd_poll;
}
err = mthca_init_cq_table(dev);
if (err) {
mthca_err(dev, "Failed to initialize "
......@@ -814,6 +828,7 @@ static int __devinit mthca_init_one(struct pci_dev *pdev,
const struct pci_device_id *id)
{
static int mthca_version_printed = 0;
static int mthca_memfree_warned = 0;
int ddr_hidden = 0;
int err;
struct mthca_dev *mdev;
......@@ -893,6 +908,10 @@ static int __devinit mthca_init_one(struct pci_dev *pdev,
mdev->pdev = pdev;
mdev->hca_type = id->driver_data;
if (mdev->hca_type == ARBEL_NATIVE && !mthca_memfree_warned++)
mthca_warn(mdev, "Warning: native MT25208 mode support is incomplete. "
"Your HCA may not work properly.\n");
if (ddr_hidden)
mdev->mthca_flags |= MTHCA_FLAG_DDR_HIDDEN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment