diff options
author | Roland Dreier <rolandd@cisco.com> | 2008-07-23 11:12:47 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-07-23 11:12:47 -0400 |
commit | 76442640829163d0cdb67c2bf0cb4b81a0fe537b (patch) | |
tree | 8c5cd9094d24a8181d64cd840636ab9885c8e1c1 /drivers/net/mlx4/pd.c | |
parent | 95d04f0735b4fc837bff9aedcc3f3efb20ddc3d1 (diff) |
mlx4_core: Improve error message when not enough UAR pages are available
If an mlx4 device with default FW (which gives a UAR BAR size of 8 MB)
is used in a system with 64 KB pages, then there are only 8192/64==128
UAR pages available. However, the first 128 UAR pages are reserved
for use with event queue doorbells, so no UAR pages are available to
do anything else with, which means that the driver cannot work.
The current driver fails with a fairly cryptic "Failed to allocate
driver access region, aborting" message in this situation. Fix the
driver to detect the problem earlier and print out a clearer
description of the problem and a suggestion of how to fix it (use a
new firmware image).
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4/pd.c')
-rw-r--r-- | drivers/net/mlx4/pd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/mlx4/pd.c b/drivers/net/mlx4/pd.c index 3a93c5f0f7ab..aa616892d09c 100644 --- a/drivers/net/mlx4/pd.c +++ b/drivers/net/mlx4/pd.c | |||
@@ -91,6 +91,13 @@ EXPORT_SYMBOL_GPL(mlx4_uar_free); | |||
91 | 91 | ||
92 | int mlx4_init_uar_table(struct mlx4_dev *dev) | 92 | int mlx4_init_uar_table(struct mlx4_dev *dev) |
93 | { | 93 | { |
94 | if (dev->caps.num_uars <= 128) { | ||
95 | mlx4_err(dev, "Only %d UAR pages (need more than 128)\n", | ||
96 | dev->caps.num_uars); | ||
97 | mlx4_err(dev, "Increase firmware log2_uar_bar_megabytes?\n"); | ||
98 | return -ENODEV; | ||
99 | } | ||
100 | |||
94 | return mlx4_bitmap_init(&mlx4_priv(dev)->uar_table.bitmap, | 101 | return mlx4_bitmap_init(&mlx4_priv(dev)->uar_table.bitmap, |
95 | dev->caps.num_uars, dev->caps.num_uars - 1, | 102 | dev->caps.num_uars, dev->caps.num_uars - 1, |
96 | max(128, dev->caps.reserved_uars)); | 103 | max(128, dev->caps.reserved_uars)); |