diff options
author | Ido Schimmel <idosch@mellanox.com> | 2020-03-30 22:38:26 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-30 17:54:59 -0700 |
commit | 03484e49e7ccc407f4d27c3233956c364591961f (patch) | |
tree | aae47657c9bc8797f53cb9a2b5e6495bd3df639b /drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.h | |
parent | 2b84d7c3f6ccbb77021f36129ff59cc38896b226 (diff) |
mlxsw: spectrum: Track used packet trap policer IDs
During initialization the driver configures various packet trap groups
and binds policers to them.
Currently, most of these groups are not exposed to user space and
therefore their policers should not be exposed as well. Otherwise, user
space will be able to alter policer parameters without knowing which
packet traps are policed by the policer.
Use a bitmap to track the used policer IDs so that these policers will
not be registered with devlink in a subsequent patch.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.h new file mode 100644 index 000000000000..12c5641b2165 --- /dev/null +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */ +/* Copyright (c) 2020 Mellanox Technologies. All rights reserved */ + +#ifndef _MLXSW_SPECTRUM_TRAP_H +#define _MLXSW_SPECTRUM_TRAP_H + +struct mlxsw_sp_trap { + u64 max_policers; + unsigned long policers_usage[]; /* Usage bitmap */ +}; + +#endif |