wiki:ventana/ethernet

Version 1 (modified by trac, 12 months ago) (diff)

--

Ventana Ethernet

The Ventana Family of SBC's has different configurations of ethernet ports across the family.

Hardware Configuration

Board Configuration eth0 eth1
GW51xx Single GigE IMX6 FEC -
GW52xx Single GigE IMX6 FEC -
GW53xx Dual GigE IMX6 FEC (J16) Marvell SKY2 (J17)
GW54xx Dual GigE IMX6 FEC (J19) Marvell SKY2 (J20)
GW552x Dual GigE Intel I210 (J12) Intel I210 (J9)

Drivers and throughput

Here are some notes on the various Linux drivers that support the Gigabit Ethernet ports discussed above:

  • Freescale FEC MAC:
    • Used on the GW51xx,GW52xx,GW53xx,GW54xx (Port 1 on boards with 2 ports)
    • i.MX6 errata: ERR004512 discusses a throughput limitation limiting the device to appx 470mbps
    • fec linux driver
    • hardware supports common hardware accelerations such as NAPI, checksum offload, and jumbo frames. The driver used in the Yocto and OpenWrt 16.01 BSPs support this, yet the upstream driver used in OpenWrt 14.08 does not.
  • Marvell Yukon2 MAC/PHY:
    • Used on GW552x, GW54xx,GW53xx (Port 2 on boards with 2 ports)
    • sky2 linux driver
    • hardware and driver appear to support common hardware accelerations such as NAPI, checksum offload, and jumbo frames
  • Intel i210 MAC/PHY
    • igb linux driver
    • hardware and driver appear to support common hardware accelerations such as NAPI, checksum offload, and jumbo frames

Throughput test results:

NIC Software Throughput(UDP/TCP) Mbps
TX RX
IMX6 FEC yocto 1.8 (gw 3.14.48) 406/423 493/588
Intel I210 yocto 1.8 (gw 3.14.48) 943/599 503/607
Marvell SKY2 yocto 1.8 (gw 3.14.48) 829/648 730/615
IMX6 FEC OpenWrt 14.08 (3.14.16) 270/317 495/439
Intel I210 OpenWrt 14.08 (3.14.16) 941/600 630/411
Marvell SKY2 OpenWrt 14.08 (3.14.16) 871/480 670/485
IMX6 FEC OpenWrt 16.02 (4.4.0) 394/392 530/560
Intel I210 OpenWrt 16.02 (4.4.0) 940/680 870/758
Marvell SKY2 OpenWrt 16.02 (4.4.0) 794/534 862/878
  • test results using iperf3 with iptables/ebtables modules removed where applicable

ethtool/mii-tool

These two tools (ethtool/mii-tool) are tools used to talk to the Ethernet PHY.

In general, we recommend ethtool because it is kept up to date. mii-tool is now deprecated and so we will not include it by default in our BSPs moving forward.

Below are two examples getting information from the Ventana FEC Ethernet device using both ethtool and mii-tool:

  • ethtool
    root@OpenWrt:/# ethtool eth0
    Settings for eth0:
            Supported ports: [ TP MII ]
            Supported link modes:   10baseT/Half 10baseT/Full
                                    100baseT/Half 100baseT/Full
                                    1000baseT/Full
            Supported pause frame use: Symmetric
            Supports auto-negotiation: Yes
            Advertised link modes:  10baseT/Half 10baseT/Full
                                    100baseT/Half 100baseT/Full
                                    1000baseT/Full
            Advertised pause frame use: Symmetric
            Advertised auto-negotiation: Yes
            Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                                 100baseT/Half 100baseT/Full
                                                 1000baseT/Full
            Link partner advertised pause frame use: Symmetric Receive-only
            Link partner advertised auto-negotiation: Yes
            Speed: 1000Mb/s
            Duplex: Full
            Port: MII
            PHYAD: 0
            Transceiver: external
            Auto-negotiation: on
            Supports Wake-on: d
            Wake-on: d
            Link detected: yes
    
  • mii-tool
    root@OpenWrt:/# mii-tool eth0
    eth0: negotiated 1000baseT-FD flow-control, link ok
    

Setting the Ethernet Port Speed

For customers who would like to force a specific speed, you can use the following:

  • Using ethtool
    # In order to change link speed, you must also turn autonegotiation off
    root@OpenWrt:/# ethtool -s eth0 autoneg off speed 100
    root@OpenWrt:/# [  261.516832] libphy: 2188000.ethernet:00 - Link is Down
    [  265.516787] libphy: 2188000.ethernet:00 - Link is Up - 100/Full
    
  • Using mii-tool
    # Change link to 10mbps
    root@OpenWrt:/# mii-tool eth0 -F 10baseT-FD
    root@OpenWrt:/# [  259.359135] libphy: 2188000.ethernet:00 - Link is Down
    [  259.364390] br-lan: port 1(eth0) entered disabled state
    [  261.359160] libphy: 2188000.ethernet:00 - Link is Up - 10/Full
    [  261.365045] br-lan: port 1(eth0) entered forwarding state
    [  261.370543] br-lan: port 1(eth0) entered forwarding state
    [  263.368898] br-lan: port 1(eth0) entered forwarding state
    

Duplex

Most Ethernet NICs can be configured to be either full or half duplex. For information on what this means, please see this page.

  • Using ethtool
    # To set duplex, autonegotiaion must be turned off
    root@OpenWrt:/# ethtool -s eth0 autoneg off duplex half
    root@OpenWrt:/# [  465.514658] libphy: 2188000.ethernet:00 - Link is Down
    root@OpenWrt:/# ethtool eth0 | grep Duplex
            Duplex: Half
    

Ethernet PAUSE frames for flow control (802.3x)

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.

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).

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.

Ethernet PAUSE frames are not supported across all the various Network Interface Controllers (NICs) used on the Ventana product line (in some cases the hardware can't support it, in others the drivers may not support it):

  • IMX6 FEC: (used as eth0 on GW51xx/GW52xx/GW53xx/GW54xx/GW55x) supports PAUSE frames (yet tx/rx must be set the same)
  • Intel i210: (used on GW5520 and GW16083) supports symmetric PAUSE frames with independent control
  • Marvell SKY2: (used as eth1 on GW54xx/GW53xx) supports PAUSE frames but no autonegotiation

To configure:

  • Using ethtool
    # Show pause-frame status
    root@OpenWrt:/# ethtool --show-pause eth0
    Pause parameters for eth0:
    Autonegotiate:  on
    RX:             off
    TX:             off
    RX negotiated:  on
    TX negotiated:  on
    
    # Disable pause frame support
    root@OpenWrt:/# ethtool --pause eth0 autoneg off rx off tx off
    rx unmodified, ignoring
    tx unmodified, ignoring
    root@OpenWrt:/# [   92.519412] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full
    
    # Enable pause frame
    root@OpenWrt:/# ethtool --pause eth0 autoneg on # enable pause frame autoneg
    root@OpenWrt:/# [  137.518636] libphy: 2188000.ethernet:00 - Link is Up - 1000/Full
    

Notes:

  • Note that FEC tx/rx pause frame support must be the same (you can't enable tx and disable rx for example)
  • If PAUSE frames are supported by the NIC/driver their default configuration is auto-negotiated.
  • If autonegotiation of PAUSE frames is enabled from a disabled state the link will go down and come back up

See also: