]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_span: Add SPAN probability rate support
authorIdo Schimmel <idosch@nvidia.com>
Thu, 11 Mar 2021 12:24:13 +0000 (14:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Mar 2021 00:22:39 +0000 (16:22 -0800)
commitf75c04754bf02d270690e7e742f84a12372522e8
tree038e13975ab9961310c269585b8cf334c1324e74
parent7c3a333b8eb278f0f68209f1b0904a5837ff3479
mlxsw: spectrum_span: Add SPAN probability rate support

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: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h