netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, jiri@mellanox.com,
	petrm@mellanox.com, amitc@mellanox.com, mlxsw@mellanox.com,
	Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH net-next 00/13] mlxsw: Mirror to CPU preparations
Date: Tue, 14 Jul 2020 17:20:53 +0300	[thread overview]
Message-ID: <20200714142106.386354-1-idosch@idosch.org> (raw)

From: Ido Schimmel <idosch@mellanox.com>

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(-)

-- 
2.26.2


             reply	other threads:[~2020-07-14 14:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 14:20 Ido Schimmel [this message]
2020-07-14 14:20 ` [PATCH net-next 01/13] mlxsw: reg: Add session_id and pid to MPAT register Ido Schimmel
2020-07-14 14:20 ` [PATCH net-next 02/13] mlxsw: reg: add mirroring_pid_base to MOGCR register Ido Schimmel
2020-07-14 14:20 ` [PATCH net-next 03/13] mlxsw: spectrum_span: Add per-ASIC SPAN agent operations Ido Schimmel
2020-07-14 14:20 ` [PATCH net-next 04/13] mlxsw: spectrum_span: Add driver private info to parms_set() callback Ido Schimmel
2020-07-14 14:20 ` [PATCH net-next 05/13] mlxsw: spectrum_span: Do not dereference destination netdev Ido Schimmel
2020-07-14 14:20 ` [PATCH net-next 06/13] mlxsw: spectrum_span: Add support for mirroring towards CPU port Ido Schimmel
2020-07-14 14:21 ` [PATCH net-next 07/13] mlxsw: spectrum_span: Allow passing parameters to SPAN agents Ido Schimmel
2020-07-14 14:21 ` [PATCH net-next 08/13] mlxsw: spectrum_span: Allow setting policer on a SPAN agent Ido Schimmel
2020-07-14 14:21 ` [PATCH net-next 09/13] mlxsw: reg: Increase trap identifier to 10 bits Ido Schimmel
2020-07-14 14:21 ` [PATCH net-next 10/13] mlxsw: trap: Add trap identifiers for mirrored packets Ido Schimmel
2020-07-14 14:21 ` [PATCH net-next 11/13] mlxsw: pci: Add mirror reason field to CQEv2 Ido Schimmel
2020-07-14 14:21 ` [PATCH net-next 12/13] mlxsw: pci: Retrieve mirror reason from CQE during receive Ido Schimmel
2020-07-14 14:21 ` [PATCH net-next 13/13] mlxsw: core: Use mirror reason during Rx listener lookup Ido Schimmel
2020-07-14 21:51 ` [PATCH net-next 00/13] mlxsw: Mirror to CPU preparations David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200714142106.386354-1-idosch@idosch.org \
    --to=idosch@idosch.org \
    --cc=amitc@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).