]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_matchall: Implement sampling using mirroring
authorIdo Schimmel <idosch@nvidia.com>
Thu, 11 Mar 2021 12:24:16 +0000 (14:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Mar 2021 00:22:39 +0000 (16:22 -0800)
commit89cbf1af2e148a428d95b96ca54d55cee6f06f4f
treea06fea40c1ae27e95fe78d2cade39419aa68680b
parentf2f4d725e7519a9c413f17b4e8787ff7c6088d4a
mlxsw: spectrum_matchall: Implement sampling using mirroring

Spectrum-2 and later ASICs support sampling of packets by mirroring to
the CPU with probability. There are several advantages compared to the
legacy dedicated sampling mechanism:

* Extra metadata per-packet: Egress port, egress traffic class, traffic
  class occupancy and end-to-end latency
* Ability to sample packets on egress / per-flow

Convert Spectrum-2 and later ASICs to perform sampling by mirroring to
the CPU with probability.

Subsequent patches will add support for egress / per-flow sampling and
expose the extra metadata.

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.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c