]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mlxsw: spectrum: Use dedicated trap group for sampled packets
authorIdo Schimmel <idosch@mellanox.com>
Sun, 24 May 2020 21:51:06 +0000 (00:51 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 May 2020 02:32:23 +0000 (19:32 -0700)
The rate with which packets are sampled is determined by user space, so
there is no need to associate such packets with a policer.

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

index 4d61c414348f7c05f0e68e324a96f86a276e7ce1..9b27a129b0a6d7fbfecec8b6364190b6dc192d85 100644 (file)
@@ -5547,6 +5547,7 @@ enum mlxsw_reg_htgt_trap_group {
        MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP0,
        MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP1,
        MLXSW_REG_HTGT_TRAP_GROUP_SP_VRRP,
+       MLXSW_REG_HTGT_TRAP_GROUP_SP_PKT_SAMPLE,
 
        __MLXSW_REG_HTGT_TRAP_GROUP_MAX,
        MLXSW_REG_HTGT_TRAP_GROUP_MAX = __MLXSW_REG_HTGT_TRAP_GROUP_MAX - 1
index c4fdfe8fd5a3f2643b82c1854ff9e60137923bcd..d275887bba2852a45b1658f2b82724a3ab6fff58 100644 (file)
@@ -4103,7 +4103,7 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
                             ROUTER_EXP, false),
        /* PKT Sample trap */
        MLXSW_RXL(mlxsw_sp_rx_listener_sample_func, PKT_SAMPLE, MIRROR_TO_CPU,
-                 false, SP_IP2ME, DISCARD),
+                 false, SP_PKT_SAMPLE, DISCARD),
        /* ACL trap */
        MLXSW_SP_RXL_NO_MARK(ACL0, TRAP_TO_CPU, IP2ME, false),
        /* Multicast Router Traps */
@@ -4252,6 +4252,7 @@ static int mlxsw_sp_trap_groups_set(struct mlxsw_core *mlxsw_core)
                        priority = 1;
                        tc = 1;
                        break;
+               case MLXSW_REG_HTGT_TRAP_GROUP_SP_PKT_SAMPLE:
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_LBERROR:
                        priority = 0;
                        tc = 0;