mlxsw: spectrum: Register for IPIP_DECAP_ERROR trap
authorPetr Machata <petrm@mellanox.com>
Sat, 2 Sep 2017 21:49:27 +0000 (23:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Sep 2017 03:23:26 +0000 (20:23 -0700)
These traps are generated for packets that fail checks for source IP,
encapsulation type, or GRE key. Trap these packets to CPU for follow-up
handling by the kernel, which will send ICMP destination unreachable
responses.

Signed-off-by: Petr Machata <petrm@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/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/trap.h

index 992cbfa1f2bcd82df2c261c426dcc56283da0670..ed7cd6c48019ad1526a01050e5e648034b451a1a 100644 (file)
@@ -3400,6 +3400,7 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
        MLXSW_SP_RXL_MARK(HOST_MISS_IPV6, TRAP_TO_CPU, HOST_MISS, false),
        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),
        /* PKT Sample trap */
        MLXSW_RXL(mlxsw_sp_rx_listener_sample_func, PKT_SAMPLE, MIRROR_TO_CPU,
                  false, SP_IP2ME, DISCARD),
index 61652396bf75d88b6023f18df462cc024d6f3fc3..f396a1fef63359a9fe11d0d11844596a8f25e230 100644 (file)
@@ -85,6 +85,7 @@ enum {
        MLXSW_TRAP_ID_HOST_MISS_IPV4 = 0x90,
        MLXSW_TRAP_ID_IPV6_MC_LINK_LOCAL_DEST = 0x91,
        MLXSW_TRAP_ID_HOST_MISS_IPV6 = 0x92,
+       MLXSW_TRAP_ID_IPIP_DECAP_ERROR = 0xB1,
        MLXSW_TRAP_ID_ROUTER_ALERT_IPV4 = 0xD6,
        MLXSW_TRAP_ID_ROUTER_ALERT_IPV6 = 0xD7,
        MLXSW_TRAP_ID_ACL0 = 0x1C0,