mlxsw: spectrum: Add multicast router traps and trap groups
authorYotam Gigi <yotamg@mellanox.com>
Tue, 19 Sep 2017 08:00:20 +0000 (10:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Sep 2017 21:21:40 +0000 (14:21 -0700)
commitb48cfc80ce9c27368e331d9aa742314487b0ee12
tree6e681b881c2391e862e3a751fbd6d3b5c4d31352
parent91e4d59a4600afe64b44e013a7c1805bbfe61e59
mlxsw: spectrum: Add multicast router traps and trap groups

Add three new traps needed for multicast routing:
 - PIM: Trap for PIM protocol control packets.
 - RPF: Trap for packets that fail the RPF check on a specific hardware
   route entry.
 - MULTICAST: Generic trap for multicast. It is used for routes that trap
   the packets to the CPU.

The RPF and MULTICAST traps have rate limiters as these traps may have
line-rate of packets trapped. The PIM trap has a rate limiter similarly to
other L3 control protocols. The rate limiters are implemented by adding
three new trap groups for the newly introduced traps.

Signed-off-by: Yotam Gigi <yotamg@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/reg.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/trap.h