Subject: [PATCH net-next v2 00/13] mlxsw: Add support for buffer drops mirroring

From: Petr Machata <[email-masked]>
Date: Sat, 11 Jul 2020 00:55:02 +0300

This set offloads the recently introduced qevent infrastructure in TC and
allows mlxsw to support mirroring of packets that were dropped due to
buffer related reasons (e.g., early drops) during forwarding.

Up until now mlxsw only supported mirroring that was either triggered by
per-port triggers (i.e., via matchall) or by the policy engine (i.e.,
via flower). Packets that are dropped due to buffer related reasons are
mirrored using a third type of trigger, a global trigger.

Global triggers are bound once to a mirroring (SPAN) agent and enabled
on a per-{port, TC} basis. This allows users, for example, to request
that only packets that were early dropped on a specific netdev to be
mirrored.

Patch set overview:

Patch #1 extends flow_block_offload and indirect offload structure to pass
a scheduler instead of a netdevice. That is necessary, because binding type
and netdevice are not a unique identifier of the block anymore.

Patches #2-#3 add the required registers to support above mentioned
functionality.

Patches #4-#6 gradually add support for global mirroring triggers.

Patch #7 adds support for enablement of global mirroring triggers.

Patches #8-#11 are cleanups in the flow offload code and shuffle some
code around to make the qevent offload easier.

Patch #12 implements offload of RED early_drop qevent.

Patch #13 extends the RED selftest for offloaded datapath to cover
early_drop qevent.

v2:
- Patch #1:
    - In struct flow_block_indr, track both sch and dev.

Amit Cohen (2):
  mlxsw: reg: Add Monitoring Mirror Trigger Enable Register
  mlxsw: reg: Add Monitoring Port Analyzer Global Register

Ido Schimmel (4):
  mlxsw: spectrum_span: Move SPAN operations out of global file
  mlxsw: spectrum_span: Prepare for global mirroring triggers
  mlxsw: spectrum_span: Add support for global mirroring triggers
  mlxsw: spectrum_span: Add APIs to enable / disable global mirroring
    triggers

Petr Machata (7):
  net: sched: Pass qdisc reference in struct flow_block_offload
  mlxsw: spectrum_flow: Convert a goto to a return
  mlxsw: spectrum_flow: Drop an unused field
  mlxsw: spectrum_matchall: Publish matchall data structures
  mlxsw: spectrum_flow: Promote binder-type dispatch to spectrum.c
  mlxsw: spectrum_qdisc: Offload mirroring on RED qevent early_drop
  selftests: mlxsw: RED: Test offload of mirror on RED early_drop qevent

 drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c  |   9 +-
 .../ethernet/mellanox/mlx5/core/en/rep/tc.c   |  10 +-
 drivers/net/ethernet/mellanox/mlxsw/reg.h     | 102 ++++
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  65 +--
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  33 +-
 .../ethernet/mellanox/mlxsw/spectrum_flow.c   |  18 +-
 .../mellanox/mlxsw/spectrum_matchall.c        |  23 -
 .../ethernet/mellanox/mlxsw/spectrum_qdisc.c  | 472 ++++++++++++++++++
 .../ethernet/mellanox/mlxsw/spectrum_span.c   | 397 ++++++++++++++-
 .../ethernet/mellanox/mlxsw/spectrum_span.h   |  16 +
 .../net/ethernet/netronome/nfp/flower/main.h  |   2 +-
 .../ethernet/netronome/nfp/flower/offload.c   |   8 +-
 include/net/flow_offload.h                    |   9 +-
 net/core/flow_offload.c                       |  12 +-
 net/netfilter/nf_flow_table_offload.c         |   2 +-
 net/netfilter/nf_tables_offload.c             |   2 +-
 net/sched/cls_api.c                           |  16 +-
 .../drivers/net/mlxsw/sch_red_core.sh         | 106 +++-
 .../drivers/net/mlxsw/sch_red_ets.sh          |  11 +
 .../drivers/net/mlxsw/sch_red_root.sh         |   8 +
 20 files changed, 1179 insertions(+), 142 deletions(-)

-- 
2.20.1