• Ido Schimmel's avatar
    mlxsw: spectrum_router: Use trap action only for some route types · 70ad3506
    Ido Schimmel authored
    The device can have one of three actions associated with a route:
    
    1) Remote - packets continue to the adjacency table
    2) Local - packets continue to the neighbour table
    3) Trap - packets continue to the CPU
    
    The first two actions can also trap packets to the CPU, but they do so
    using a different trap ID, which has a lower traffic class and less
    allotted bandwidth.
    
    We currently use the third action for both RTN_{LOCAL,BROADCAST} routes
    and RTN_UNICAST routes not pointing to the switch ports.
    
    However, packets that merely need to be forwarded by the switch are
    likely not control packets and can be therefore scheduled towards the
    CPU using a lower traffic class.
    
    Achieve the above by assigning the third action only to local and
    broadcast routes and have any other route use either of the first two
    actions, based on whether the route is gatewayed or not.
    
    This will also allow us to refresh routes using the local action and
    have them trap packets when their RIF is no longer valid following a
    NH_DEL event.
    
    One side effect of this patch is that we no longer give special
    treatment to multipath routes using both switch and non-switch ports
    towards their nexthops. If at least one of the nexthops can be resolved,
    then the device will forward the packets instead of trapping them.
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    70ad3506
spectrum_router.c 59.9 KB