xref: /linux/drivers/net/ethernet/mellanox/mlxsw/trap.h (revision 0ecb947412d7e95128a007f791b020a37ce5e9be)
19948a064SJiri Pirko /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
29948a064SJiri Pirko /* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */
39948a064SJiri Pirko 
493c1edb2SJiri Pirko #ifndef _MLXSW_TRAP_H
593c1edb2SJiri Pirko #define _MLXSW_TRAP_H
693c1edb2SJiri Pirko 
793c1edb2SJiri Pirko enum {
893c1edb2SJiri Pirko 	/* Ethernet EMAD and FDB miss */
993c1edb2SJiri Pirko 	MLXSW_TRAP_ID_FDB_MC = 0x01,
1093c1edb2SJiri Pirko 	MLXSW_TRAP_ID_ETHEMAD = 0x05,
1193c1edb2SJiri Pirko 	/* L2 traps for specific packet types */
1293c1edb2SJiri Pirko 	MLXSW_TRAP_ID_STP = 0x10,
1393c1edb2SJiri Pirko 	MLXSW_TRAP_ID_LACP = 0x11,
1493c1edb2SJiri Pirko 	MLXSW_TRAP_ID_EAPOL = 0x12,
1593c1edb2SJiri Pirko 	MLXSW_TRAP_ID_LLDP = 0x13,
1693c1edb2SJiri Pirko 	MLXSW_TRAP_ID_MMRP = 0x14,
1793c1edb2SJiri Pirko 	MLXSW_TRAP_ID_MVRP = 0x15,
1893c1edb2SJiri Pirko 	MLXSW_TRAP_ID_RPVST = 0x16,
1993c1edb2SJiri Pirko 	MLXSW_TRAP_ID_DHCP = 0x19,
20aed4b572SPetr Machata 	MLXSW_TRAP_ID_PTP0 = 0x28,
21aed4b572SPetr Machata 	MLXSW_TRAP_ID_PTP1 = 0x29,
2293c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_QUERY = 0x30,
2393c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_V1_REPORT = 0x31,
2493c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_V2_REPORT = 0x32,
2593c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_V2_LEAVE = 0x33,
2693c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_V3_REPORT = 0x34,
2798d0f7b9SYotam Gigi 	MLXSW_TRAP_ID_PKT_SAMPLE = 0x38,
289d41acccSJiri Pirko 	MLXSW_TRAP_ID_FID_MISS = 0x3D,
29b02597d5SIdo Schimmel 	MLXSW_TRAP_ID_DECAP_ECN0 = 0x40,
307b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_ARPBC = 0x50,
317b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_ARPUC = 0x51,
32c20b8018SElad Raz 	MLXSW_TRAP_ID_MTUERROR = 0x52,
33c20b8018SElad Raz 	MLXSW_TRAP_ID_TTLERROR = 0x53,
34a94a614fSIdo Schimmel 	MLXSW_TRAP_ID_LBERROR = 0x54,
358d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV4_OSPF = 0x55,
36b48cfc80SYotam Gigi 	MLXSW_TRAP_ID_IPV4_PIM = 0x58,
3711566d34SIdo Schimmel 	MLXSW_TRAP_ID_IPV4_VRRP = 0x59,
38b48cfc80SYotam Gigi 	MLXSW_TRAP_ID_RPF = 0x5C,
397b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_IP2ME = 0x5F,
408d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_UNSPECIFIED_ADDRESS = 0x60,
418d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_LINK_LOCAL_DEST = 0x61,
428d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_LINK_LOCAL_SRC = 0x62,
438d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_ALL_NODES_LINK = 0x63,
448d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_OSPF = 0x64,
45588823f9SArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MLDV12_LISTENER_QUERY = 0x65,
46588823f9SArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MLDV1_LISTENER_REPORT = 0x66,
47588823f9SArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MLDV1_LISTENER_DONE = 0x67,
48588823f9SArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MLDV2_LISTENER_REPORT = 0x68,
498d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_DHCP = 0x69,
508d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_ALL_ROUTERS_LINK = 0x6F,
517b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_RTR_INGRESS0 = 0x70,
5221151f64SAmit Cohen 	MLXSW_TRAP_ID_RTR_INGRESS1 = 0x71,
536a170d32SYuval Mintz 	MLXSW_TRAP_ID_IPV6_PIM = 0x79,
5411566d34SIdo Schimmel 	MLXSW_TRAP_ID_IPV6_VRRP = 0x7A,
558d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV4_BGP = 0x88,
568d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_BGP = 0x89,
578d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_ROUTER_SOLICITATION = 0x8A,
588d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_ROUTER_ADVERTISMENT = 0x8B,
598d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_NEIGHBOR_SOLICITATION = 0x8C,
608d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_NEIGHBOR_ADVERTISMENT = 0x8D,
618d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_REDIRECTION = 0x8E,
62*0ecb9474SIdo Schimmel 	MLXSW_TRAP_ID_IPV4_DHCP = 0x8F,
637b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_HOST_MISS_IPV4 = 0x90,
648d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MC_LINK_LOCAL_DEST = 0x91,
658d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_HOST_MISS_IPV6 = 0x92,
6686484de2SPetr Machata 	MLXSW_TRAP_ID_IPIP_DECAP_ERROR = 0xB1,
675d504391SIdo Schimmel 	MLXSW_TRAP_ID_NVE_DECAP_ARP = 0xB8,
68b02597d5SIdo Schimmel 	MLXSW_TRAP_ID_NVE_ENCAP_ARP = 0xBD,
697607dd35SIdo Schimmel 	MLXSW_TRAP_ID_ROUTER_ALERT_IPV4 = 0xD6,
708d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_ROUTER_ALERT_IPV6 = 0xD7,
71196442ecSAmit Cohen 	MLXSW_TRAP_ID_DISCARD_NON_ROUTABLE = 0x11A,
72dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ROUTER2 = 0x130,
730c3cbbf9SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ROUTER3 = 0x131,
74a812cedbSIdo Schimmel 	MLXSW_TRAP_ID_DISCARD_ING_PACKET_SMAC_MC = 0x140,
75a812cedbSIdo Schimmel 	MLXSW_TRAP_ID_DISCARD_ING_SWITCH_VTAG_ALLOW = 0x148,
76a812cedbSIdo Schimmel 	MLXSW_TRAP_ID_DISCARD_ING_SWITCH_VLAN = 0x149,
77a812cedbSIdo Schimmel 	MLXSW_TRAP_ID_DISCARD_ING_SWITCH_STP = 0x14A,
78a812cedbSIdo Schimmel 	MLXSW_TRAP_ID_DISCARD_LOOKUP_SWITCH_UC = 0x150,
79a812cedbSIdo Schimmel 	MLXSW_TRAP_ID_DISCARD_LOOKUP_SWITCH_MC_NULL = 0x151,
80a812cedbSIdo Schimmel 	MLXSW_TRAP_ID_DISCARD_LOOKUP_SWITCH_LB = 0x152,
81dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_NON_IP_PACKET = 0x160,
82dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_UC_DIP_MC_DMAC = 0x161,
83dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_DIP_LB = 0x162,
84dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_SIP_MC = 0x163,
8562b0fb09SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_SIP_CLASS_E = 0x164,
86dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_SIP_LB = 0x165,
87dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_CORRUPTED_IP_HDR = 0x167,
88359ec566SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_MC_DMAC = 0x168,
89e317b0f7SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_SIP_DIP = 0x169,
90dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_IPV4_SIP_BC = 0x16A,
91dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_IPV4_DIP_LOCAL_NET = 0x16B,
92ca360db4SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ING_ROUTER_DIP_LINK_LOCAL = 0x16C,
935b051621SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ROUTER_IRIF_EN = 0x178,
945b051621SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ROUTER_ERIF_EN = 0x179,
95fd74feebSAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ROUTER_LPM4 = 0x17B,
96fd74feebSAmit Cohen 	MLXSW_TRAP_ID_DISCARD_ROUTER_LPM6 = 0x17C,
97a318bf62SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_DEC_PKT = 0x188,
983aed0722SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_OVERLAY_SMAC_MC = 0x190,
99dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_IPV6_MC_DIP_RESERVED_SCOPE = 0x1B0,
100dbc684f1SAmit Cohen 	MLXSW_TRAP_ID_DISCARD_IPV6_MC_DIP_INTERFACE_LOCAL_SCOPE = 0x1B1,
1010db7b386SJiri Pirko 	MLXSW_TRAP_ID_ACL0 = 0x1C0,
102b48cfc80SYotam Gigi 	/* Multicast trap used for routes with trap action */
103b48cfc80SYotam Gigi 	MLXSW_TRAP_ID_ACL1 = 0x1C1,
104a0040c8cSYotam Gigi 	/* Multicast trap used for routes with trap-and-forward action */
105a0040c8cSYotam Gigi 	MLXSW_TRAP_ID_ACL2 = 0x1C2,
1063e6cacafSJiri Pirko 	MLXSW_TRAP_ID_DISCARD_INGRESS_ACL = 0x1C3,
1073e6cacafSJiri Pirko 	MLXSW_TRAP_ID_DISCARD_EGRESS_ACL = 0x1C4,
10893c1edb2SJiri Pirko 
10993c1edb2SJiri Pirko 	MLXSW_TRAP_ID_MAX = 0x1FF
11093c1edb2SJiri Pirko };
11193c1edb2SJiri Pirko 
11293c1edb2SJiri Pirko enum mlxsw_event_trap_id {
11393c1edb2SJiri Pirko 	/* Port Up/Down event generated by hardware */
11493c1edb2SJiri Pirko 	MLXSW_TRAP_ID_PUDE = 0x8,
115d92e4e6eSPetr Machata 	/* PTP Ingress FIFO has a new entry */
116d92e4e6eSPetr Machata 	MLXSW_TRAP_ID_PTP_ING_FIFO = 0x2D,
117d92e4e6eSPetr Machata 	/* PTP Egress FIFO has a new entry */
118d92e4e6eSPetr Machata 	MLXSW_TRAP_ID_PTP_EGR_FIFO = 0x2E,
11993c1edb2SJiri Pirko };
12093c1edb2SJiri Pirko 
12193c1edb2SJiri Pirko #endif /* _MLXSW_TRAP_H */
122