• Amit Cohen's avatar
    mlxsw: Add specific trap for packets routed via invalid nexthops · 0c3cbbf9
    Amit Cohen authored
    Currently, mlxsw does not differentiate between these two cases of
    routes with invalid nexthops:
    
    1. Nexthops whose nexthop device is a mlxsw upper (has a RIF), but whose
    neighbour could not be resolved
    
    2. Nexthops whose nexthop device is not a mlxsw upper (e.g., management
    interface)
    
    Up until now this did not matter and mlxsw trapped packets for both
    cases using the same trap ID. However, packets that should have been
    routed in hardware (case 1), but incurred a problem are considered
    exceptions and should be reported to the user. The two cases should
    therefore be split between two different trap IDs.
    
    Allocate a new adjacency entry during initialization and upon the
    insertion of the first route with an invalid mlxsw nexthop, program this
    entry to discard packets. Packets hitting this entry will be reported
    using new trap ID - "DISCARD_ROUTER3".
    
    In the future, the entry could be written during initialization, but
    currently firmware requires a valid RIF, which is not available at this
    stage.
    Signed-off-by: default avatarAmit Cohen <amitc@mellanox.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0c3cbbf9
trap.h 3.88 KB