mlxsw: spectrum: Add support for counter allocator
authorArkadi Sharshevsky <arkadis@mellanox.com>
Sat, 11 Mar 2017 08:42:51 +0000 (09:42 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Mar 2017 06:50:13 +0000 (23:50 -0700)
commitff7b0d27208bd730aa71bd91087f0ff80ca60eda
tree53e374c94dee2e95943a880d433953d372b81b20
parent27303fcf5734d84c8d018b79d1db154ceaf88df8
mlxsw: spectrum: Add support for counter allocator

Add implementation for counter allocator. The ASIC has special memory
pool for various counting purposes. Counter memory is distributed between
equal size banks.

The static sub-pool configuration should specify the following parameters
for each sub-pool:
- Number of required banks.
- Maximum entry size.

Each module can add dedicated sub-pool or use existing one.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/Makefile
drivers/net/ethernet/mellanox/mlxsw/resources.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h [new file with mode: 0644]