• Vadim Pasternak's avatar
    mlxsw: core_env: Add interfaces for line card initialization and de-initialization · 06a0fc43
    Vadim Pasternak authored
    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: default avatarVadim Pasternak <vadimp@nvidia.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    06a0fc43
core_env.c 40.6 KB