diff options
author | Ido Schimmel <idosch@mellanox.com> | 2015-10-15 17:43:28 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-16 08:27:56 +0200 |
commit | 801bd3defb2eac756e6570168d0f8187781ad8ad (patch) | |
tree | 14ba70e7aa706221a721d5d69e600866286a2931 /drivers/net/ethernet/mellanox/mlxsw/switchx2.c | |
parent | mlxsw: Simplify traps creation (diff) | |
download | linux-801bd3defb2eac756e6570168d0f8187781ad8ad.tar.xz linux-801bd3defb2eac756e6570168d0f8187781ad8ad.zip |
mlxsw: Add trap group for control packets
Previously, we trapped flooded and control packets using the same trap
group. This can cause flooded packets to overflow the PCI bus and
prevent control packets (e.g. STP, LACP) from getting to the CPU.
Solve this by splitting the RX trap group to RX and control, which allows
us to configure a policer on the first, thereby preventing it from
overflowing the PCI bus.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/switchx2.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c index 85dcda44d0b0..4f72e0a423d9 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c +++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c @@ -1313,6 +1313,11 @@ static int mlxsw_sx_traps_init(struct mlxsw_sx *mlxsw_sx) if (err) return err; + mlxsw_reg_htgt_pack(htgt_pl, MLXSW_REG_HTGT_TRAP_GROUP_CTRL); + err = mlxsw_reg_write(mlxsw_sx->core, MLXSW_REG(htgt), htgt_pl); + if (err) + return err; + for (i = 0; i < ARRAY_SIZE(mlxsw_sx_rx_listener); i++) { err = mlxsw_core_rx_listener_register(mlxsw_sx->core, &mlxsw_sx_rx_listener[i], |