]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit7cdf2a400ddb11c1016fc961a08d13961c7d8446
tree75d6677c1f5672020464efc58f3363017d36092d
parenta7166d7a5383acca4012160efd4f1f55c9dde6e2
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