• Amit Cohen's avatar
    mlxsw: Only advertise link modes supported by both driver and device · 1601559b
    Amit Cohen authored
    During port creation the driver instructs the device to advertise all
    the supported link modes queried from the device.
    
    Since cited commit not all the link modes supported by the device are
    supported by the driver. This can result in the device negotiating a
    link mode that is not recognized by the driver causing ethtool to show
    an unsupported speed:
    
    $ ethtool swp1
    ...
    Speed: Unknown!
    
    This is especially problematic when the netdev is enslaved to a bond, as
    the bond driver uses unknown speed as an indication that the link is
    down:
    
    [13048.900895] net_ratelimit: 86 callbacks suppressed
    [13048.900902] t_bond0: (slave swp52): failed to get link speed/duplex
    [13048.912160] t_bond0: (slave swp49): failed to get link speed/duplex
    
    Fix this by making sure that only link modes that are supported by both
    the device and the driver are advertised.
    
    Fixes: b97cd891 ("mlxsw: Remove 56G speed support")
    Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    1601559b
spectrum.h 44.3 KB