| 69 | |
| 70 | [=#ethtool] |
| 71 | == ethtool |
| 72 | {{{ethtool}}} is the standard Linux tool used to talk to the Ethernet PHY. |
| 73 | |
| 74 | |
| 75 | Examples: |
| 76 | * show PHY details about an interface: |
| 77 | {{{ |
| 78 | #!bash |
| 79 | # ethtool eth0 |
| 80 | Settings 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 |
| 111 | When 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 | |
| 113 | For customers who would like to force a specific speed, you can use the following: |
| 114 | |
| 115 | Examples: |
| 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 |
| 127 | Most 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 | |
| 129 | You 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) |
| 140 | The 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 | |
| 142 | This 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 | |
| 144 | Because 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 | |
| 146 | Ethernet 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 | |
| 151 | Use {{{ethtool}}} to configure: |
| 152 | {{{#!bash |
| 153 | # Show pause-frame status |
| 154 | root@OpenWrt:/# ethtool --show-pause eth0 |
| 155 | Pause parameters for eth0: |
| 156 | Autonegotiate: on |
| 157 | RX: off |
| 158 | TX: off |
| 159 | RX negotiated: on |
| 160 | TX negotiated: on |
| 161 | |
| 162 | # Disable pause frame support |
| 163 | root@OpenWrt:/# ethtool --pause eth0 autoneg off rx off tx off |
| 164 | rx unmodified, ignoring |
| 165 | tx unmodified, ignoring |
| 166 | root@OpenWrt:/# [ 92.519412] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full |
| 167 | |
| 168 | # Enable pause frame |
| 169 | root@OpenWrt:/# ethtool --pause eth0 autoneg on # enable pause frame autoneg |
| 170 | root@OpenWrt:/# [ 137.518636] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full |
| 171 | }}} |
| 172 | |
| 173 | Notes: |
| 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 | |
| 179 | See also: |
| 180 | * https://en.wikipedia.org/wiki/Ethernet_flow_control |
| 181 | |