Commit 8110668e authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: spectrum_trap: Register layer 3 control traps

In a similar fashion to layer 2 control traps, register layer 3 control
traps with devlink.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 39c10350
...@@ -5536,7 +5536,6 @@ enum mlxsw_reg_htgt_trap_group { ...@@ -5536,7 +5536,6 @@ enum mlxsw_reg_htgt_trap_group {
MLXSW_REG_HTGT_TRAP_GROUP_SP_MULTICAST, MLXSW_REG_HTGT_TRAP_GROUP_SP_MULTICAST,
MLXSW_REG_HTGT_TRAP_GROUP_SP_NEIGH_DISCOVERY, MLXSW_REG_HTGT_TRAP_GROUP_SP_NEIGH_DISCOVERY,
MLXSW_REG_HTGT_TRAP_GROUP_SP_ROUTER_EXP, MLXSW_REG_HTGT_TRAP_GROUP_SP_ROUTER_EXP,
MLXSW_REG_HTGT_TRAP_GROUP_SP_REMOTE_ROUTE,
MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME, MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME,
MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP, MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP,
MLXSW_REG_HTGT_TRAP_GROUP_SP_EVENT, MLXSW_REG_HTGT_TRAP_GROUP_SP_EVENT,
......
...@@ -4014,14 +4014,6 @@ static void mlxsw_sp_rx_listener_sample_func(struct sk_buff *skb, u8 local_port, ...@@ -4014,14 +4014,6 @@ static void mlxsw_sp_rx_listener_sample_func(struct sk_buff *skb, u8 local_port,
consume_skb(skb); consume_skb(skb);
} }
static void mlxsw_sp_rx_listener_ptp(struct sk_buff *skb, u8 local_port,
void *priv)
{
struct mlxsw_sp *mlxsw_sp = priv;
mlxsw_sp->ptp_ops->receive(mlxsw_sp, skb, local_port);
}
void mlxsw_sp_ptp_receive(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb, void mlxsw_sp_ptp_receive(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb,
u8 local_port) u8 local_port)
{ {
...@@ -4047,43 +4039,13 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = { ...@@ -4047,43 +4039,13 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
/* Events */ /* Events */
MLXSW_SP_EVENTL(mlxsw_sp_pude_event_func, PUDE), MLXSW_SP_EVENTL(mlxsw_sp_pude_event_func, PUDE),
/* L2 traps */ /* L2 traps */
MLXSW_SP_RXL_MARK(ARPBC, MIRROR_TO_CPU, NEIGH_DISCOVERY, false),
MLXSW_SP_RXL_MARK(ARPUC, MIRROR_TO_CPU, NEIGH_DISCOVERY, false),
MLXSW_SP_RXL_NO_MARK(FID_MISS, TRAP_TO_CPU, FID_MISS, false), MLXSW_SP_RXL_NO_MARK(FID_MISS, TRAP_TO_CPU, FID_MISS, false),
/* L3 traps */ /* L3 traps */
MLXSW_SP_RXL_L3_MARK(LBERROR, MIRROR_TO_CPU, LBERROR, false),
MLXSW_SP_RXL_MARK(IP2ME, TRAP_TO_CPU, IP2ME, false),
MLXSW_SP_RXL_MARK(IPV6_UNSPECIFIED_ADDRESS, TRAP_TO_CPU, ROUTER_EXP, MLXSW_SP_RXL_MARK(IPV6_UNSPECIFIED_ADDRESS, TRAP_TO_CPU, ROUTER_EXP,
false), false),
MLXSW_SP_RXL_MARK(IPV6_LINK_LOCAL_DEST, TRAP_TO_CPU, IP2ME, false),
MLXSW_SP_RXL_MARK(IPV6_LINK_LOCAL_SRC, TRAP_TO_CPU, ROUTER_EXP, false), MLXSW_SP_RXL_MARK(IPV6_LINK_LOCAL_SRC, TRAP_TO_CPU, ROUTER_EXP, false),
MLXSW_SP_RXL_MARK(IPV6_ALL_NODES_LINK, TRAP_TO_CPU, IPV6, false),
MLXSW_SP_RXL_MARK(IPV6_ALL_ROUTERS_LINK, TRAP_TO_CPU, IPV6,
false),
MLXSW_SP_RXL_MARK(IPV4_OSPF, TRAP_TO_CPU, OSPF, false),
MLXSW_SP_RXL_MARK(IPV6_OSPF, TRAP_TO_CPU, OSPF, false),
MLXSW_SP_RXL_MARK(IPV4_DHCP, TRAP_TO_CPU, DHCP, false),
MLXSW_SP_RXL_MARK(IPV6_DHCP, TRAP_TO_CPU, DHCP, false),
MLXSW_SP_RXL_MARK(RTR_INGRESS0, TRAP_TO_CPU, REMOTE_ROUTE, false),
MLXSW_SP_RXL_MARK(IPV4_BGP, TRAP_TO_CPU, BGP, false),
MLXSW_SP_RXL_MARK(IPV6_BGP, TRAP_TO_CPU, BGP, false),
MLXSW_SP_RXL_MARK(L3_IPV6_ROUTER_SOLICITATION, TRAP_TO_CPU, IPV6,
false),
MLXSW_SP_RXL_MARK(L3_IPV6_ROUTER_ADVERTISEMENT, TRAP_TO_CPU, IPV6,
false),
MLXSW_SP_RXL_MARK(L3_IPV6_NEIGHBOR_SOLICITATION, TRAP_TO_CPU,
NEIGH_DISCOVERY, false),
MLXSW_SP_RXL_MARK(L3_IPV6_NEIGHBOR_ADVERTISEMENT, TRAP_TO_CPU,
NEIGH_DISCOVERY, false),
MLXSW_SP_RXL_MARK(L3_IPV6_REDIRECTION, TRAP_TO_CPU, IPV6, false),
MLXSW_SP_RXL_MARK(IPV6_MC_LINK_LOCAL_DEST, TRAP_TO_CPU, ROUTER_EXP, MLXSW_SP_RXL_MARK(IPV6_MC_LINK_LOCAL_DEST, TRAP_TO_CPU, ROUTER_EXP,
false), false),
MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV4, TRAP_TO_CPU, IP2ME, false),
MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV6, TRAP_TO_CPU, IP2ME, false),
MLXSW_SP_RXL_MARK(IPV4_VRRP, TRAP_TO_CPU, VRRP, false),
MLXSW_SP_RXL_MARK(IPV6_VRRP, TRAP_TO_CPU, VRRP, false),
MLXSW_SP_RXL_MARK(IPV4_BFD, TRAP_TO_CPU, BFD, false),
MLXSW_SP_RXL_MARK(IPV6_BFD, TRAP_TO_CPU, BFD, false),
MLXSW_SP_RXL_NO_MARK(DISCARD_ING_ROUTER_SIP_CLASS_E, FORWARD, MLXSW_SP_RXL_NO_MARK(DISCARD_ING_ROUTER_SIP_CLASS_E, FORWARD,
ROUTER_EXP, false), ROUTER_EXP, false),
MLXSW_SP_RXL_NO_MARK(DISCARD_ING_ROUTER_MC_DMAC, FORWARD, MLXSW_SP_RXL_NO_MARK(DISCARD_ING_ROUTER_MC_DMAC, FORWARD,
...@@ -4098,18 +4060,10 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = { ...@@ -4098,18 +4060,10 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
/* ACL trap */ /* ACL trap */
MLXSW_SP_RXL_NO_MARK(ACL0, TRAP_TO_CPU, FLOW_LOGGING, false), MLXSW_SP_RXL_NO_MARK(ACL0, TRAP_TO_CPU, FLOW_LOGGING, false),
/* Multicast Router Traps */ /* Multicast Router Traps */
MLXSW_SP_RXL_MARK(IPV4_PIM, TRAP_TO_CPU, PIM, false),
MLXSW_SP_RXL_MARK(IPV6_PIM, TRAP_TO_CPU, PIM, false),
MLXSW_SP_RXL_MARK(ACL1, TRAP_TO_CPU, MULTICAST, false), MLXSW_SP_RXL_MARK(ACL1, TRAP_TO_CPU, MULTICAST, false),
MLXSW_SP_RXL_L3_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false), MLXSW_SP_RXL_L3_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false),
/* NVE traps */ /* NVE traps */
MLXSW_SP_RXL_MARK(NVE_ENCAP_ARP, TRAP_TO_CPU, NEIGH_DISCOVERY, false), MLXSW_SP_RXL_MARK(NVE_ENCAP_ARP, TRAP_TO_CPU, NEIGH_DISCOVERY, false),
MLXSW_SP_RXL_NO_MARK(NVE_DECAP_ARP, TRAP_TO_CPU, NEIGH_DISCOVERY,
false),
/* PTP traps */
MLXSW_RXL(mlxsw_sp_rx_listener_ptp, PTP0, TRAP_TO_CPU,
false, SP_PTP0, DISCARD),
MLXSW_SP_RXL_NO_MARK(PTP1, TRAP_TO_CPU, PTP1, false),
}; };
static const struct mlxsw_listener mlxsw_sp1_listener[] = { static const struct mlxsw_listener mlxsw_sp1_listener[] = {
...@@ -4138,41 +4092,13 @@ static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core) ...@@ -4138,41 +4092,13 @@ static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core)
for (i = 0; i < max_cpu_policers; i++) { for (i = 0; i < max_cpu_policers; i++) {
is_bytes = false; is_bytes = false;
switch (i) { switch (i) {
case MLXSW_REG_HTGT_TRAP_GROUP_SP_OSPF:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_PIM:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_LBERROR:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP:
rate = 128;
burst_size = 7;
break;
case MLXSW_REG_HTGT_TRAP_GROUP_SP_BGP:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_NEIGH_DISCOVERY:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_ROUTER_EXP: case MLXSW_REG_HTGT_TRAP_GROUP_SP_ROUTER_EXP:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_REMOTE_ROUTE:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_MULTICAST: case MLXSW_REG_HTGT_TRAP_GROUP_SP_MULTICAST:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_FLOW_LOGGING: case MLXSW_REG_HTGT_TRAP_GROUP_SP_FLOW_LOGGING:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_FID_MISS: case MLXSW_REG_HTGT_TRAP_GROUP_SP_FID_MISS:
rate = 1024; rate = 1024;
burst_size = 7; burst_size = 7;
break; break;
case MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP0:
rate = 24 * 1024;
burst_size = 12;
break;
case MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP1:
rate = 19 * 1024;
burst_size = 12;
break;
case MLXSW_REG_HTGT_TRAP_GROUP_SP_VRRP:
rate = 360;
burst_size = 7;
break;
case MLXSW_REG_HTGT_TRAP_GROUP_SP_BFD:
rate = 20 * 1024;
burst_size = 10;
break;
default: default:
continue; continue;
} }
...@@ -4207,36 +4133,17 @@ static int mlxsw_sp_trap_groups_set(struct mlxsw_core *mlxsw_core) ...@@ -4207,36 +4133,17 @@ static int mlxsw_sp_trap_groups_set(struct mlxsw_core *mlxsw_core)
for (i = 0; i < max_trap_groups; i++) { for (i = 0; i < max_trap_groups; i++) {
policer_id = i; policer_id = i;
switch (i) { switch (i) {
case MLXSW_REG_HTGT_TRAP_GROUP_SP_OSPF:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_PIM:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP0:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_VRRP:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_BFD:
priority = 5;
tc = 5;
break;
case MLXSW_REG_HTGT_TRAP_GROUP_SP_FLOW_LOGGING: case MLXSW_REG_HTGT_TRAP_GROUP_SP_FLOW_LOGGING:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_BGP:
priority = 4; priority = 4;
tc = 4; tc = 4;
break; break;
case MLXSW_REG_HTGT_TRAP_GROUP_SP_NEIGH_DISCOVERY:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP1:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP:
priority = 2;
tc = 2;
break;
case MLXSW_REG_HTGT_TRAP_GROUP_SP_ROUTER_EXP: case MLXSW_REG_HTGT_TRAP_GROUP_SP_ROUTER_EXP:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_REMOTE_ROUTE:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_MULTICAST: case MLXSW_REG_HTGT_TRAP_GROUP_SP_MULTICAST:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_FID_MISS: case MLXSW_REG_HTGT_TRAP_GROUP_SP_FID_MISS:
priority = 1; priority = 1;
tc = 1; tc = 1;
break; break;
case MLXSW_REG_HTGT_TRAP_GROUP_SP_PKT_SAMPLE: case MLXSW_REG_HTGT_TRAP_GROUP_SP_PKT_SAMPLE:
case MLXSW_REG_HTGT_TRAP_GROUP_SP_LBERROR:
priority = 0; priority = 0;
tc = 0; tc = 0;
break; break;
......
...@@ -170,6 +170,14 @@ static void mlxsw_sp_rx_mark_listener(struct sk_buff *skb, u8 local_port, ...@@ -170,6 +170,14 @@ static void mlxsw_sp_rx_mark_listener(struct sk_buff *skb, u8 local_port,
mlxsw_sp_rx_no_mark_listener(skb, local_port, trap_ctx); mlxsw_sp_rx_no_mark_listener(skb, local_port, trap_ctx);
} }
static void mlxsw_sp_rx_l3_mark_listener(struct sk_buff *skb, u8 local_port,
void *trap_ctx)
{
skb->offload_l3_fwd_mark = 1;
skb->offload_fwd_mark = 1;
mlxsw_sp_rx_no_mark_listener(skb, local_port, trap_ctx);
}
static void mlxsw_sp_rx_ptp_listener(struct sk_buff *skb, u8 local_port, static void mlxsw_sp_rx_ptp_listener(struct sk_buff *skb, u8 local_port,
void *trap_ctx) void *trap_ctx)
{ {
...@@ -235,6 +243,10 @@ static void mlxsw_sp_rx_ptp_listener(struct sk_buff *skb, u8 local_port, ...@@ -235,6 +243,10 @@ static void mlxsw_sp_rx_ptp_listener(struct sk_buff *skb, u8 local_port,
MLXSW_RXL(mlxsw_sp_rx_mark_listener, _id, _action, _is_ctrl, \ MLXSW_RXL(mlxsw_sp_rx_mark_listener, _id, _action, _is_ctrl, \
SP_##_group_id, DISCARD) SP_##_group_id, DISCARD)
#define MLXSW_SP_RXL_L3_MARK(_id, _group_id, _action, _is_ctrl) \
MLXSW_RXL(mlxsw_sp_rx_l3_mark_listener, _id, _action, _is_ctrl, \
SP_##_group_id, DISCARD)
#define MLXSW_SP_TRAP_POLICER(_id, _rate, _burst) \ #define MLXSW_SP_TRAP_POLICER(_id, _rate, _burst) \
DEVLINK_TRAP_POLICER(_id, _rate, _burst, \ DEVLINK_TRAP_POLICER(_id, _rate, _burst, \
MLXSW_REG_QPCR_HIGHEST_CIR, \ MLXSW_REG_QPCR_HIGHEST_CIR, \
...@@ -260,6 +272,42 @@ mlxsw_sp_trap_policer_items_arr[] = { ...@@ -260,6 +272,42 @@ mlxsw_sp_trap_policer_items_arr[] = {
{ {
.policer = MLXSW_SP_TRAP_POLICER(5, 16 * 1024, 128), .policer = MLXSW_SP_TRAP_POLICER(5, 16 * 1024, 128),
}, },
{
.policer = MLXSW_SP_TRAP_POLICER(6, 128, 128),
},
{
.policer = MLXSW_SP_TRAP_POLICER(7, 1024, 128),
},
{
.policer = MLXSW_SP_TRAP_POLICER(8, 20 * 1024, 1024),
},
{
.policer = MLXSW_SP_TRAP_POLICER(9, 128, 128),
},
{
.policer = MLXSW_SP_TRAP_POLICER(10, 1024, 128),
},
{
.policer = MLXSW_SP_TRAP_POLICER(11, 360, 128),
},
{
.policer = MLXSW_SP_TRAP_POLICER(12, 128, 128),
},
{
.policer = MLXSW_SP_TRAP_POLICER(13, 128, 128),
},
{
.policer = MLXSW_SP_TRAP_POLICER(14, 1024, 128),
},
{
.policer = MLXSW_SP_TRAP_POLICER(15, 1024, 128),
},
{
.policer = MLXSW_SP_TRAP_POLICER(16, 24 * 1024, 4096),
},
{
.policer = MLXSW_SP_TRAP_POLICER(17, 19 * 1024, 4096),
},
}; };
static const struct mlxsw_sp_trap_group_item mlxsw_sp_trap_group_items_arr[] = { static const struct mlxsw_sp_trap_group_item mlxsw_sp_trap_group_items_arr[] = {
...@@ -308,6 +356,66 @@ static const struct mlxsw_sp_trap_group_item mlxsw_sp_trap_group_items_arr[] = { ...@@ -308,6 +356,66 @@ static const struct mlxsw_sp_trap_group_item mlxsw_sp_trap_group_items_arr[] = {
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_MC_SNOOPING, .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_MC_SNOOPING,
.priority = 3, .priority = 3,
}, },
{
.group = DEVLINK_TRAP_GROUP_GENERIC(DHCP, 6),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP,
.priority = 2,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(NEIGH_DISCOVERY, 7),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_NEIGH_DISCOVERY,
.priority = 2,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(BFD, 8),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_BFD,
.priority = 5,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(OSPF, 9),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_OSPF,
.priority = 5,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(BGP, 10),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_BGP,
.priority = 4,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(VRRP, 11),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_VRRP,
.priority = 5,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(PIM, 12),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_PIM,
.priority = 5,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(UC_LB, 13),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_LBERROR,
.priority = 0,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(LOCAL_DELIVERY, 14),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME,
.priority = 2,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(IPV6, 15),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6,
.priority = 2,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(PTP_EVENT, 16),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP0,
.priority = 5,
},
{
.group = DEVLINK_TRAP_GROUP_GENERIC(PTP_GENERAL, 17),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP1,
.priority = 2,
},
}; };
static const struct mlxsw_sp_trap_item mlxsw_sp_trap_items_arr[] = { static const struct mlxsw_sp_trap_item mlxsw_sp_trap_items_arr[] = {
...@@ -617,6 +725,216 @@ static const struct mlxsw_sp_trap_item mlxsw_sp_trap_items_arr[] = { ...@@ -617,6 +725,216 @@ static const struct mlxsw_sp_trap_item mlxsw_sp_trap_items_arr[] = {
MC_SNOOPING, TRAP_TO_CPU, false), MC_SNOOPING, TRAP_TO_CPU, false),
}, },
}, },
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV4_DHCP, DHCP, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV4_DHCP, DHCP, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_DHCP, DHCP, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV6_DHCP, DHCP, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(ARP_REQUEST, NEIGH_DISCOVERY,
MIRROR),
.listeners_arr = {
MLXSW_SP_RXL_MARK(ARPBC, NEIGH_DISCOVERY, MIRROR_TO_CPU,
false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(ARP_RESPONSE, NEIGH_DISCOVERY,
MIRROR),
.listeners_arr = {
MLXSW_SP_RXL_MARK(ARPUC, NEIGH_DISCOVERY, MIRROR_TO_CPU,
false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(ARP_OVERLAY, NEIGH_DISCOVERY,
TRAP),
.listeners_arr = {
MLXSW_SP_RXL_NO_MARK(NVE_DECAP_ARP, NEIGH_DISCOVERY,
TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_NEIGH_SOLICIT,
NEIGH_DISCOVERY, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(L3_IPV6_NEIGHBOR_SOLICITATION,
NEIGH_DISCOVERY, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_NEIGH_ADVERT,
NEIGH_DISCOVERY, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(L3_IPV6_NEIGHBOR_ADVERTISEMENT,
NEIGH_DISCOVERY, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV4_BFD, BFD, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV4_BFD, BFD, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_BFD, BFD, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV6_BFD, BFD, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV4_OSPF, OSPF, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV4_OSPF, OSPF, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_OSPF, OSPF, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV6_OSPF, OSPF, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV4_BGP, BGP, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV4_BGP, BGP, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_BGP, BGP, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV6_BGP, BGP, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV4_VRRP, VRRP, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV4_VRRP, VRRP, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_VRRP, VRRP, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV6_VRRP, VRRP, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV4_PIM, PIM, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV4_PIM, PIM, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_PIM, PIM, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV6_PIM, PIM, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(UC_LB, UC_LB, MIRROR),
.listeners_arr = {
MLXSW_SP_RXL_L3_MARK(LBERROR, LBERROR, MIRROR_TO_CPU,
false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(LOCAL_ROUTE, LOCAL_DELIVERY,
TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IP2ME, IP2ME, TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(EXTERNAL_ROUTE, LOCAL_DELIVERY,
TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(RTR_INGRESS0, IP2ME, TRAP_TO_CPU,
false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_UC_DIP_LINK_LOCAL_SCOPE,
LOCAL_DELIVERY, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV6_LINK_LOCAL_DEST, IP2ME,
TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV4_ROUTER_ALERT, LOCAL_DELIVERY,
TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV4, IP2ME, TRAP_TO_CPU,
false),
},
},
{
/* IPV6_ROUTER_ALERT is defined in uAPI as 22, but it is not
* used in this file, so undefine it.
*/
#undef IPV6_ROUTER_ALERT
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_ROUTER_ALERT, LOCAL_DELIVERY,
TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV6, IP2ME, TRAP_TO_CPU,
false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_DIP_ALL_NODES, IPV6, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV6_ALL_NODES_LINK, IPV6,
TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_DIP_ALL_ROUTERS, IPV6, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(IPV6_ALL_ROUTERS_LINK, IPV6,
TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_ROUTER_SOLICIT, IPV6, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(L3_IPV6_ROUTER_SOLICITATION, IPV6,
TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_ROUTER_ADVERT, IPV6, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(L3_IPV6_ROUTER_ADVERTISEMENT, IPV6,
TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(IPV6_REDIRECT, IPV6, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_MARK(L3_IPV6_REDIRECTION, IPV6,
TRAP_TO_CPU, false),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(PTP_EVENT, PTP_EVENT, TRAP),
.listeners_arr = {
MLXSW_RXL(mlxsw_sp_rx_ptp_listener, PTP0, TRAP_TO_CPU,
false, SP_PTP0, DISCARD),
},
},
{
.trap = MLXSW_SP_TRAP_CONTROL(PTP_GENERAL, PTP_GENERAL, TRAP),
.listeners_arr = {
MLXSW_SP_RXL_NO_MARK(PTP1, PTP1, TRAP_TO_CPU, false),
},
},
}; };
static struct mlxsw_sp_trap_policer_item * static struct mlxsw_sp_trap_policer_item *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment