Changes between Version 2 and Version 3 of ethernet


Ignore:
Timestamp:
07/17/2025 09:34:34 PM (7 weeks ago)
Author:
Tim Harvey
Comment:

moved ethtool details from ventana/ethernet here and removed deprecated mii-tool details

Legend:

Unmodified
Added
Removed
Modified
  • ethernet

    v2 v3  
    6767Also see the Venice Ethernet page: [wiki:venice/ethernet]
    6868
     69
     70[=#ethtool]
     71== ethtool
     72{{{ethtool}}} is the standard Linux tool used to talk to the Ethernet PHY.
     73
     74
     75Examples:
     76 * show PHY details about an interface:
     77{{{
     78#!bash
     79# ethtool eth0
     80Settings for eth0:
     81        Supported ports: [ TP MII ]
     82        Supported link modes:   10baseT/Half 10baseT/Full
     83                                100baseT/Half 100baseT/Full
     84                                1000baseT/Full
     85        Supported pause frame use: Symmetric
     86        Supports auto-negotiation: Yes
     87        Advertised link modes:  10baseT/Half 10baseT/Full
     88                                100baseT/Half 100baseT/Full
     89                                1000baseT/Full
     90        Advertised pause frame use: Symmetric
     91        Advertised auto-negotiation: Yes
     92        Link partner advertised link modes:  10baseT/Half 10baseT/Full
     93                                             100baseT/Half 100baseT/Full
     94                                             1000baseT/Full
     95        Link partner advertised pause frame use: Symmetric Receive-only
     96        Link partner advertised auto-negotiation: Yes
     97        Speed: 1000Mb/s
     98        Duplex: Full
     99        Port: MII
     100        PHYAD: 0
     101        Transceiver: external
     102        Auto-negotiation: on
     103        Supports Wake-on: d
     104        Wake-on: d
     105        Link detected: yes
     106}}}
     107
     108
     109[=#speed]
     110=== Setting the Ethernet Port Speed
     111When using a 4-wire (2-pair) cable suitable for 100BASE-T on a Gigabit interface depending on the PHY and the link partner you may need to force the speed to 100Mbps.
     112
     113For customers who would like to force a specific speed, you can use the following:
     114
     115Examples:
     116 * force 100mbps speed
     117{{{#!bash
     118# ifconfig eth0 down
     119[  261.516832] libphy: 2188000.ethernet:00 - Link is Down
     120# ethtool -s eth0 autoneg off speed 100
     121# ifconfig eth0 up
     122[  265.516787] libphy: 2188000.ethernet:00 - Link is Up - 100/Full
     123}}}
     124
     125[=#duplex]
     126=== Duplex
     127Most Ethernet NICs can be configured to be either full or half duplex. For information on what this means, please see [https://en.wikipedia.org/wiki/Duplex_%28telecommunications%29 this page].
     128
     129You can use {{{ethtool}}} to configure duplex:
     130{{{#!bash
     131# ifconfig eth0 down
     132[  261.516832] libphy: 2188000.ethernet:00 - Link is Down
     133# ethtool -s eth0 autoneg off duplex half
     134# ethtool eth0 | grep Duplex
     135        Duplex: Half
     136}}}
     137
     138[=#flowcontrol]
     139=== Ethernet PAUSE frames for flow control (802.3x)
     140The IEEE 802.3x standard introduced Ethernet PAUSE frames which can be used at the MAC level as a mechanism of flow-control much like that used in UARTs. A transmitter can send a PAUSE frame to a receiver to tell them to stop sending for a specified period of time if they can't keep up with the data flow.
     141
     142This is typically only used if one end of the transmission can't keep up with the line-speed of the medium (ie a board supporting GigE that can't keep up with 1gbps).
     143
     144Because the Fast Ethernet Controller (FEC) integrated into the IMX6 can't perform at 1000mbps the use of PAUSE frames may be desirable in certain cases.
     145
     146Ethernet PAUSE frames are not supported across all the various Gateworks products (in some cases the hardware can't support it, in others the drivers may not support it):
     147 * IMX6 FEC: (used as eth0 on GW51xx/GW52xx/GW53xx/GW54xx/GW55x) supports PAUSE frames (yet tx/rx must be set the same)
     148 * Intel i210: (used on GW5520 and GW16083) supports symmetric PAUSE frames with independent control
     149 * Marvell SKY2: (used as eth1 on GW54xx/GW53xx) supports PAUSE frames but no auto-negotiation
     150
     151Use {{{ethtool}}} to configure:
     152{{{#!bash
     153# Show pause-frame status
     154root@OpenWrt:/# ethtool --show-pause eth0
     155Pause parameters for eth0:
     156Autonegotiate:  on
     157RX:             off
     158TX:             off
     159RX negotiated:  on
     160TX negotiated:  on
     161
     162# Disable pause frame support
     163root@OpenWrt:/# ethtool --pause eth0 autoneg off rx off tx off
     164rx unmodified, ignoring
     165tx unmodified, ignoring
     166root@OpenWrt:/# [   92.519412] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full
     167
     168# Enable pause frame
     169root@OpenWrt:/# ethtool --pause eth0 autoneg on # enable pause frame autoneg
     170root@OpenWrt:/# [  137.518636] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full
     171}}}
     172
     173Notes:
     174 * Note that FEC tx/rx pause frame support must be the same (you can't enable tx and disable rx for example)
     175 * If PAUSE frames are supported by the NIC/driver their default configuration is auto-negotiated.
     176 * If autonegotiation of PAUSE frames is enabled from a disabled state the link will go down and come back up
     177
     178
     179See also:
     180 * https://en.wikipedia.org/wiki/Ethernet_flow_control
     181