]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mlxsw: spectrum: Change default rate and priority of DHCP packets
authorIdo Schimmel <idosch@mellanox.com>
Sun, 24 May 2020 21:51:00 +0000 (00:51 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 May 2020 02:32:23 +0000 (19:32 -0700)
Reduce the default acceptable rate of DHCP packets to 128 packets per
second and reduce their priority. This is reasonable given the Spectrum
ASICs are limited to 128 ports at the moment.

These are only the default values. Users will be able to modify them via
devlink-trap.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

index fa6e630abb6e94289bb87a20b837b17a20668296..c2d6890803dac9a7ea42762280d0aa45772179d4 100644 (file)
@@ -4152,6 +4152,7 @@ static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core)
                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;
@@ -4161,7 +4162,6 @@ static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core)
                        break;
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_BGP:
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_ARP:
-               case MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP:
                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_ND:
@@ -4230,7 +4230,6 @@ static int mlxsw_sp_trap_groups_set(struct mlxsw_core *mlxsw_core)
                        tc = 5;
                        break;
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_BGP:
-               case MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP:
                        priority = 4;
                        tc = 4;
                        break;
@@ -4242,6 +4241,7 @@ static int mlxsw_sp_trap_groups_set(struct mlxsw_core *mlxsw_core)
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_ARP:
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6_ND:
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP1:
+               case MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP:
                        priority = 2;
                        tc = 2;
                        break;