mlxsw: minimal: Extend module to port mapping with slot index
authorVadim Pasternak <vadimp@nvidia.com>
Sun, 21 Aug 2022 16:20:17 +0000 (18:20 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 24 Aug 2022 00:22:00 +0000 (17:22 -0700)
commit01328e23a476a47179b07125eabac439bc1d5fd3
tree75d6677c1f5672020464efc58f3363017d36092d
parent9421c8b89dbbd3b164ac09f84f1bc8e83232ebb4
mlxsw: minimal: Extend module to port mapping with slot index

The interfaces for ports found on line card are created and removed
dynamically after line card is getting active or inactive.

Introduce per line card array with module to port mapping.
For each port get 'slot_index' through PMLP register and set port
mapping for the relevant [slot_index][module] entry.

Split module and port allocation into separate routines.

Split per line card port creation and removing into separate routines.
Motivation to re-use these routines for line card operations.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/minimal.c