[ale] ethtool and mii-tool disagree

Christopher Fowler cfowler at outpostsentinel.com
Sat Dec 9 21:00:56 EST 2006


My guess is driver issue.  Each use a different ioctl() to obtain the
same info.

On Sat, 2006-12-09 at 19:49 -0500, Jeff Lightner wrote:
> strace ethtool eth0
> 
> execve("/sbin/ethtool", ["ethtool", "eth0"], [/* 27 vars */]) = 0
> 
> uname({sys="Linux", node="atltst01.dsw.net", ...}) = 0
> 
> brk(0)                                  = 0x87cb000
> 
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
> directory)
> 
> open("/etc/ld.so.cache", O_RDONLY)      = 3
> 
> fstat64(3, {st_mode=S_IFREG|0644, st_size=123603, ...}) = 0
> 
> old_mmap(NULL, 123603, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f21000
> 
> close(3)                                = 0
> 
> open("/lib/tls/libc.so.6", O_RDONLY)    = 3
> 
> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\177"...,
> 512) = 512
> 
> fstat64(3, {st_mode=S_IFREG|0755, st_size=1454546, ...}) = 0
> 
> old_mmap(0x2d3000, 1219772, PROT_READ|PROT_EXEC, MAP_PRIVATE|
> MAP_DENYWRITE, 3, 0) = 0x2d3000
> 
> old_mmap(0x3f7000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
> MAP_DENYWRITE, 3, 0x124000) = 0x3f7000
> 
> old_mmap(0x3fb000, 7356, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
> MAP_ANONYMOUS, -1, 0) = 0x3fb000
> 
> close(3)                                = 0
> 
> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
> -1, 0) = 0xb7f20000
> 
> mprotect(0x3f7000, 4096, PROT_READ)     = 0
> 
> mprotect(0x2cb000, 4096, PROT_READ)     = 0
> 
> set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f20940,
> limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
> limit_in_pages:1, seg_not_present:0, useable:1}) = 0
> 
> munmap(0xb7f21000, 123603)              = 0
> 
> socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
> 
> fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
> 
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
> 0) = 0xb7f3f000
> 
> write(1, "Settings for eth0:\n", 19Settings for eth0:
> 
> )    = 19
> 
> ioctl(3, SIOCETHTOOL, 0xbff0e7c0)       = 0
> 
> write(1, "\tSupported ports: [ MII ]\n", 26     Supported ports:
> [ MII ]
> 
> ) = 26
> 
> write(1, "\tSupported link modes:   10baseT"..., 52     Supported link
> modes:   10baseT/Half 10baseT/Full
> 
> ) = 52
> 
> write(1, "\t                        100base"..., 54
> 100baseT/Half 100baseT/Full
> 
> ) = 54
> 
> write(1, "\t                        1000bas"..., 56
> 1000baseT/Half 1000baseT/Full
> 
> ) = 56
> 
> write(1, "\tSupports auto-negotiation: Yes\n", 32       Supports auto-
> negotiation: Yes
> 
> ) = 32
> 
> write(1, "\tAdvertised link modes:  10baseT"..., 52     Advertised
> link modes:  10baseT/Half 10baseT/Full
> 
> ) = 52
> 
> write(1, "\t                        100base"..., 54
> 100baseT/Half 100baseT/Full
> 
> ) = 54
> 
> write(1, "\t                        1000bas"..., 56
> 1000baseT/Half 1000baseT/Full
> 
> ) = 56
> 
> write(1, "\tAdvertised auto-negotiation: Ye"..., 34     Advertised
> auto-negotiation: Yes
> 
> ) = 34
> 
> write(1, "\tSpeed: 100Mb/s\n", 16       Speed: 100Mb/s
> 
> )      = 16
> 
> write(1, "\tDuplex: Half\n", 14 Duplex: Half
> 
> )        = 14
> 
> write(1, "\tPort: Twisted Pair\n", 20   Port: Twisted Pair
> 
> )  = 20
> 
> write(1, "\tPHYAD: 1\n", 10     PHYAD: 1
> 
> )            = 10
> 
> write(1, "\tTransceiver: internal\n", 23        Transceiver: internal
> 
> ) = 23
> 
> write(1, "\tAuto-negotiation: on\n", 22 Auto-negotiation: on
> 
> ) = 22
> 
> ioctl(3, SIOCETHTOOL, 0xbff0e7c0)       = 0
> 
> write(1, "\tSupports Wake-on: g\n", 21  Supports Wake-on: g
> 
> ) = 21
> 
> write(1, "\tWake-on: d\n", 12   Wake-on: d
> 
> )          = 12
> 
> ioctl(3, SIOCETHTOOL, 0xbff0e7c0)       = 0
> 
> write(1, "\tCurrent message level: 0x000000"..., 41     Current
> message level: 0x000000ff (255)
> 
> ) = 41
> 
> ioctl(3, SIOCETHTOOL, 0xbff0e7c0)       = 0
> 
> write(1, "\tLink detected: yes\n", 20   Link detected: yes
> 
> )  = 20
> 
> munmap(0xb7f3f000, 4096)                = 0
> 
> exit_group(0)                           = ?
> 
> Process 7618 detached
> 
>  
> 
>  
> 
> strace mii-tool -v eth0
> 
> execve("/sbin/mii-tool", ["mii-tool", "-v", "eth0"], [/* 27 vars */])
> = 0
> 
> uname({sys="Linux", node="atltst01.dsw.net", ...}) = 0
> 
> brk(0)                                  = 0x82ad000
> 
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
> directory)
> 
> open("/etc/ld.so.cache", O_RDONLY)      = 3
> 
> fstat64(3, {st_mode=S_IFREG|0644, st_size=123603, ...}) = 0
> 
> old_mmap(NULL, 123603, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f35000
> 
> close(3)                                = 0
> 
> open("/lib/tls/libc.so.6", O_RDONLY)    = 3
> 
> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\177"...,
> 512) = 512
> 
> fstat64(3, {st_mode=S_IFREG|0755, st_size=1454546, ...}) = 0
> 
> old_mmap(NULL, 1219772, PROT_READ|PROT_EXEC, MAP_PRIVATE|
> MAP_DENYWRITE, 3, 0) = 0x9ed000
> 
> old_mmap(0xb11000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
> MAP_DENYWRITE, 3, 0x124000) = 0xb11000
> 
> old_mmap(0xb15000, 7356, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
> MAP_ANONYMOUS, -1, 0) = 0xb15000
> 
> close(3)                                = 0
> 
> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
> -1, 0) = 0xb7f34000
> 
> mprotect(0xb11000, 4096, PROT_READ)     = 0
> 
> mprotect(0x20b000, 4096, PROT_READ)     = 0
> 
> set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f34aa0,
> limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
> limit_in_pages:1, seg_not_present:0, useable:1}) = 0
> 
> munmap(0xb7f35000, 123603)              = 0
> 
> socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
> 
> ioctl(3, SIOCGMIIPHY, 0x749a40)         = 0
> 
> ioctl(3, SIOCGMIIREG, 0x749a40)         = 0
> 
> ioctl(3, SIOCGMIIREG, 0x749a40)         = 0
> 
> ioctl(3, SIOCGMIIREG, 0x749a40)         = 0
> 
> ioctl(3, SIOCGMIIREG, 0x749a40)         = 0
> 
> ioctl(3, SIOCGMIIREG, 0x749a40)         = 0
> 
> ioctl(3, SIOCGMIIREG, 0x749a40)         = 0
> 
> ioctl(3, SIOCGMIIREG, 0x749a40)         = 0
> 
> ioctl(3, SIOCGMIIREG, 0x749a40)         = 0
> 
> ioctl(3, SIOCGMIIREG, 0x749a40)         = 0
> 
> fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
> 
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
> 0) = 0xb7f53000
> 
> write(1, "eth0: negotiated 100baseTx-HD, l"..., 39eth0: negotiated
> 100baseTx-HD, link ok
> 
> ) = 39
> 
> write(1, "  product info: vendor 00:08:18,"..., 48  product info:
> vendor 00:08:18, model 26 rev 2
> 
> ) = 48
> 
> write(1, "  basic mode:   autonegotiation "..., 40  basic mode:
> autonegotiation enabled
> 
> ) = 40
> 
> write(1, "  basic status: autonegotiation "..., 50  basic status:
> autonegotiation complete, link ok
> 
> ) = 50
> 
> write(1, "  capabilities: 100baseTx-FD 100"..., 64  capabilities:
> 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
> 
> ) = 64
> 
> write(1, "  advertising:  100baseTx-FD 100"..., 77  advertising:
> 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
> 
> ) = 77
> 
> write(1, "  link partner: 100baseTx-HD\n", 29  link partner:
> 100baseTx-HD
> 
> ) = 29
> 
> close(3)                                = 0
> 
> munmap(0xb7f53000, 4096)                = 0
> 
> exit_group(0)                           = ?
> 
> Process 7627 detached
> 
>  
> 
> -----Original Message-----
> From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of
> Christopher Fowler
> Sent: Saturday, December 09, 2006 7:39 PM
> To: Atlanta Linux Enthusiasts
> Subject: Re: [ale] ethtool and mii-tool disagree
> 
>  
> 
> On Sat, 2006-12-09 at 18:40 -0500, Jeff Lightner wrote:
> 
> > Not the point.  I'm not asking which is right but rather why two
> tools
> 
> > on the same server interrogating the same NIC wouldn't both give the
> 
> > same answer.
> 
>  
> 
> Makes sense.
> 
>  
> 
> I would like to know how they come up with their answer.  Do they use
> 
> ioctl() to get the values?
> 
>  
> 
> What does strace say?
> 
>  
> 
>  
> 
>  
> 
> _______________________________________________
> 
> Ale mailing list
> 
> Ale at ale.org
> 
> http://www.ale.org/mailman/listinfo/ale
> 
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale




More information about the Ale mailing list