]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: core_env: Add interfaces for line card initialization and de-initialization
authorVadim Pasternak <vadimp@nvidia.com>
Tue, 19 Apr 2022 14:54:29 +0000 (17:54 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Apr 2022 14:03:21 +0000 (15:03 +0100)
commit16a1bde0e43030443124b203b7713427dc6431e2
treefb6fd52c5f6ea8f5e8ac1699585778a526e12992
parent57d74007e141943c9ac5a4b88fcd79cb8223d8d6
mlxsw: core_env: Add interfaces for line card initialization and de-initialization

Netdevs for ports found on line cards are registered upon provisioning.
However, user space is not allowed to access the transceiver modules
found on a line card until the line card becomes active.

Therefore, register event operations with the line card core to get
notifications whenever a line card becomes active or inactive.

When user space tries to dump the EEPROM of a transceiver module or reset
it and the corresponding line card is inactive, emit an error
message:
ethtool -m enp1s0nl7p9
netlink error: mlxsw_core: Cannot read EEPROM of module on an inactive line card
netlink error: Input/output error

When user space tries to set the power mode policy of such a transceiver,
cache the configuration and apply it when the line card becomes active. This
is consistent with other port configuration (e.g., MTU setting) that user space
is able to perform while the line card is provisioned, but inactive.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_env.c