2012年1月16日月曜日

ethtool LINX コマンドでNICのドライバを調べる

ethtool LINX コマンドでNICのドライバを調べるとき
記述のethtoolというLINX コマンドを打つ。
※気をつけないと色々設定できてしまうLINX コマンドなんで
注意が必要
#ethtool -i eth0
オプションiでNICのドライバのバージョンを表示できる
eth0はeth1ならeth1を設定。
家だと

[root@localhost sbin]# /sbin/ethtool -i eth0
driver: e1000
version: 7.3.21-k4-2-NAPI
firmware-version: N/A
bus-info: 0000:00:03.0
[root@localhost sbin]#
と出た。
えーと、REALTECなんですが。

7.3.21-k4-2-NAPIで検索すると
----------------------------
ethtoolのオプション色々できてこええ


ethtool DEVNAME Display standard information about device
         ethtool -s|--change DEVNAME    Change generic options
                [ speed 10|100|1000|2500|10000 ]
                [ duplex half|full ]
                [ port tp|aui|bnc|mii|fibre ]
                [ autoneg on|off ]
                [ advertise %%x ]
                [ phyad %%d ]
                [ xcvr internal|external ]
                [ wol p|u|m|b|a|g|s|d... ]
                [ sopass %%x:%%x:%%x:%%x:%%x:%%x ]
                [ msglvl %%d ]
         ethtool -a|--show-pause DEVNAME        Show pause options
         ethtool -A|--pause DEVNAME     Set pause options
                [ autoneg on|off ]
                [ rx on|off ]
                [ tx on|off ]
         ethtool -c|--show-coalesce DEVNAME     Show coalesce options
         ethtool -C|--coalesce DEVNAME  Set coalesce options
                [adaptive-rx on|off]
                [adaptive-tx on|off]
                [rx-usecs N]
                [rx-frames N]
                [rx-usecs-irq N]
                [rx-frames-irq N]
                [tx-usecs N]
                [tx-frames N]
                [tx-usecs-irq N]
                [tx-frames-irq N]
                [stats-block-usecs N]
                [pkt-rate-low N]
                [rx-usecs-low N]
                [rx-frames-low N]
                [tx-usecs-low N]
                [tx-frames-low N]
                [pkt-rate-high N]
                [rx-usecs-high N]
                [rx-frames-high N]
                [tx-usecs-high N]
                [tx-frames-high N]
                [sample-interval N]
         ethtool -g|--show-ring DEVNAME Query RX/TX ring parameters
         ethtool -G|--set-ring DEVNAME  Set RX/TX ring parameters
                [ rx N ]
                [ rx-mini N ]
                [ rx-jumbo N ]
                [ tx N ]
         ethtool -k|--show-offload DEVNAME      Get protocol offload information
         ethtool -K|--offload DEVNAME   Set protocol offload
                [ rx on|off ]
                [ tx on|off ]
                [ sg on|off ]
                [ tso on|off ]
                [ ufo on|off ]
                [ gso on|off ]
                [ gro on|off ]
         ethtool -i|--driver DEVNAME    Show driver information
         ethtool -d|--register-dump DEVNAME     Do a register dump
                [ raw on|off ]
                [ file FILENAME ]
         ethtool -e|--eeprom-dump DEVNAME       Do a EEPROM dump
                [ raw on|off ]
                [ offset N ]
                [ length N ]
         ethtool -E|--change-eeprom DEVNAME     Change bytes in device EEPROM
                [ magic N ]
                [ offset N ]
                [ value N ]
         ethtool -r|--negotiate DEVNAME Restart N-WAY negotation
         ethtool -p|--identify DEVNAME  Show visible port identification (e.g. blinking)
               [ TIME-IN-SECONDS ]
         ethtool -t|--test DEVNAME      Execute adapter self test
               [ online | offline ]
         ethtool -S|--statistics DEVNAME        Show adapter statistics
         ethtool -h|--help              Show this help
[root@localhost sbin]# /sbin/ethtool -i eth0
driver: e1000
version: 7.3.21-k4-2-NAPI
firmware-version: N/A
bus-info: 0000:00:03.0
[root@localhost sbin]# /sbin/ethtool -t eth0
The test result is FAIL
The test extra info:
Register test  (offline)         40
Eeprom test    (offline)         0
Interrupt test (offline)         4
Loopback test  (offline)         13
Link test   (on/offline)         0

[root@localhost sbin]#

----------------------------
さしずめできたのがt=>テスト


[root@localhost sbin]# /sbin/ethtool -t eth0
The test result is FAIL
The test extra info:
Register test  (offline)         40
Eeprom test    (offline)         0
Interrupt test (offline)         4
Loopback test  (offline)         13
Link test   (on/offline)         0


てか仮想NIC失敗とかwファイルシステムだし所詮。。

あとp指定番号のポートが点等する
# /sbin/ethtool -p eth0
て、仮想だから点等するわけねぇw

でも使えそう。。

 /sbin/ethtool -S eth0

大文字S
状態やね

[root@localhost sbin]# /sbin/ethtool -S eth0
NIC statistics:
     rx_packets: 5488
     tx_packets: 4766
     rx_bytes: 501310
     tx_bytes: 668400
     rx_broadcast: 187
     tx_broadcast: 72
     rx_multicast: 2
     tx_multicast: 187
     rx_errors: 0
     tx_errors: 0
     tx_dropped: 0
     multicast: 2
     collisions: 0
     rx_length_errors: 0
     rx_over_errors: 0
     rx_crc_errors: 0
     rx_frame_errors: 0
     rx_no_buffer_count: 0
     rx_missed_errors: 0
     tx_aborted_errors: 0
     tx_carrier_errors: 0
     tx_fifo_errors: 0
     tx_heartbeat_errors: 0
     tx_window_errors: 0
     tx_abort_late_coll: 0
     tx_deferred_ok: 0
     tx_single_coll_ok: 0
     tx_multi_coll_ok: 0
     tx_timeout_count: 0
     tx_restart_queue: 0
     rx_long_length_errors: 0
     rx_short_length_errors: 0
     rx_align_errors: 0
     tx_tcp_seg_good: 0
     tx_tcp_seg_failed: 0
     rx_flow_control_xon: 0
     rx_flow_control_xoff: 0
     tx_flow_control_xon: 0
     tx_flow_control_xoff: 0
     rx_long_byte_count: 501310
     rx_csum_offload_good: 0
     rx_csum_offload_errors: 0
     rx_header_split: 0
     alloc_rx_buff_failed: 0
     tx_smbus: 0
     rx_smbus: 0
     dropped_smbus: 0


なんだかんだドライバ、ファームウェアバージョンのiもつかえると思う
[root@localhost sbin]# /sbin/ethtool -i eth0
driver: e1000
version: 7.3.21-k4-2-NAPI
firmware-version: N/A
bus-info: 0000:00:03.0

でも基本はオプションなしの内容、これ結線状態までわかるのが
すげえ

[root@localhost sbin]# /sbin/ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: umbg
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes(ここが結線状態)
[root@localhost sbin]#

0 件のコメント:

コメントを投稿