]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mlxsw: spectrum: Align TC and trap priority
authorIdo Schimmel <idosch@mellanox.com>
Sun, 24 May 2020 21:51:02 +0000 (00:51 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 May 2020 02:32:23 +0000 (19:32 -0700)
The traffic class (TC) attribute of packet traps determines through which
TC a packet trap will be scheduled through the CPU port.

The priority attribute determines which trap will be triggered in case
several packet traps match a packet.

We try to configure these attributes to the same value for all packet
traps as there is little reason not to.

Some packet traps did not use the same value, so rectify that now.

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
drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c

index c2d6890803dac9a7ea42762280d0aa45772179d4..978f6d98e8c4e0e727951e4e873cea85d1ac9e24 100644 (file)
@@ -4253,7 +4253,7 @@ static int mlxsw_sp_trap_groups_set(struct mlxsw_core *mlxsw_core)
                        break;
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_LBERROR:
                        priority = 0;
-                       tc = 1;
+                       tc = 0;
                        break;
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_EVENT:
                        priority = MLXSW_REG_HTGT_DEFAULT_PRIORITY;
index 3a13b17cd1b865c4ef143f405036cd0a927d69e9..1d414d0e5431383e0e20768014cf18c7f5778fef 100644 (file)
@@ -207,25 +207,25 @@ static const struct mlxsw_sp_trap_group_item mlxsw_sp_trap_group_items_arr[] = {
                .group = DEVLINK_TRAP_GROUP_GENERIC(L2_DROPS, 1),
                .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_L2_DISCARDS,
                .priority = 0,
-               .tc = 1,
+               .tc = 0,
        },
        {
                .group = DEVLINK_TRAP_GROUP_GENERIC(L3_DROPS, 1),
                .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_L3_DISCARDS,
                .priority = 0,
-               .tc = 1,
+               .tc = 0,
        },
        {
                .group = DEVLINK_TRAP_GROUP_GENERIC(TUNNEL_DROPS, 1),
                .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_TUNNEL_DISCARDS,
                .priority = 0,
-               .tc = 1,
+               .tc = 0,
        },
        {
                .group = DEVLINK_TRAP_GROUP_GENERIC(ACL_DROPS, 1),
                .hw_group_id = MLXSW_REG_HTGT_TRAP_GROUP_SP_ACL_DISCARDS,
                .priority = 0,
-               .tc = 1,
+               .tc = 0,
        },
 };