![如果以太网接口具备千兆速度,为什么它不宣传呢?](https://linux22.com/image/1343945/%E5%A6%82%E6%9E%9C%E4%BB%A5%E5%A4%AA%E7%BD%91%E6%8E%A5%E5%8F%A3%E5%85%B7%E5%A4%87%E5%8D%83%E5%85%86%E9%80%9F%E5%BA%A6%EF%BC%8C%E4%B8%BA%E4%BB%80%E4%B9%88%E5%AE%83%E4%B8%8D%E5%AE%A3%E4%BC%A0%E5%91%A2%EF%BC%9F.png)
我有一台配有千兆以太网接口的笔记本电脑:
# lspci -vvnn -s 08:02.0
08:02.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 64 (8000ns min, 16000ns max), Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 20
Region 0: I/O ports at b800 [size=256]
Region 1: Memory at feafe400 (32-bit, non-prefetchable) [size=256]
Expansion ROM at feac0000 [disabled] [size=128K]
Capabilities: [dc] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: r8169
我正尝试使用 Cat 6(千兆)电缆将其连接到支持千兆位的路由器,以便在 LAN 内进行千兆位通信。问题是我的笔记本电脑上的接口没有像以前那样提供千兆位链接速度:
# mii-tool -v
eth0: negotiated 100baseTx-FD flow-control, link ok
product info: vendor 00:07:32, model 17 rev 2
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
造成这种情况的原因是什么?
答案1
就我而言,原因很明显,但我仍然搜索了很长时间才找到原因。电缆不支持千兆位(即电缆中实际上只有 8 根电线中的 4 根)。更换电缆解决了这个问题。
绝对需要检查前调查复杂的软件参数:)
答案2
ethtool
嗯,我在我的一个界面上遇到了同样的问题。和的输出mii-tool
有点不同,如下所示。
mii-tool -v
告诉我们:
eth0: negotiated 100baseTx-FD flow-control, link ok
product info: vendor 00:07:32, model 17 rev 2
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
这似乎意味着我们并没有宣传 1000BaseT-HD/FD。
但是如果你看一下输出,ethtool
你会看到以下内容:
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
Link detected: yes
这实际上告诉我们,是链接伙伴没有宣传 1000BaseT-HD/FD 模式。我还没有弄清楚,但它可能也解释了你看到的情况。
答案3
mii-tool --advertise=...
它可能已被手动禁用。可以使用或更改所宣传的媒体ethtool -s eth0 advertise ...
。