]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mlxsw: spectrum: Trap IPv4 DHCP packets in router
authorIdo Schimmel <idosch@mellanox.com>
Sun, 24 May 2020 21:50:59 +0000 (00:50 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 May 2020 02:32:23 +0000 (19:32 -0700)
Currently, IPv4 DHCP packets are trapped during L2 forwarding, which
means that packets might be trapped unnecessarily. Instead, only trap
the DHCP packets that reach the router. Either because they were flooded
to the router port or forwarded to it by the FDB. This is consistent
with the corresponding IPv6 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
drivers/net/ethernet/mellanox/mlxsw/trap.h

index bab51dfb6e13a032feabc6186dea618a7d9dd1bb..fa6e630abb6e94289bb87a20b837b17a20668296 100644 (file)
@@ -4045,7 +4045,6 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
        MLXSW_SP_RXL_NO_MARK(LACP, TRAP_TO_CPU, LACP, true),
        MLXSW_RXL(mlxsw_sp_rx_listener_ptp, LLDP, TRAP_TO_CPU,
                  false, SP_LLDP, DISCARD),
-       MLXSW_SP_RXL_MARK(DHCP, MIRROR_TO_CPU, DHCP, false),
        MLXSW_SP_RXL_MARK(IGMP_QUERY, MIRROR_TO_CPU, MC_SNOOPING, false),
        MLXSW_SP_RXL_NO_MARK(IGMP_V1_REPORT, TRAP_TO_CPU, MC_SNOOPING, false),
        MLXSW_SP_RXL_NO_MARK(IGMP_V2_REPORT, TRAP_TO_CPU, MC_SNOOPING, false),
@@ -4074,6 +4073,7 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
                          false),
        MLXSW_SP_RXL_MARK(IPV4_OSPF, TRAP_TO_CPU, OSPF, false),
        MLXSW_SP_RXL_MARK(IPV6_OSPF, TRAP_TO_CPU, OSPF, false),
+       MLXSW_SP_RXL_MARK(IPV4_DHCP, TRAP_TO_CPU, DHCP, false),
        MLXSW_SP_RXL_MARK(IPV6_DHCP, TRAP_TO_CPU, DHCP, false),
        MLXSW_SP_RXL_MARK(RTR_INGRESS0, TRAP_TO_CPU, REMOTE_ROUTE, false),
        MLXSW_SP_RXL_MARK(IPV4_BGP, TRAP_TO_CPU, BGP, false),
index eaa521b7561b76940f676b6d37a5cddf8f0c6273..fac05433c488776f9fcd4e4b2f04fd740c6f6ca8 100644 (file)
@@ -59,6 +59,7 @@ enum {
        MLXSW_TRAP_ID_L3_IPV6_NEIGHBOR_SOLICITATION = 0x8C,
        MLXSW_TRAP_ID_L3_IPV6_NEIGHBOR_ADVERTISMENT = 0x8D,
        MLXSW_TRAP_ID_L3_IPV6_REDIRECTION = 0x8E,
+       MLXSW_TRAP_ID_IPV4_DHCP = 0x8F,
        MLXSW_TRAP_ID_HOST_MISS_IPV4 = 0x90,
        MLXSW_TRAP_ID_IPV6_MC_LINK_LOCAL_DEST = 0x91,
        MLXSW_TRAP_ID_HOST_MISS_IPV6 = 0x92,