summaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/mlx4.h
diff options
context:
space:
mode:
authorEli Cohen2011-03-22 23:38:45 +0100
committerDavid S. Miller2011-03-23 20:24:24 +0100
commit42d1e017e2f040c3e3d62b6cfa3a26351a865d04 (patch)
tree67adabb8516a4a027377039fdb7ea49b4215a8b3 /drivers/net/mlx4/mlx4.h
parentmlx4: Add blue flame support for kernel consumers (diff)
downloadkernel-qcow2-linux-42d1e017e2f040c3e3d62b6cfa3a26351a865d04.tar.gz
kernel-qcow2-linux-42d1e017e2f040c3e3d62b6cfa3a26351a865d04.tar.xz
kernel-qcow2-linux-42d1e017e2f040c3e3d62b6cfa3a26351a865d04.zip
mlx4_core: maintain available field in bitmap allocator
Add mlx4_bitmap_avail() to give the number of available resources. We want to use this as a hint to whether to allocate a resources or not. This patch is introduced to be used with allocation blue flame registers. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mlx4/mlx4.h')
-rw-r--r--drivers/net/mlx4/mlx4.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index bc9a21657a4f..c1e0e5f1bcdb 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -105,6 +105,7 @@ struct mlx4_bitmap {
u32 max;
u32 reserved_top;
u32 mask;
+ u32 avail;
spinlock_t lock;
unsigned long *table;
};
@@ -371,6 +372,7 @@ u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap);
void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj);
u32 mlx4_bitmap_alloc_range(struct mlx4_bitmap *bitmap, int cnt, int align);
void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt);
+u32 mlx4_bitmap_avail(struct mlx4_bitmap *bitmap);
int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask,
u32 reserved_bot, u32 resetrved_top);
void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap);