mlxsw: spectrum: Add support for IPv6 MLDv1/2 traps
authorArkadi Sharshevsky <arkadis@mellanox.com>
Mon, 17 Jul 2017 12:15:31 +0000 (14:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jul 2017 16:19:39 +0000 (09:19 -0700)
Add support for IPv6 MLDv1/2 packet trapping.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
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>
drivers/net/ethernet/mellanox/mlxsw/reg.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/trap.h

index 1bd34d9a7b9e20bf90558897ed084f3c6d7422ba..0ca196899e18a0aff8da1acfb7053698d3c76ae0 100644 (file)
@@ -3688,6 +3688,7 @@ enum mlxsw_reg_htgt_trap_group {
        MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME,
        MLXSW_REG_HTGT_TRAP_GROUP_SP_DHCP,
        MLXSW_REG_HTGT_TRAP_GROUP_SP_EVENT,
+       MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6_MLD,
 };
 
 /* reg_htgt_trap_group
index bc35b400e6f1fecd8c890d201514740a316186b5..1aa6298ea6cdfe14e158f372235ba5a22561baff 100644 (file)
@@ -3333,6 +3333,14 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
        MLXSW_SP_RXL_MARK(ARPBC, MIRROR_TO_CPU, ARP, false),
        MLXSW_SP_RXL_MARK(ARPUC, MIRROR_TO_CPU, ARP, false),
        MLXSW_SP_RXL_NO_MARK(FID_MISS, TRAP_TO_CPU, IP2ME, false),
+       MLXSW_SP_RXL_MARK(IPV6_MLDV12_LISTENER_QUERY, MIRROR_TO_CPU, IPV6_MLD,
+                         false),
+       MLXSW_SP_RXL_NO_MARK(IPV6_MLDV1_LISTENER_REPORT, TRAP_TO_CPU, IPV6_MLD,
+                            false),
+       MLXSW_SP_RXL_NO_MARK(IPV6_MLDV1_LISTENER_DONE, TRAP_TO_CPU, IPV6_MLD,
+                            false),
+       MLXSW_SP_RXL_NO_MARK(IPV6_MLDV2_LISTENER_REPORT, TRAP_TO_CPU, IPV6_MLD,
+                            false),
        /* L3 traps */
        MLXSW_SP_RXL_MARK(MTUERROR, TRAP_TO_CPU, ROUTER_EXP, false),
        MLXSW_SP_RXL_MARK(TTLERROR, TRAP_TO_CPU, ROUTER_EXP, false),
@@ -3377,6 +3385,7 @@ static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core)
                        burst_size = 7;
                        break;
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_IGMP:
+               case MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6_MLD:
                        rate = 16 * 1024;
                        burst_size = 10;
                        break;
@@ -3441,6 +3450,7 @@ static int mlxsw_sp_trap_groups_set(struct mlxsw_core *mlxsw_core)
                        break;
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_IGMP:
                case MLXSW_REG_HTGT_TRAP_GROUP_SP_IP2ME:
+               case MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6_MLD:
                        priority = 3;
                        tc = 3;
                        break;
index 4946d4e2b3f9e7732346417fe519a28ef086ba35..891b4ee6eeb2430e9e5a1258229c061620361c90 100644 (file)
@@ -63,6 +63,10 @@ enum {
        MLXSW_TRAP_ID_LBERROR = 0x54,
        MLXSW_TRAP_ID_OSPF = 0x55,
        MLXSW_TRAP_ID_IP2ME = 0x5F,
+       MLXSW_TRAP_ID_IPV6_MLDV12_LISTENER_QUERY = 0x65,
+       MLXSW_TRAP_ID_IPV6_MLDV1_LISTENER_REPORT = 0x66,
+       MLXSW_TRAP_ID_IPV6_MLDV1_LISTENER_DONE = 0x67,
+       MLXSW_TRAP_ID_IPV6_MLDV2_LISTENER_REPORT = 0x68,
        MLXSW_TRAP_ID_RTR_INGRESS0 = 0x70,
        MLXSW_TRAP_ID_BGP_IPV4 = 0x88,
        MLXSW_TRAP_ID_HOST_MISS_IPV4 = 0x90,