mlxsw: spectrum: Add VRRP traps
authorIdo Schimmel <idosch@mellanox.com>
Sat, 14 Jul 2018 08:39:53 +0000 (11:39 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Jul 2018 18:23:26 +0000 (11:23 -0700)
Virtual Router Redundancy Protocol packets are used to communicate the
state of the Master router associated with the virtual router ID (VRID).

These are link-local multicast packets sent with IP protocol 112 that
are trapped in the router block in the ASIC.

Add a trap for these packets and mark the trapped packets to prevent
them from potentially being re-flooded by the bridge driver.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/trap.h

index 526c8c61ce2dccffe2b391d8b64778cc02b31bb4..6ec0f91a93cc2ac9ff5755efb1722146daf6284d 100644 (file)
@@ -3386,6 +3386,8 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
        MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV4, TRAP_TO_CPU, ROUTER_EXP, false),
        MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV6, TRAP_TO_CPU, ROUTER_EXP, false),
        MLXSW_SP_RXL_MARK(IPIP_DECAP_ERROR, TRAP_TO_CPU, ROUTER_EXP, false),
+       MLXSW_SP_RXL_MARK(IPV4_VRRP, TRAP_TO_CPU, ROUTER_EXP, false),
+       MLXSW_SP_RXL_MARK(IPV6_VRRP, TRAP_TO_CPU, ROUTER_EXP, false),
        /* PKT Sample trap */
        MLXSW_RXL(mlxsw_sp_rx_listener_sample_func, PKT_SAMPLE, MIRROR_TO_CPU,
                  false, SP_IP2ME, DISCARD),
index 399e9d6993f72500bc2339b285f7f0d55de69c3e..eb437f59640daa7ddadb74e61e8203dfb2971b6a 100644 (file)
@@ -63,6 +63,7 @@ enum {
        MLXSW_TRAP_ID_LBERROR = 0x54,
        MLXSW_TRAP_ID_IPV4_OSPF = 0x55,
        MLXSW_TRAP_ID_IPV4_PIM = 0x58,
+       MLXSW_TRAP_ID_IPV4_VRRP = 0x59,
        MLXSW_TRAP_ID_RPF = 0x5C,
        MLXSW_TRAP_ID_IP2ME = 0x5F,
        MLXSW_TRAP_ID_IPV6_UNSPECIFIED_ADDRESS = 0x60,
@@ -78,6 +79,7 @@ enum {
        MLXSW_TRAP_ID_IPV6_ALL_ROUTERS_LINK = 0x6F,
        MLXSW_TRAP_ID_RTR_INGRESS0 = 0x70,
        MLXSW_TRAP_ID_IPV6_PIM = 0x79,
+       MLXSW_TRAP_ID_IPV6_VRRP = 0x7A,
        MLXSW_TRAP_ID_IPV4_BGP = 0x88,
        MLXSW_TRAP_ID_IPV6_BGP = 0x89,
        MLXSW_TRAP_ID_L3_IPV6_ROUTER_SOLICITATION = 0x8A,