• Ido Schimmel's avatar
    mlxsw: spectrum_span: Add APIs to get / put an analyzed port · ed04458d
    Ido Schimmel authored
    An analyzed port is a port whose incoming / outgoing traffic is mirrored
    to a SPAN agent and analyzed on a remote server.
    
    A port can be analyzed by multiple tc filters and therefore the
    corresponding analyzed port entry needs to be reference counted. This is
    significant because ports whose outgoing traffic is analyzed need to
    have an egress mirror buffer.
    
    Add APIs to get / put an analyzed port. Allocate an egress mirror buffer
    on a port when it is first inspected at egress and free the buffer when
    it is no longer inspected at egress.
    
    Protect the list of analyzed ports with a mutex, as a later patch will
    traverse it from a context in which RTNL lock is not held.
    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>
    ed04458d
spectrum_span.c 32.4 KB