net/mlx4: Add mlx4_bitmap zone allocator
authorMatan Barak <matanb@mellanox.com>
Thu, 11 Dec 2014 08:57:56 +0000 (10:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Dec 2014 19:47:35 +0000 (14:47 -0500)
commit7a89399ffad7b7c47b43afda010309b3b88538c0
tree789d8dd281b3589c555c73b5ec455cab646dad32
parentab256e5ad02b36951f01bf6b5cfda25f14820847
net/mlx4: Add mlx4_bitmap zone allocator

The zone allocator is a mechanism which manages a few mlx4_bitmaps.

When allocating a resource, the user indicates the desired zone of
which this resource will be allocated from. If possible, the resource
will be allocated from this zone. Otherwise, the resource will be
allocated from a less-than, equal-to, higher-than priority zone,
according to the desired zone's properties with that respective
allocation order.

Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/alloc.c
drivers/net/ethernet/mellanox/mlx4/mlx4.h