All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, jiri@nvidia.com,
	roopa@nvidia.com, peter.phaal@inmon.com, neil.mckee@inmon.com,
	mlxsw@nvidia.com, Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 00/10] mlxsw: Add support for egress and policy-based sampling
Date: Tue, 16 Mar 2021 17:02:53 +0200	[thread overview]
Message-ID: <20210316150303.2868588-1-idosch@idosch.org> (raw)

From: Ido Schimmel <idosch@nvidia.com>

So far mlxsw only supported ingress sampling using matchall classifier.
This series adds support for egress sampling and policy-based sampling
using flower classifier on Spectrum-2 and newer ASICs. As such, it is
now possible to issue these commands:

 # tc filter add dev swp1 egress pref 1 proto all matchall action sample rate 100 group 1

 # tc filter add dev swp2 ingress pref 1 proto ip flower dst_ip 198.51.100.1 action sample rate 100 group 2

When performing egress sampling (using either matchall or flower) the
ASIC is able to report the end-to-end latency which is passed to the
psample module.

Series overview:

Patches #1-#3 are preparations without any functional changes

Patch #4 generalizes the idea of sampling triggers and creates a hash
table to track active sampling triggers in preparation for egress and
policy-based triggers. The motivation is explained in the changelog

Patch #5 flips mlxsw to start using this hash table instead of storing
ingress sampling triggers as an attribute of the sampled port

Patch #6 finally adds support for egress sampling using matchall
classifier

Patches #7-#8 add support for policy-based sampling using flower
classifier

Patches #9 extends the mlxsw sampling selftest to cover the new triggers

Patch #10 makes sure that egress sampling configuration only fails on
Spectrum-1

Ido Schimmel (10):
  mlxsw: spectrum_matchall: Propagate extack further
  mlxsw: spectrum_matchall: Push sampling checks to per-ASIC operations
  mlxsw: spectrum_matchall: Pass matchall entry to sampling operations
  mlxsw: spectrum: Track sampling triggers in a hash table
  mlxsw: spectrum: Start using sampling triggers hash table
  mlxsw: spectrum_matchall: Add support for egress sampling
  mlxsw: core_acl_flex_actions: Add mirror sampler action
  mlxsw: spectrum_acl: Offload FLOW_ACTION_SAMPLE
  selftests: mlxsw: Add tc sample tests for new triggers
  selftests: mlxsw: Test egress sampling limitation on Spectrum-1 only

 .../mellanox/mlxsw/core_acl_flex_actions.c    | 131 ++++++++++++++
 .../mellanox/mlxsw/core_acl_flex_actions.h    |  11 ++
 .../net/ethernet/mellanox/mlxsw/spectrum.c    | 148 ++++++++++++++++
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  52 +++++-
 .../ethernet/mellanox/mlxsw/spectrum_acl.c    |  25 +++
 .../mlxsw/spectrum_acl_flex_actions.c         |  83 +++++++++
 .../ethernet/mellanox/mlxsw/spectrum_flow.c   |   2 +-
 .../ethernet/mellanox/mlxsw/spectrum_flower.c |  18 ++
 .../mellanox/mlxsw/spectrum_matchall.c        | 167 +++++++++++-------
 .../ethernet/mellanox/mlxsw/spectrum_trap.c   | 111 +++++++++++-
 .../drivers/net/mlxsw/tc_restrictions.sh      |   4 +-
 .../selftests/drivers/net/mlxsw/tc_sample.sh  | 135 ++++++++++++++
 12 files changed, 808 insertions(+), 79 deletions(-)

-- 
2.29.2


             reply	other threads:[~2021-03-16 15:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 15:02 Ido Schimmel [this message]
2021-03-16 15:02 ` [PATCH net-next 01/10] mlxsw: spectrum_matchall: Propagate extack further Ido Schimmel
2021-03-16 15:02 ` [PATCH net-next 02/10] mlxsw: spectrum_matchall: Push sampling checks to per-ASIC operations Ido Schimmel
2021-03-16 15:02 ` [PATCH net-next 03/10] mlxsw: spectrum_matchall: Pass matchall entry to sampling operations Ido Schimmel
2021-03-16 15:02 ` [PATCH net-next 04/10] mlxsw: spectrum: Track sampling triggers in a hash table Ido Schimmel
2021-03-16 15:02 ` [PATCH net-next 05/10] mlxsw: spectrum: Start using sampling triggers " Ido Schimmel
2021-03-16 15:02 ` [PATCH net-next 06/10] mlxsw: spectrum_matchall: Add support for egress sampling Ido Schimmel
2021-03-16 15:03 ` [PATCH net-next 07/10] mlxsw: core_acl_flex_actions: Add mirror sampler action Ido Schimmel
2021-03-16 15:03 ` [PATCH net-next 08/10] mlxsw: spectrum_acl: Offload FLOW_ACTION_SAMPLE Ido Schimmel
2021-03-16 15:03 ` [PATCH net-next 09/10] selftests: mlxsw: Add tc sample tests for new triggers Ido Schimmel
2021-03-16 15:03 ` [PATCH net-next 10/10] selftests: mlxsw: Test egress sampling limitation on Spectrum-1 only Ido Schimmel
2021-03-16 22:21 ` [PATCH net-next 00/10] mlxsw: Add support for egress and policy-based sampling Jakub Kicinski
2021-03-16 22:40 ` patchwork-bot+netdevbpf

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=20210316150303.2868588-1-idosch@idosch.org \
    --to=idosch@idosch.org \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=neil.mckee@inmon.com \
    --cc=netdev@vger.kernel.org \
    --cc=peter.phaal@inmon.com \
    --cc=roopa@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.