mbox series

[net-next,0/2] mlxsw: Expose number of physical ports

Message ID 20210112083931.1662874-1-idosch@idosch.org (mailing list archive)
Headers show
Series mlxsw: Expose number of physical ports | expand

Message

Ido Schimmel Jan. 12, 2021, 8:39 a.m. UTC
From: Ido Schimmel <idosch@nvidia.com>

The switch ASIC has a limited capacity of physical ports that it can
support. While each system is brought up with a different number of
ports, this number can be increased via splitting up to the ASIC's
limit.

Expose physical ports as a devlink resource so that user space will have
visibility into the maximum number of ports that can be supported and
the current occupancy. With this resource it is possible, for example,
to write generic (i.e., not platform dependent) tests for port
splitting.

Patch #1 adds the new resource and patch #2 adds a selftest.

Danielle Ratson (2):
  mlxsw: Register physical ports as a devlink resource
  selftests: mlxsw: Add a scale test for physical ports

 drivers/net/ethernet/mellanox/mlxsw/core.c    | 77 ++++++++++++++++---
 drivers/net/ethernet/mellanox/mlxsw/core.h    |  5 ++
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  2 +-
 .../selftests/drivers/net/mlxsw/port_scale.sh | 64 +++++++++++++++
 .../net/mlxsw/spectrum-2/port_scale.sh        | 16 ++++
 .../net/mlxsw/spectrum-2/resource_scale.sh    |  2 +-
 .../drivers/net/mlxsw/spectrum/port_scale.sh  | 16 ++++
 .../net/mlxsw/spectrum/resource_scale.sh      |  2 +-
 8 files changed, 171 insertions(+), 13 deletions(-)
 create mode 100644 tools/testing/selftests/drivers/net/mlxsw/port_scale.sh
 create mode 100644 tools/testing/selftests/drivers/net/mlxsw/spectrum-2/port_scale.sh
 create mode 100644 tools/testing/selftests/drivers/net/mlxsw/spectrum/port_scale.sh