Merge branch 'mlxsw-ECN-mirroring'
authorDavid S. Miller <davem@davemloft.net>
Tue, 12 Oct 2021 10:19:35 +0000 (11:19 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Oct 2021 10:19:35 +0000 (11:19 +0100)
commit249ae9495b0398c6d21fc7dfdd18ff5e36cf27e2
treed34456783783852e208c4aeb7cc3060db7246d30
parentff7f0e4e7930202faed4ace6f09e303a455d0cab
parent0cd6fa99a076b79744d26bb2f4d089e1c4eae2e4
Merge branch 'mlxsw-ECN-mirroring'

Ido Schimmel says:

====================
mlxsw: Add support for ECN mirroring

Petr says:

Patches in this set have been floating around for some time now together
with trap_fwd support. That will however need more work, time for which is
nowhere to be found, apparently. Instead, this patchset enables offload of
only packet mirroring on RED mark qevent, enabling mirroring of ECN-marked
packets.

Formally it enables offload of filters added to blocks bound to the RED
qevent mark if:

- The switch ASIC is Spectrum-2 or above.
- Only a single filter is attached at the block, at chain 0 (the default),
  and its classifier is matchall.
- The filter has hw_stats set to disabled.
- The filter has a single action, which is mirror.

This differs from early_drop qevent offload, which supports mirroring and
trapping. However trapping in context of ECN-marked packets is not
suitable, because the HW does not drop the packet, as the trap action
implies. And there is as of now no way to express only the part of trapping
that transfers the packet to the SW datapath, sans the HW-datapath drop.

The patchset progresses as follows:

Patch #1 is an extack propagation.

Mirroring of ECN-marked packets is configured in the ASIC through an ECN
trigger, which is considered "egress", unlike the EARLY_DROP trigger.
In patch #2, add a helper to classify triggers as ingress.

As clarified above, traps cannot be offloaded on mark qevent. Similarly,
given a trap_fwd action, it would not be offloadable on early_drop qevent.
In patch #3, introduce support for tracking actions permissible on a given
block.

Patch #4 actually adds the mark qevent offload.

In patch #5, fix a small style issue in one of the selftests, and in
patch #6 add mark offload selftests.
====================

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