• Ido Schimmel's avatar
    mlxsw: spectrum_acl: Offload FLOW_ACTION_SAMPLE · 45aad0b7
    Ido Schimmel authored
    Implement support for action sample when used with a flower classifier
    by implementing the required sampler_add() / sampler_del() callbacks and
    registering an Rx listener for the sampled packets.
    
    The sampler_add() callback returns an error for Spectrum-1 as the
    functionality is not supported. In Spectrum-{2,3} the callback creates a
    mirroring agent towards the CPU. The agent's identifier is used by the
    policy engine code to mirror towards the CPU with probability.
    
    The Rx listener for the sampled packet is registered with the 'policy
    engine' mirroring reason and passes trapped packets to the psample
    module after looking up their parameters (e.g., sampling group).
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    45aad0b7
spectrum.h 46.5 KB