无法通过 ethtool 禁用自动协商

无法通过 ethtool 禁用自动协商

我想禁用auto-negotiationNIC 的功能,我运行以下命令

$sudo ethtool -s ens1f0 speed 10000 duplex full autoneg off

然后我通过以下方式检查它是否生效ethtool ens1f0

Settings for ens1f0:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full
                                10000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

autoneg亮着,为什么不起作用?

更新 2020/8/22

我的网卡是82599ES 10-Gigabit SFI/SFP+ Network Connection 10fb,我发现10GBASE-T 链路的auto-neg功能在某些情况下可能会关闭。

  1. 一个网卡的两个端口状态不一样,很奇怪,autoneg我真的很困惑。
Settings for ens1f0:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full
                                10000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
                                10000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

Settings for ens1f1:
        Supported ports: [ FIBRE ]
        Supported link modes:   10000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
Cannot get wake-on-lan settings: Operation not permitted
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes
  1. 当端口没有与对端建立连接时,该autoneg端口关闭
Settings for ens1f1:
        Supported ports: [ FIBRE ]
        Supported link modes:   10000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: Other
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
Cannot get wake-on-lan settings: Operation not permitted
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: no

答案1

无法禁用 10GBASE-T 链路上的自动协商。802.3 标准规定自动协商是强制性的此类链接。部分原因包括:

55.6.1 支持自动协商

所有 10GBASE-T PHY 均应支持自动协商(第 28 条),并应能够作为主设备或从设备运行。所有 10GBASE-T PHY 均应支持 28.2.3.4.2 中定义的扩展下一页,并应支持和使用 28.2.1.1.1 中定义的优化 FLP 突发到 FLP 突发时序,以及 28.3.2 中定义的 nlp_link_test_min_timer 和 link_fail_inhibit_timer。

自动协商是链路初始设置的一部分,允许两端的 PHY 通告其功能(速度、PHY 类型、半双工或全双工)并自动选择链路上的通信操作模式。自动协商信号主要用于 10GBASE-T 的以下主要目的:

  • 协商PHY是否能够支持10GBASE-T传输。
  • 确定链路两端PHY之间的主从关系。
  • 确定本地PHY是否执行PMA训练模式重置。
  • 确定本地PHY是否支持EEE功能。
  • 确定本地PHY是否支持快速重训练功能。

相关内容