]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_trap: Store all trap data in one array
authorIdo Schimmel <idosch@mellanox.com>
Sat, 16 May 2020 22:43:08 +0000 (01:43 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 May 2020 23:42:31 +0000 (16:42 -0700)
commit00e57e318f1254869a3812e5bef961d0a43068dd
tree0b12f69b31fa2417cc8855d1f5e5b003e90a3ce1
parent40caf9c921bf439cca2509080b362d2439c2b24f
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: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.h