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

mlxsw: spectrum: Use different trap group for externally routed packets

Cited commit mistakenly removed the trap group for externally routed
packets (e.g., via the management interface) and grouped locally routed
and externally routed packet traps under the same group, thereby
subjecting them to the same policer.

This can result in problems, for example, when FRR is restarted and
suddenly all transient traffic is trapped to the CPU because of a
default route through the management interface. Locally routed packets
required to re-establish a BGP connection will never reach the CPU and
the routing tables will not be re-populated.

Fix this by using a different trap group for externally routed packets.

Fixes: 8110668e ("mlxsw: spectrum_trap: Register layer 3 control traps")
Reported-by: default avatarAlex Veber <alexve@mellanox.com>
Tested-by: default avatarAlex Veber <alexve@mellanox.com>
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 89ab5331
...@@ -486,6 +486,10 @@ narrow. The description of these groups must be added to the following table: ...@@ -486,6 +486,10 @@ narrow. The description of these groups must be added to the following table:
- Contains packet traps for packets that should be locally delivered after - Contains packet traps for packets that should be locally delivered after
routing, but do not match more specific packet traps (e.g., routing, but do not match more specific packet traps (e.g.,
``ipv4_bgp``) ``ipv4_bgp``)
* - ``external_delivery``
- Contains packet traps for packets that should be routed through an
external interface (e.g., management interface) that does not belong to
the same device (e.g., switch ASIC) as the ingress interface
* - ``ipv6`` * - ``ipv6``
- Contains packet traps for various IPv6 control packets (e.g., Router - Contains packet traps for various IPv6 control packets (e.g., Router
Advertisements) Advertisements)
......
...@@ -5536,6 +5536,7 @@ enum mlxsw_reg_htgt_trap_group { ...@@ -5536,6 +5536,7 @@ 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_EXTERNAL_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,
......
...@@ -328,6 +328,9 @@ mlxsw_sp_trap_policer_items_arr[] = { ...@@ -328,6 +328,9 @@ mlxsw_sp_trap_policer_items_arr[] = {
{ {
.policer = MLXSW_SP_TRAP_POLICER(18, 1024, 128), .policer = MLXSW_SP_TRAP_POLICER(18, 1024, 128),
}, },
{
.policer = MLXSW_SP_TRAP_POLICER(19, 1024, 512),
},
}; };
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[] = {
...@@ -421,6 +424,11 @@ static const struct mlxsw_sp_trap_group_item mlxsw_sp_trap_group_items_arr[] = { ...@@ -421,6 +424,11 @@ static const struct mlxsw_sp_trap_group_item mlxsw_sp_trap_group_items_arr[] = {
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME, .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME,
.priority = 2, .priority = 2,
}, },
{
.group = DEVLINK_TRAP_GROUP_GENERIC(EXTERNAL_DELIVERY, 19),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_EXTERNAL_ROUTE,
.priority = 1,
},
{ {
.group = DEVLINK_TRAP_GROUP_GENERIC(IPV6, 15), .group = DEVLINK_TRAP_GROUP_GENERIC(IPV6, 15),
.hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6, .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6,
...@@ -882,11 +890,11 @@ static const struct mlxsw_sp_trap_item mlxsw_sp_trap_items_arr[] = { ...@@ -882,11 +890,11 @@ static const struct mlxsw_sp_trap_item mlxsw_sp_trap_items_arr[] = {
}, },
}, },
{ {
.trap = MLXSW_SP_TRAP_CONTROL(EXTERNAL_ROUTE, LOCAL_DELIVERY, .trap = MLXSW_SP_TRAP_CONTROL(EXTERNAL_ROUTE, EXTERNAL_DELIVERY,
TRAP), TRAP),
.listeners_arr = { .listeners_arr = {
MLXSW_SP_RXL_MARK(RTR_INGRESS0, IP2ME, TRAP_TO_CPU, MLXSW_SP_RXL_MARK(RTR_INGRESS0, EXTERNAL_ROUTE,
false), TRAP_TO_CPU, false),
}, },
}, },
{ {
......
...@@ -718,6 +718,7 @@ enum devlink_trap_group_generic_id { ...@@ -718,6 +718,7 @@ enum devlink_trap_group_generic_id {
DEVLINK_TRAP_GROUP_GENERIC_ID_PIM, DEVLINK_TRAP_GROUP_GENERIC_ID_PIM,
DEVLINK_TRAP_GROUP_GENERIC_ID_UC_LB, DEVLINK_TRAP_GROUP_GENERIC_ID_UC_LB,
DEVLINK_TRAP_GROUP_GENERIC_ID_LOCAL_DELIVERY, DEVLINK_TRAP_GROUP_GENERIC_ID_LOCAL_DELIVERY,
DEVLINK_TRAP_GROUP_GENERIC_ID_EXTERNAL_DELIVERY,
DEVLINK_TRAP_GROUP_GENERIC_ID_IPV6, DEVLINK_TRAP_GROUP_GENERIC_ID_IPV6,
DEVLINK_TRAP_GROUP_GENERIC_ID_PTP_EVENT, DEVLINK_TRAP_GROUP_GENERIC_ID_PTP_EVENT,
DEVLINK_TRAP_GROUP_GENERIC_ID_PTP_GENERAL, DEVLINK_TRAP_GROUP_GENERIC_ID_PTP_GENERAL,
...@@ -915,6 +916,8 @@ enum devlink_trap_group_generic_id { ...@@ -915,6 +916,8 @@ enum devlink_trap_group_generic_id {
"uc_loopback" "uc_loopback"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_LOCAL_DELIVERY \ #define DEVLINK_TRAP_GROUP_GENERIC_NAME_LOCAL_DELIVERY \
"local_delivery" "local_delivery"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_EXTERNAL_DELIVERY \
"external_delivery"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_IPV6 \ #define DEVLINK_TRAP_GROUP_GENERIC_NAME_IPV6 \
"ipv6" "ipv6"
#define DEVLINK_TRAP_GROUP_GENERIC_NAME_PTP_EVENT \ #define DEVLINK_TRAP_GROUP_GENERIC_NAME_PTP_EVENT \
......
...@@ -8567,6 +8567,7 @@ static const struct devlink_trap_group devlink_trap_group_generic[] = { ...@@ -8567,6 +8567,7 @@ static const struct devlink_trap_group devlink_trap_group_generic[] = {
DEVLINK_TRAP_GROUP(PIM), DEVLINK_TRAP_GROUP(PIM),
DEVLINK_TRAP_GROUP(UC_LB), DEVLINK_TRAP_GROUP(UC_LB),
DEVLINK_TRAP_GROUP(LOCAL_DELIVERY), DEVLINK_TRAP_GROUP(LOCAL_DELIVERY),
DEVLINK_TRAP_GROUP(EXTERNAL_DELIVERY),
DEVLINK_TRAP_GROUP(IPV6), DEVLINK_TRAP_GROUP(IPV6),
DEVLINK_TRAP_GROUP(PTP_EVENT), DEVLINK_TRAP_GROUP(PTP_EVENT),
DEVLINK_TRAP_GROUP(PTP_GENERAL), DEVLINK_TRAP_GROUP(PTP_GENERAL),
......
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