Commit 200b7cca authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: spectrum_trap: Store all trap data in one array

Each trap registered with devlink is mapped to one or more Rx listeners.
These listeners allow the switch driver (e.g., mlxsw_spectrum) to
register a function that is called when a packet is received (trapped)
for a specific reason.

Currently, three arrays are used to describe the mapping between the
logical devlink traps and the Rx listeners.

Instead, get rid of these arrays and store all the information in one
array that is easier to validate and extend with more per-trap
information.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b14a40db
......@@ -14,6 +14,9 @@ struct mlxsw_sp_trap {
struct mlxsw_sp_trap_group_item *group_items_arr;
u64 groups_count; /* Number of registered groups */
struct mlxsw_sp_trap_item *trap_items_arr;
u64 traps_count; /* Number of registered traps */
u64 max_policers;
unsigned long policers_usage[]; /* Usage bitmap */
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment