Subject: [PATCH net-next 0/8] mlxsw: Introduce modular system support by minimal driver

From: Petr Machata <[email-masked]>
Date: Sun, 21 Aug 2022 18:20:10 +0200

Vadim Pasternak writes:

This patchset adds line cards support in mlxsw_minimal, which is used
for monitoring purposes on BMC systems. The BMC is connected to the
ASIC over I2C bus, unlike the host CPU that is connected to the ASIC
via PCI bus.

The BMC system needs to be notified whenever line cards become active
or inactive, so that, for example, netdevs will be registered /
unregistered by mlxsw_minimal. However, traps cannot be generated
towards the BMC over the I2C bus. To overcome that, the I2C bus driver
(i.e., mlxsw_i2c) registers an handler for an IRQ that is fired upon
specific system wide changes, like line card activation and
deactivation.

The generated event is handled by mlxsw_core, which checks whether
anything changed in the state of available line cards. If a line card
becomes active or inactive, interested parties such as mlxsw_minimal
are notified via their registered line card event callback.

Patch set overview:

Patches #1 is preparations.

Patches #2-#3 extend mlxsw_core with an infrastructure to handle the
	previously mentioned system events.

Patch #4 extends the I2C bus driver to register an handler for the IRQ
	fired upon specific system wide changes.

Patches #5-#8 gradually add line cards support in mlxsw_minimal by
	dynamically registering / unregistering netdevs for ports found on
	line cards, whenever a line card becomes active / inactive.

Vadim Pasternak (8):
  mlxsw: core_linecards: Separate line card init and fini flow
  mlxsw: core: Add registration APIs for system event handler
  mlxsw: core_linecards: Register a system event handler
  mlxsw: i2c: Add support for system interrupt handling
  mlxsw: minimal: Extend APIs with slot index for modular system support
  mlxsw: minimal: Move ports allocation to separate routine
  mlxsw: minimal: Extend module to port mapping with slot index
  mlxsw: minimal: Extend to support line card dynamic operations

 drivers/net/ethernet/mellanox/mlxsw/core.c    |  68 ++++
 drivers/net/ethernet/mellanox/mlxsw/core.h    |   8 +
 .../ethernet/mellanox/mlxsw/core_linecards.c  | 100 +++--
 drivers/net/ethernet/mellanox/mlxsw/i2c.c     |  87 +++-
 drivers/net/ethernet/mellanox/mlxsw/minimal.c | 381 ++++++++++++++----
 5 files changed, 552 insertions(+), 92 deletions(-)

-- 
2.35.3