• Ido Schimmel's avatar
    mlxsw: spectrum_span: Add APIs to bind / unbind a SPAN agent · c056618c
    Ido Schimmel authored
    Currently, a SPAN agent can only be bound to a per-port trigger where
    the trigger is either an incoming packet (INGRESS) or an outgoing packet
    (EGRESS) to / from the port.
    
    A follow-up patch set will introduce the concept of global triggers and
    per-{port, TC} enablement. With global triggers, the trigger entry is
    only keyed by a trigger and not by a port and a trigger. The trigger can
    be, for example, a packet that was early dropped.
    
    While the binding between the SPAN agent and the trigger is performed
    only once, the trigger entry needs to be reference counted, as the
    trigger can be enabled on multiple ports.
    
    Add APIs to bind / unbind a SPAN agent to a trigger and reference count
    the trigger entry in preparation for global triggers.
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c056618c
spectrum_span.c 37.1 KB