summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2016-07-05 11:27:47 +0200
committerDavid S. Miller <davem@davemloft.net>2016-07-05 09:06:30 -0700
commitb090ef068645d6a9e69f04e571a3dcb32eb37d81 (patch)
treec7441d12a48e3ae83c19f0af199d305f13e08a44 /drivers/net/ethernet/mellanox/mlxsw/spectrum.h
parentc602242761dff9f698e16f3ab474e48da1b83f8f (diff)
downloadop-kernel-dev-b090ef068645d6a9e69f04e571a3dcb32eb37d81.zip
op-kernel-dev-b090ef068645d6a9e69f04e571a3dcb32eb37d81.tar.gz
mlxsw: Introduce simplistic KVD linear area manager
This is a very simple manager for KVD linear area. Currently, the allocator will either allocate a single entry from pre-defined sub-area, or in case more than one entry is needed, it will allocate 32-entry chunk in other pre-defined sub-area. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index f7d34d8..e781128 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -253,6 +253,9 @@ struct mlxsw_sp {
u8 port_to_module[MLXSW_PORT_MAX_PORTS];
struct mlxsw_sp_sb sb;
struct mlxsw_sp_router router;
+ struct {
+ DECLARE_BITMAP(usage, MLXSW_SP_KVD_LINEAR_SIZE);
+ } kvdl;
};
static inline struct mlxsw_sp_upper *
@@ -539,4 +542,7 @@ int mlxsw_sp_router_neigh_construct(struct net_device *dev,
void mlxsw_sp_router_neigh_destroy(struct net_device *dev,
struct neighbour *n);
+int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, unsigned int entry_count);
+void mlxsw_sp_kvdl_free(struct mlxsw_sp *mlxsw_sp, int entry_index);
+
#endif
OpenPOWER on IntegriCloud