Skip to content

mlxsw: Add support for egress and policy-based sampling

Ido Schimmel netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (refs/heads/master):

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 1 replyApplied 10/10

Patches in v1 All 10 applied

#Subject and filesSizeRepliesApplied
1/10mlxsw: spectrum_matchall: Propagate extack furtherdrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c+43 -220 repliesApplied
2/10mlxsw: spectrum_matchall: Push sampling checks to per-ASIC operationsdrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c+22 -140 repliesApplied
3/10mlxsw: spectrum_matchall: Pass matchall entry to sampling operationsdrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c+22 -140 repliesApplied
4/10mlxsw: spectrum: Track sampling triggers in a hash tabledrivers/net/ethernet/mellanox/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h+178 -00 repliesApplied
5/10mlxsw: spectrum: Start using sampling triggers hash tabledrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c+46 -420 repliesApplied
6/10mlxsw: spectrum_matchall: Add support for egress samplingdrivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c+69 -120 repliesApplied
7/10mlxsw: core_acl_flex_actions: Add mirror sampler actiondrivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.h+142 -00 repliesApplied
8/10mlxsw: spectrum_acl: Offload FLOW_ACTION_SAMPLEdrivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c +2 more+175 -10 repliesApplied
9/10selftests: mlxsw: Add tc sample tests for new triggerstools/testing/selftests/drivers/net/mlxsw/tc_sample.sh+135 -00 repliesApplied
10/10selftests: mlxsw: Test egress sampling limitation on Spectrum-1 onlytools/testing/selftests/drivers/net/mlxsw/tc_restrictions.sh+3 -10 repliesApplied

Reviews trailers per patch

9 of 10 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJiri PirkoJakub Kicinski
SeriesA-b
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10
10/10R-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/10] mlxsw: Add support for egress and policy-based sampling

From: Ido Schimmel <[email protected]>

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(-)
Signature · 1 line
2.29.2