• Ido Schimmel's avatar
    mlxsw: core: Use mirror reason during Rx listener lookup · 6a8c101e
    Ido Schimmel authored
    The Rx listener abstraction allows the switch driver (e.g.,
    mlxsw_spectrum) to register a function that is called when a packet is
    received (trapped) for a specific reason.
    
    Up until now, the Rx listener lookup was solely based on the trap
    identifier. However, when a packet is mirrored to the CPU the trap
    identifier merely indicates that the packet was mirrored, but not why it
    was mirrored. This makes it impossible for the switch driver to register
    different Rx listeners for different mirror reasons.
    
    Solve this by allowing the switch driver to register a Rx listener with
    a mirror reason and by extending the Rx listener lookup to take the
    mirror reason into account.
    Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6a8c101e
core.h 16.5 KB