Merge branch 'mlxsw-Mirror-to-CPU-preparations'
authorDavid S. Miller <davem@davemloft.net>
Tue, 14 Jul 2020 21:50:50 +0000 (14:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Jul 2020 21:50:50 +0000 (14:50 -0700)
commit3d12e50fdd336b9b2e86285dab02a3bb743548c7
tree737301a56e5470a77f75f43205698b31e87329a9
parent8331bbe9eab7515b98adf99b39d85ef34057b6f2
parent6a8c101e0795d4fe892f281a4e08b2a05cbb9e20
Merge branch 'mlxsw-Mirror-to-CPU-preparations'

Ido Schimmel says:

====================
mlxsw: Mirror to CPU preparations

A future patch set will add the ability to trap packets that were
dropped due to buffer related reasons (e.g., early drop). Internally
this is implemented by mirroring these packets towards the CPU port.
This patch set adds the required infrastructure to enable such
mirroring.

Patches #1-#2 extend two registers needed for above mentioned
functionality.

Patches #3-#6 gradually add support for setting the mirroring target of
a SPAN (mirroring) agent as the CPU port. This is only supported from
Spectrum-2 onwards, so an error is returned for Spectrum-1.

Patches #7-#8 add the ability to set a policer on a SPAN agent. This is
required because unlike regularly trapped packets, a policer cannot be
set on the trap group with which the mirroring trap is associated.

Patches #9-#12 parse the mirror reason field from the Completion Queue
Element (CQE). Unlike other trapped packets, the trap identifier of
mirrored packets only indicates that the packet was mirrored, but not
why. The reason (e.g., tail drop) is encoded in the mirror reason field.

Patch #13 utilizes the mirror reason field in order to lookup the
matching Rx listener. This allows us to maintain the abstraction that an
Rx listener is mapped to a single trap reason. Without taking the mirror
reason into account we would need to register a single Rx listener for
all mirrored packets.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>