Skip to content

mlxsw: Mirror to CPU preparations

Ido Schimmel netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13mlxsw: reg: Add session_id and pid to MPAT registerdrivers/net/ethernet/mellanox/mlxsw/reg.h+19 -00 replies
2/13mlxsw: reg: add mirroring_pid_base to MOGCR registerdrivers/net/ethernet/mellanox/mlxsw/reg.h+8 -00 replies
3/13mlxsw: spectrum_span: Add per-ASIC SPAN agent operationsdrivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+27 -40 replies
4/13mlxsw: spectrum_span: Add driver private info to parms_set() callbackdrivers/net/ethernet/mellanox/mlxsw/spectrum_span.c drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h+14 -80 replies
5/13mlxsw: spectrum_span: Do not dereference destination netdevdrivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+3 -40 replies
6/13mlxsw: spectrum_span: Add support for mirroring towards CPU portdrivers/net/ethernet/mellanox/mlxsw/spectrum_span.c+88 -00 replies
7/13mlxsw: spectrum_span: Allow passing parameters to SPAN agentsdrivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c +2 more+20 -80 replies
8/13mlxsw: spectrum_span: Allow setting policer on a SPAN agentdrivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +1 more+114 -30 replies
9/13mlxsw: reg: Increase trap identifier to 10 bitsdrivers/net/ethernet/mellanox/mlxsw/pci_hw.h drivers/net/ethernet/mellanox/mlxsw/reg.h drivers/net/ethernet/mellanox/mlxsw/trap.h+3 -30 replies
10/13mlxsw: trap: Add trap identifiers for mirrored packetsdrivers/net/ethernet/mellanox/mlxsw/trap.h+8 -00 replies
11/13mlxsw: pci: Add mirror reason field to CQEv2drivers/net/ethernet/mellanox/mlxsw/pci_hw.h+5 -00 replies
12/13mlxsw: pci: Retrieve mirror reason from CQE during receivedrivers/net/ethernet/mellanox/mlxsw/core.h drivers/net/ethernet/mellanox/mlxsw/pci.c+6 -10 replies
13/13mlxsw: core: Use mirror reason during Rx listener lookupdrivers/net/ethernet/mellanox/mlxsw/core.c drivers/net/ethernet/mellanox/mlxsw/core.h+5 -20 replies

Reviews trailers per patch

All 13 patches have a Reviewed-by or Acked-by.

PatchJiri Pirko
1/13R-b
2/13R-b
3/13R-b
4/13R-b
5/13R-b
6/13R-b
7/13R-b
8/13R-b
9/13R-b
10/13R-b
11/13R-b
12/13R-b
13/13R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 00/13] mlxsw: Mirror to CPU preparations

From: Ido Schimmel <[email protected]>

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.

Amit Cohen (3):
mlxsw: reg: Add session_id and pid to MPAT register
mlxsw: reg: add mirroring_pid_base to MOGCR register
mlxsw: reg: Increase trap identifier to 10 bits

Ido Schimmel (10):
mlxsw: spectrum_span: Add per-ASIC SPAN agent operations
mlxsw: spectrum_span: Add driver private info to parms_set() callback
mlxsw: spectrum_span: Do not dereference destination netdev
mlxsw: spectrum_span: Add support for mirroring towards CPU port
mlxsw: spectrum_span: Allow passing parameters to SPAN agents
mlxsw: spectrum_span: Allow setting policer on a SPAN agent
mlxsw: trap: Add trap identifiers for mirrored packets
mlxsw: pci: Add mirror reason field to CQEv2
mlxsw: pci: Retrieve mirror reason from CQE during receive
mlxsw: core: Use mirror reason during Rx listener lookup

 drivers/net/ethernet/mellanox/mlxsw/core.c    |   6 +-
 drivers/net/ethernet/mellanox/mlxsw/core.h    |   2 +
 drivers/net/ethernet/mellanox/mlxsw/pci.c     |   6 +-
 drivers/net/ethernet/mellanox/mlxsw/pci_hw.h  |   7 +-
 drivers/net/ethernet/mellanox/mlxsw/reg.h     |  29 +-
 .../mlxsw/spectrum_acl_flex_actions.c         |   4 +-
 .../mellanox/mlxsw/spectrum_matchall.c        |   6 +-
 .../ethernet/mellanox/mlxsw/spectrum_qdisc.c  |   5 +-
 .../ethernet/mellanox/mlxsw/spectrum_span.c   | 257 ++++++++++++++++--
 .../ethernet/mellanox/mlxsw/spectrum_span.h   |  17 +-
 drivers/net/ethernet/mellanox/mlxsw/trap.h    |  10 +-
 11 files changed, 318 insertions(+), 31 deletions(-)
Signature · 1 line
2.26.2