aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2018-10-11 03:48:11 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-11 13:08:23 -0400
commitb02597d513a9df5a3e661a74f40ff26e4057ec9c (patch)
treec37046a585be177bfbb7ba8175f79a6da6b2365d
parent2bd414aef6a833bed610aa7f76d6f610178c13f4 (diff)
mlxsw: spectrum: Add NVE packet traps
The DECAP_ECN0 trap will be used to trap packets where the overlay packet is marked with Non-ECT, but the underlay packet is marked with either ECT(0), ECT(1) or CE. When trapped, such packets will be counted as errors by the VxLAN driver and thus provide better visibility. The NVE_ENCAP_ARP trap will be used to trap ARP packets undergoing NVE encapsulation. This is needed in order to support E-VPN ARP suppression, where the Linux bridge does not flood ARP packets through tunnel ports in case it can answer the ARP request itself. Note that all the packets trapped via these traps are marked with 'offload_fwd_mark', so as to not be re-flooded by the Linux bridge through the ASIC ports. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c3
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/trap.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index d42980df57b7..ed7e4c4e7403 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -3470,6 +3470,7 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
3470 MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV4, TRAP_TO_CPU, ROUTER_EXP, false), 3470 MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV4, TRAP_TO_CPU, ROUTER_EXP, false),
3471 MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV6, TRAP_TO_CPU, ROUTER_EXP, false), 3471 MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV6, TRAP_TO_CPU, ROUTER_EXP, false),
3472 MLXSW_SP_RXL_MARK(IPIP_DECAP_ERROR, TRAP_TO_CPU, ROUTER_EXP, false), 3472 MLXSW_SP_RXL_MARK(IPIP_DECAP_ERROR, TRAP_TO_CPU, ROUTER_EXP, false),
3473 MLXSW_SP_RXL_MARK(DECAP_ECN0, TRAP_TO_CPU, ROUTER_EXP, false),
3473 MLXSW_SP_RXL_MARK(IPV4_VRRP, TRAP_TO_CPU, ROUTER_EXP, false), 3474 MLXSW_SP_RXL_MARK(IPV4_VRRP, TRAP_TO_CPU, ROUTER_EXP, false),
3474 MLXSW_SP_RXL_MARK(IPV6_VRRP, TRAP_TO_CPU, ROUTER_EXP, false), 3475 MLXSW_SP_RXL_MARK(IPV6_VRRP, TRAP_TO_CPU, ROUTER_EXP, false),
3475 /* PKT Sample trap */ 3476 /* PKT Sample trap */
@@ -3483,6 +3484,8 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
3483 MLXSW_SP_RXL_MARK(RPF, TRAP_TO_CPU, RPF, false), 3484 MLXSW_SP_RXL_MARK(RPF, TRAP_TO_CPU, RPF, false),
3484 MLXSW_SP_RXL_MARK(ACL1, TRAP_TO_CPU, MULTICAST, false), 3485 MLXSW_SP_RXL_MARK(ACL1, TRAP_TO_CPU, MULTICAST, false),
3485 MLXSW_SP_RXL_MR_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false), 3486 MLXSW_SP_RXL_MR_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false),
3487 /* NVE traps */
3488 MLXSW_SP_RXL_MARK(NVE_ENCAP_ARP, TRAP_TO_CPU, ARP, false),
3486}; 3489};
3487 3490
3488static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core) 3491static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/trap.h b/drivers/net/ethernet/mellanox/mlxsw/trap.h
index 53020724c2f6..6f18f4d3322a 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/trap.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/trap.h
@@ -24,6 +24,7 @@ enum {
24 MLXSW_TRAP_ID_IGMP_V3_REPORT = 0x34, 24 MLXSW_TRAP_ID_IGMP_V3_REPORT = 0x34,
25 MLXSW_TRAP_ID_PKT_SAMPLE = 0x38, 25 MLXSW_TRAP_ID_PKT_SAMPLE = 0x38,
26 MLXSW_TRAP_ID_FID_MISS = 0x3D, 26 MLXSW_TRAP_ID_FID_MISS = 0x3D,
27 MLXSW_TRAP_ID_DECAP_ECN0 = 0x40,
27 MLXSW_TRAP_ID_ARPBC = 0x50, 28 MLXSW_TRAP_ID_ARPBC = 0x50,
28 MLXSW_TRAP_ID_ARPUC = 0x51, 29 MLXSW_TRAP_ID_ARPUC = 0x51,
29 MLXSW_TRAP_ID_MTUERROR = 0x52, 30 MLXSW_TRAP_ID_MTUERROR = 0x52,
@@ -59,6 +60,7 @@ enum {
59 MLXSW_TRAP_ID_IPV6_MC_LINK_LOCAL_DEST = 0x91, 60 MLXSW_TRAP_ID_IPV6_MC_LINK_LOCAL_DEST = 0x91,
60 MLXSW_TRAP_ID_HOST_MISS_IPV6 = 0x92, 61 MLXSW_TRAP_ID_HOST_MISS_IPV6 = 0x92,
61 MLXSW_TRAP_ID_IPIP_DECAP_ERROR = 0xB1, 62 MLXSW_TRAP_ID_IPIP_DECAP_ERROR = 0xB1,
63 MLXSW_TRAP_ID_NVE_ENCAP_ARP = 0xBD,
62 MLXSW_TRAP_ID_ROUTER_ALERT_IPV4 = 0xD6, 64 MLXSW_TRAP_ID_ROUTER_ALERT_IPV4 = 0xD6,
63 MLXSW_TRAP_ID_ROUTER_ALERT_IPV6 = 0xD7, 65 MLXSW_TRAP_ID_ROUTER_ALERT_IPV6 = 0xD7,
64 MLXSW_TRAP_ID_ACL0 = 0x1C0, 66 MLXSW_TRAP_ID_ACL0 = 0x1C0,