Skip to content

mlxsw: L3 HW stats improvements

Ido Schimmel netdev 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 0 repliesApplied 11/11

Patches in v1 All 11 applied

#Subject and filesSizeRepliesApplied
1/11mlxsw: Trap ARP packets at layer 3 instead of layer 2drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c drivers/net/ethernet/mellanox/mlxsw/trap.h+6 -60 repliesApplied
2/11mlxsw: Keep track of number of allocated RIFsdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h+7 -00 repliesApplied
3/11mlxsw: Add a resource describing number of RIFsdrivers/net/ethernet/mellanox/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+42 -00 repliesApplied
4/11selftests: mirror_gre_bridge_1q_lag: Enslave port to bridge before other configurationstools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh+4 -30 repliesApplied
5/11selftests: mlxsw: resource_scale: Update scale target after test setuptools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh+6 -00 repliesApplied
6/11selftests: mlxsw: resource_scale: Introduce traffic teststools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh+20 -30 repliesApplied
7/11selftests: mlxsw: resource_scale: Allow skipping a testtools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh+9 -00 repliesApplied
8/11selftests: mlxsw: resource_scale: Pass target count to cleanuptools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh+2 -20 repliesApplied
9/11selftests: mlxsw: tc_flower_scale: Add a traffic testtools/testing/selftests/drivers/net/mlxsw/tc_flower_scale.sh+17 -00 repliesApplied
10/11selftests: mlxsw: Add a RIF counter scale testtools/testing/selftests/drivers/net/mlxsw/rif_counter_scale.sh tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh tools/testing/selftests/drivers/net/mlxsw/spectrum-2/rif_counter_scale.sh +2 more+162 -20 repliesApplied
11/11selftests: spectrum-2: tc_flower_scale: Dynamically set scale targettools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower_scale.sh+10 -50 repliesApplied

Reviews trailers per patch

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

PatchPetr MachataAmit Cohen
1/11R-b
2/11R-b
3/11R-b
4/11R-b
5/11R-b
6/11R-b
7/11R-b
8/11R-b
9/11R-b
10/11R-b
11/11R-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/11] mlxsw: L3 HW stats improvements

While testing L3 HW stats [1] on top of mlxsw, two issues were found:

1. Stats cannot be enabled for more than 205 netdevs. This was fixed in commit 4b7a632ac4e7 ("mlxsw: spectrum_cnt: Reorder counter pools").

2. ARP packets are counted as errors. Patch #1 takes care of that. See the commit message for details.

The goal of the majority of the rest of the patches is to add selftests that would have discovered that only about 205 netdevs can have L3 HW stats supported, despite the HW supporting much more. The obvious place to plug this in is the scale test framework.

The scale tests are currently testing two things: that some number of instances of a given resource can actually be created; and that when an attempt is made to create more than the supported amount, the failures are noted and handled gracefully.

However the ability to allocate the resource does not mean that the resource actually works when passing traffic. For that, make it possible for a given scale to also test traffic.

To that end, this patchset adds traffic tests. The goal of these is to run traffic and observe whether a sample of the allocated resource instances actually perform their task. Traffic tests are only run on the positive leg of the scale test (no point trying to pass traffic when the expected outcome is that the resource will not be allocated). They are opt-in, if a given test does not expose it, it is not run.

The patchset proceeds as follows:

- Patches #2 and #3 add to "devlink resource" support for number of allocated RIFs, and the capacity. This is necessary, because when evaluating how many L3 HW stats instances it should be possible to allocate, the limiting resource on Spectrum-2 and above currently is not the counters themselves, but actually the RIFs.

- Patch #6 adds support for invocation of a traffic test, if a given scale tests exposes it.

- Patch #7 adds support for skipping a given scale test. Because on Spectrum-2 and above, the limiting factor to L3 HW stats instances is actually the number of RIFs, there is no point in running the failing leg of a scale tests, because it would test exhaustion of RIFs, not of RIF counters.

- With patch #8, the scale tests drivers pass the target number to the cleanup function of a scale test.

- In patch #9, add a traffic test to the tc_flower selftests. This makes sure that the flow counters installed with the ACLs actually do count as they are supposed to.

- In patch #10, add a new scale selftest for RIF counter scale, including a traffic test.

- In patch #11, the scale target for the tc_flower selftest is dynamically set instead of being hard coded.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ca0a53dcec9495d1dc5bbc369c810c520d728373

Amit Cohen (2):
mlxsw: Trap ARP packets at layer 3 instead of layer 2
selftests: mirror_gre_bridge_1q_lag: Enslave port to bridge before
other configurations

Ido Schimmel (2):
selftests: mlxsw: resource_scale: Update scale target after test setup
selftests: spectrum-2: tc_flower_scale: Dynamically set scale target

Petr Machata (7):
mlxsw: Keep track of number of allocated RIFs
mlxsw: Add a resource describing number of RIFs
selftests: mlxsw: resource_scale: Introduce traffic tests
selftests: mlxsw: resource_scale: Allow skipping a test
selftests: mlxsw: resource_scale: Pass target count to cleanup
selftests: mlxsw: tc_flower_scale: Add a traffic test
selftests: mlxsw: Add a RIF counter scale test

 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  29 +++++
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |   1 +
 .../ethernet/mellanox/mlxsw/spectrum_router.c |  18 +++
 .../ethernet/mellanox/mlxsw/spectrum_router.h |   1 +
 .../ethernet/mellanox/mlxsw/spectrum_trap.c   |   8 +-
 drivers/net/ethernet/mellanox/mlxsw/trap.h    |   4 +-
 .../drivers/net/mlxsw/rif_counter_scale.sh    | 107 ++++++++++++++++++
 .../net/mlxsw/spectrum-2/resource_scale.sh    |  31 ++++-
 .../net/mlxsw/spectrum-2/rif_counter_scale.sh |   1 +
 .../net/mlxsw/spectrum-2/tc_flower_scale.sh   |  15 ++-
 .../net/mlxsw/spectrum/resource_scale.sh      |  29 ++++-
 .../net/mlxsw/spectrum/rif_counter_scale.sh   |  34 ++++++
 .../drivers/net/mlxsw/tc_flower_scale.sh      |  17 +++
 .../forwarding/mirror_gre_bridge_1q_lag.sh    |   7 +-
 14 files changed, 283 insertions(+), 19 deletions(-)
 create mode 100644 tools/testing/selftests/drivers/net/mlxsw/rif_counter_scale.sh
 create mode 120000 tools/testing/selftests/drivers/net/mlxsw/spectrum-2/rif_counter_scale.sh
 create mode 100644 tools/testing/selftests/drivers/net/mlxsw/spectrum/rif_counter_scale.sh
Signature · 1 line
2.36.1