[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: net-tools future



On Sun, 15 Mar 2009, Martín Ferrari wrote:
>  * mii-tool: it could be dropped and replaced by a pointer to ethtool as
> it's not meant to be used automatically by scripts. On the other hand,

mii-tool behaviour when you call it without parameters is *extremely* useful
to locate which cable goes where.  ethtool is quite cubersome for this.  In
fact, it is downright ill-suited for this kind of use.

Compare:

# mii-tool 
eth0: negotiated 100baseTx-FD flow-control, link ok
eth1: no link

with:

# ip link | sed -ne '/^[0-9]\+:/ {s/.*:\(.*\): [<].*/\1/ p}' | xargs -n1 -r ethtool | grep -E '(Settings)|(Link)|(Speed)|(Duplex)'
Settings for lo:
        Link detected: yes
Settings for eth1:
        Speed: Unknown! (65535)
        Duplex: Unknown! (255)
        Link detected: no
Settings for eth0:
        Speed: 100Mb/s
        Duplex: Full
        Link detected: yes

So, ethtool really needs to grow an option to iterate over all netdevs, and
another one to print a summary of link state and speed,duplex before
mii-tool could be dropped.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh


Reply to: