mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
2bd414aef6
commit
b02597d513
drivers/net/ethernet/mellanox/mlxsw
|
@ -3470,6 +3470,7 @@ 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_IPV4, TRAP_TO_CPU, ROUTER_EXP, false),
|
||||||
MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV6, 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(IPIP_DECAP_ERROR, TRAP_TO_CPU, ROUTER_EXP, false),
|
||||||
|
MLXSW_SP_RXL_MARK(DECAP_ECN0, TRAP_TO_CPU, ROUTER_EXP, false),
|
||||||
MLXSW_SP_RXL_MARK(IPV4_VRRP, 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),
|
MLXSW_SP_RXL_MARK(IPV6_VRRP, TRAP_TO_CPU, ROUTER_EXP, false),
|
||||||
/* PKT Sample trap */
|
/* PKT Sample trap */
|
||||||
|
@ -3483,6 +3484,8 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
|
||||||
MLXSW_SP_RXL_MARK(RPF, TRAP_TO_CPU, RPF, false),
|
MLXSW_SP_RXL_MARK(RPF, TRAP_TO_CPU, RPF, false),
|
||||||
MLXSW_SP_RXL_MARK(ACL1, TRAP_TO_CPU, MULTICAST, false),
|
MLXSW_SP_RXL_MARK(ACL1, TRAP_TO_CPU, MULTICAST, false),
|
||||||
MLXSW_SP_RXL_MR_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false),
|
MLXSW_SP_RXL_MR_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false),
|
||||||
|
/* NVE traps */
|
||||||
|
MLXSW_SP_RXL_MARK(NVE_ENCAP_ARP, TRAP_TO_CPU, ARP, false),
|
||||||
};
|
};
|
||||||
|
|
||||||
static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core)
|
static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core)
|
||||||
|
|
|
@ -24,6 +24,7 @@ enum {
|
||||||
MLXSW_TRAP_ID_IGMP_V3_REPORT = 0x34,
|
MLXSW_TRAP_ID_IGMP_V3_REPORT = 0x34,
|
||||||
MLXSW_TRAP_ID_PKT_SAMPLE = 0x38,
|
MLXSW_TRAP_ID_PKT_SAMPLE = 0x38,
|
||||||
MLXSW_TRAP_ID_FID_MISS = 0x3D,
|
MLXSW_TRAP_ID_FID_MISS = 0x3D,
|
||||||
|
MLXSW_TRAP_ID_DECAP_ECN0 = 0x40,
|
||||||
MLXSW_TRAP_ID_ARPBC = 0x50,
|
MLXSW_TRAP_ID_ARPBC = 0x50,
|
||||||
MLXSW_TRAP_ID_ARPUC = 0x51,
|
MLXSW_TRAP_ID_ARPUC = 0x51,
|
||||||
MLXSW_TRAP_ID_MTUERROR = 0x52,
|
MLXSW_TRAP_ID_MTUERROR = 0x52,
|
||||||
|
@ -59,6 +60,7 @@ enum {
|
||||||
MLXSW_TRAP_ID_IPV6_MC_LINK_LOCAL_DEST = 0x91,
|
MLXSW_TRAP_ID_IPV6_MC_LINK_LOCAL_DEST = 0x91,
|
||||||
MLXSW_TRAP_ID_HOST_MISS_IPV6 = 0x92,
|
MLXSW_TRAP_ID_HOST_MISS_IPV6 = 0x92,
|
||||||
MLXSW_TRAP_ID_IPIP_DECAP_ERROR = 0xB1,
|
MLXSW_TRAP_ID_IPIP_DECAP_ERROR = 0xB1,
|
||||||
|
MLXSW_TRAP_ID_NVE_ENCAP_ARP = 0xBD,
|
||||||
MLXSW_TRAP_ID_ROUTER_ALERT_IPV4 = 0xD6,
|
MLXSW_TRAP_ID_ROUTER_ALERT_IPV4 = 0xD6,
|
||||||
MLXSW_TRAP_ID_ROUTER_ALERT_IPV6 = 0xD7,
|
MLXSW_TRAP_ID_ROUTER_ALERT_IPV6 = 0xD7,
|
||||||
MLXSW_TRAP_ID_ACL0 = 0x1C0,
|
MLXSW_TRAP_ID_ACL0 = 0x1C0,
|
||||||
|
|
Loading…
Reference in New Issue