• Ido Schimmel's avatar
    mlxsw: spectrum_span: Add SPAN probability rate support · 2dcbd920
    Ido Schimmel authored
    Currently, every packet that matches a mirroring trigger (e.g., received
    packets, buffer dropped packets) is mirrored. Spectrum-2 and later ASICs
    support mirroring with probability, where every 1 in N matched packets
    is mirrored.
    
    Extend the API that creates the binding between the trigger and the SPAN
    agent with a probability rate parameter, which is an attribute of the
    trigger. Set it to '1' to maintain existing behavior.
    
    Subsequent patches will use it to perform more sophisticated sampling,
    by mirroring packets to the CPU with probability.
    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>
    2dcbd920
spectrum_span.c 46.8 KB