mlxsw: spectrum_span: Add support for mirroring towards CPU port
authorIdo Schimmel <idosch@mellanox.com>
Tue, 14 Jul 2020 14:20:59 +0000 (17:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Jul 2020 21:50:49 +0000 (14:50 -0700)
commitfa8c08b8fcbd4a4bd201297d27a9ccbd2eb4b1f1
tree6263af4b92b2babd80b517f66c1398c47696183b
parent6edc8beab443ec23d10e489007b4e94d9a05846d
mlxsw: spectrum_span: Add support for mirroring towards CPU port

The Spectrum-2 and Spectrum-3 ASICs are able to mirror packets towards
the CPU. These packets are then trapped like any other packet, but with
a special packet trap and additional metadata such as why the packet was
mirrored.

The ability to mirror packets towards the CPU will be utilized by a
subsequent patch set that will mirror packets that were dropped by the
ASIC for various buffer-related reasons, such as tail-drop and
early-drop.

Add mirroring towards the CPU as a new SPAN agent type and re-use the
functions that mirror to a physical port where possible.

Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c