• Guangbin Huang's avatar
    net: hns3: fix pause config problem after autoneg disabled · 3bda2e5d
    Guangbin Huang authored
    If a TP port is configured by follow steps:
    1.ethtool -s ethx autoneg off speed 100 duplex full
    2.ethtool -A ethx rx on tx on
    3.ethtool -s ethx autoneg on(rx&tx negotiated pause results are off)
    4.ethtool -s ethx autoneg off speed 100 duplex full
    
    In step 3, driver will set rx&tx pause parameters of hardware to off as
    pause parameters negotiated with link partner are off.
    
    After step 4, the "ethtool -a ethx" command shows both rx and tx pause
    parameters are on. However, pause parameters of hardware are still off
    and port has no flow control function actually.
    
    To fix this problem, if autoneg is disabled, driver uses its saved
    parameters to restore pause of hardware. If the speed is not changed in
    this case, there is no link state changed for phy, it will cause the pause
    parameter is not taken effect, so we need to force phy to go down and up.
    
    Fixes: aacbe27e ("net: hns3: modify how pause options is displayed")
    Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    3bda2e5d
hclge_tm.h 6.46 KB