xref: /linux/drivers/net/ethernet/mellanox/mlxsw/trap.h (revision 9948a0641a17a38935a28d05f6c56d9d1ffabae6)
1*9948a064SJiri Pirko /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2*9948a064SJiri Pirko /* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */
3*9948a064SJiri 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,
2093c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_QUERY = 0x30,
2193c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_V1_REPORT = 0x31,
2293c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_V2_REPORT = 0x32,
2393c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_V2_LEAVE = 0x33,
2493c1edb2SJiri Pirko 	MLXSW_TRAP_ID_IGMP_V3_REPORT = 0x34,
2598d0f7b9SYotam Gigi 	MLXSW_TRAP_ID_PKT_SAMPLE = 0x38,
269d41acccSJiri Pirko 	MLXSW_TRAP_ID_FID_MISS = 0x3D,
277b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_ARPBC = 0x50,
287b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_ARPUC = 0x51,
29c20b8018SElad Raz 	MLXSW_TRAP_ID_MTUERROR = 0x52,
30c20b8018SElad Raz 	MLXSW_TRAP_ID_TTLERROR = 0x53,
31a94a614fSIdo Schimmel 	MLXSW_TRAP_ID_LBERROR = 0x54,
328d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV4_OSPF = 0x55,
33b48cfc80SYotam Gigi 	MLXSW_TRAP_ID_IPV4_PIM = 0x58,
3411566d34SIdo Schimmel 	MLXSW_TRAP_ID_IPV4_VRRP = 0x59,
35b48cfc80SYotam Gigi 	MLXSW_TRAP_ID_RPF = 0x5C,
367b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_IP2ME = 0x5F,
378d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_UNSPECIFIED_ADDRESS = 0x60,
388d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_LINK_LOCAL_DEST = 0x61,
398d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_LINK_LOCAL_SRC = 0x62,
408d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_ALL_NODES_LINK = 0x63,
418d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_OSPF = 0x64,
42588823f9SArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MLDV12_LISTENER_QUERY = 0x65,
43588823f9SArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MLDV1_LISTENER_REPORT = 0x66,
44588823f9SArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MLDV1_LISTENER_DONE = 0x67,
45588823f9SArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MLDV2_LISTENER_REPORT = 0x68,
468d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_DHCP = 0x69,
478d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_ALL_ROUTERS_LINK = 0x6F,
487b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_RTR_INGRESS0 = 0x70,
496a170d32SYuval Mintz 	MLXSW_TRAP_ID_IPV6_PIM = 0x79,
5011566d34SIdo Schimmel 	MLXSW_TRAP_ID_IPV6_VRRP = 0x7A,
518d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV4_BGP = 0x88,
528d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_BGP = 0x89,
538d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_ROUTER_SOLICITATION = 0x8A,
548d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_ROUTER_ADVERTISMENT = 0x8B,
558d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_NEIGHBOR_SOLICITATION = 0x8C,
568d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_NEIGHBOR_ADVERTISMENT = 0x8D,
578d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_L3_IPV6_REDIRECTION = 0x8E,
587b27ce7bSJiri Pirko 	MLXSW_TRAP_ID_HOST_MISS_IPV4 = 0x90,
598d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_IPV6_MC_LINK_LOCAL_DEST = 0x91,
608d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_HOST_MISS_IPV6 = 0x92,
6186484de2SPetr Machata 	MLXSW_TRAP_ID_IPIP_DECAP_ERROR = 0xB1,
627607dd35SIdo Schimmel 	MLXSW_TRAP_ID_ROUTER_ALERT_IPV4 = 0xD6,
638d54814eSArkadi Sharshevsky 	MLXSW_TRAP_ID_ROUTER_ALERT_IPV6 = 0xD7,
640db7b386SJiri Pirko 	MLXSW_TRAP_ID_ACL0 = 0x1C0,
65b48cfc80SYotam Gigi 	/* Multicast trap used for routes with trap action */
66b48cfc80SYotam Gigi 	MLXSW_TRAP_ID_ACL1 = 0x1C1,
67a0040c8cSYotam Gigi 	/* Multicast trap used for routes with trap-and-forward action */
68a0040c8cSYotam Gigi 	MLXSW_TRAP_ID_ACL2 = 0x1C2,
6993c1edb2SJiri Pirko 
7093c1edb2SJiri Pirko 	MLXSW_TRAP_ID_MAX = 0x1FF
7193c1edb2SJiri Pirko };
7293c1edb2SJiri Pirko 
7393c1edb2SJiri Pirko enum mlxsw_event_trap_id {
7493c1edb2SJiri Pirko 	/* Port Up/Down event generated by hardware */
7593c1edb2SJiri Pirko 	MLXSW_TRAP_ID_PUDE = 0x8,
7693c1edb2SJiri Pirko };
7793c1edb2SJiri Pirko 
7893c1edb2SJiri Pirko #endif /* _MLXSW_TRAP_H */
79