Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mii-tool]Can't change mode! #15

Open
jiangqii opened this issue Mar 2, 2020 · 3 comments
Open

[mii-tool]Can't change mode! #15

jiangqii opened this issue Mar 2, 2020 · 3 comments

Comments

@jiangqii
Copy link

jiangqii commented Mar 2, 2020

Enviroment:

  • mii-tool
# mii-tool -V
net-tools 2.10-alpha
David Hinds based on Donald Becker's mii-diag
  • nic
0001:2c:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 128 bytes
        Interrupt: pin D routed to IRQ 277
        NUMA node: 0
        Region 0: Memory at f0e1c60000 (32-bit, non-prefetchable) [size=128K]
        Region 2: I/O ports at f600003060 [disabled] [size=32]
        Region 3: Memory at f0e1c8c000 (32-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: igb
  • kernel
    4.19.8
  • modules
Module                  Size  Used by
mii                     9065  0
ntfs                  272491  0
ipv6                  494101  48
megaraid_sas          171353  0

Whether mii exists or not, the result is the same.
phenomenon

# mii-tool -v enP1p44s0f3
enP1p44s0f3: negotiated, link ok
  product info: vendor 00:55:00, model 59 rev 1
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  flow-control
  link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

# mii-tool -F 100baseTx-HD enP1p44s0f3 
SIOCSMIIREG on enP1p44s0f3 failed: Operation not supported

##############################################################
# ethtool enP1p44s0f3
Settings for enP1p44s0f3:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: off (auto)
Cannot get wake-on-lan settings: Operation not permitted
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

# ethtool -s enP1p44s0f3 autoneg off speed 100 duplex half
# ethtool enP1p44s0f3
Settings for enP1p44s0f3:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Full 
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  Not reported
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 100Mb/s
        Duplex: Half
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: off
        MDI-X: off (auto)
Cannot get wake-on-lan settings: Operation not permitted
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

my opinion

  • Is it a problem with the mii module? Because mii is not loaded after igb is loaded
  • Problems with the software itself (if there is no mii module)

man page

DIAGNOSTICS
       SIOCGMIIPHY on 'eth?' failed: Operation not supported
              The interface in question does not support MII queries. Most likely, it does not have MII transceivers, at all.

And It seem that NIC supported.
image

@jiangqii jiangqii changed the title Can't change mode! [mii-tool]Can't change mode! Mar 2, 2020
@ecki
Copy link
Owner

ecki commented Mar 2, 2020

Is ethtool working or not? (I.e. is it communicating?), not sure from the output.

Can you also write two strace files of the two tools?

@jiangqii
Copy link
Author

jiangqii commented Mar 2, 2020

mii-tool

# strace mii-tool -F 100baseTx-HD enP1p44s0f3
execve("/sbin/mii-tool", ["mii-tool", "-F", "100baseTx-HD", "enP1p44s0f3"], 0x11f914228 /* 17 vars */) = 0
brk(NULL)                               = 0x122010000
uname({sysname="Linux", nodename="deepin-PC", ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x20009df0000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (没有那个文件或目录)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=75065, ...}) = 0
mmap(NULL, 75065, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2000009a000
close(3)                                = 0
open("/lib/libc.so.6.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\26\231\1\0\0\0@\307\2\0\0\0\0\0"..., 832) = 832
fstat64(3, {st_mode=S_IFREG|0755, st_size=1903016, ...}) = 0
mmap(NULL, 1976704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x20007b70000
mprotect(0x20007d36000, 65536, PROT_NONE) = 0
mmap(0x20007d46000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c6000) = 0x20007d46000
mmap(0x20007d50000, 10624, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x20007d50000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2000be80000
mprotect(0x20007d46000, 16384, PROT_READ) = 0
mprotect(0x120014000, 8192, PROT_READ)  = 0
mprotect(0x2000f060000, 8192, PROT_READ) = 0
munmap(0x2000009a000, 75065)            = 0
socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
ioctl(3, SIOCGMIIPHY, 0x120016428)      = 0
ioctl(3, SIOCSMIIREG, 0x120016428)      = -1 EOPNOTSUPP (不支持的操作)
write(2, "SIOCSMIIREG on enP1p44s0f3 faile"..., 59SIOCSMIIREG on enP1p44s0f3 failed: Operation not supported
) = 59
close(3)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++

ethtool

# strace ethtool -s enP1p44s0f3 speed 100 duplex half autoneg off
execve("/sbin/ethtool", ["ethtool", "-s", "enP1p44s0f3", "speed", "100", "duplex", "half", "autoneg", "off"], 0x11fd86210 /* 17 vars */) = 0
brk(NULL)                               = 0x12069a000
uname({sysname="Linux", nodename="deepin-PC", ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x20003cb4000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (没有那个文件或目录)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=75065, ...}) = 0
mmap(NULL, 75065, PROT_READ, MAP_PRIVATE, 3, 0) = 0x20002668000
close(3)                                = 0
open("/lib/libm.so.6.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\26\231\1\0\0\0\360\217\0\0\0\0\0\0"..., 832) = 832
fstat64(3, {st_mode=S_IFREG|0755, st_size=1341592, ...}) = 0
mmap(NULL, 1404848, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2000ea60000
mprotect(0x2000eba0000, 57344, PROT_NONE) = 0
mmap(0x2000ebae000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13e000) = 0x2000ebae000
close(3)                                = 0
open("/lib/libc.so.6.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\26\231\1\0\0\0@\307\2\0\0\0\0\0"..., 832) = 832
fstat64(3, {st_mode=S_IFREG|0755, st_size=1903016, ...}) = 0
mmap(NULL, 1976704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2000ebb8000
mprotect(0x2000ed7e000, 65536, PROT_NONE) = 0
mmap(0x2000ed8e000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c6000) = 0x2000ed8e000
mmap(0x2000ed98000, 10624, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2000ed98000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x20009db4000
mprotect(0x2000ed8e000, 16384, PROT_READ) = 0
mprotect(0x2000ebae000, 8192, PROT_READ) = 0
mprotect(0x120066000, 8192, PROT_READ)  = 0
mprotect(0x20005764000, 8192, PROT_READ) = 0
munmap(0x20002668000, 75065)            = 0
socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
ioctl(3, SIOCETHTOOL, 0x11fb88050)      = 0
ioctl(3, SIOCETHTOOL, 0x11fb88050)      = 0
brk(NULL)                               = 0x12069a000
brk(0x1206bc000)                        = 0x1206bc000
ioctl(3, SIOCETHTOOL, 0x11fb88050)      = 0
exit_group(0)                           = ?
+++ exited with 0 +++

ethtool can work.I use ping.

@ecki
Copy link
Owner

ecki commented Jan 7, 2021

Hm yeah looks like it only supports the SIOCETHTOOL but not the SIOCSMIIREG ioctl, that could be expected, I am not sure how the current strategy of driver makers is in this regard. mii-tool might be deprecated for a reason. We probably could add a fallback on ENOTSUPP - not sure how compatible the parameter logic is. Anybody tried this? (there is no change for this in 2.10 AFAIK).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants