HowTo Change the Ethernet Port Speed of Mellanox Adapters (Linux)

Version 8

    This post shows the command to change the port speed in case of Linux OS using ethtool.

     

    References

     

    Drivers

    • Use the latest MLNX_OFED or latest distributions inbox drivers (RHEL 7.1 and above,  Ubuntu 14.04)

     

    Configuration Example

    This is an example of ConnectX-3 Pro adapter installed on two servers connected back-to-back. The process can also apply to ConnectX-4 (changing 100Gb/s to 25Gb/s). The adapter ports are configured in Ethernet mode.

     

    Note: in case the ports are connected to a switch and not back-to-back the procedure will not work as the switch speed is fixed and auto negotiation is not supported.

     

    Run the following command on both servers:

     

    1. Get the port speed configuration.

    # ethtool ens817

    Settings for ens817:

      Supported ports: [ FIBRE ]

      Supported link modes:   1000baseKX/Full

                             10000baseKX4/Full

                             10000baseKR/Full

                             40000baseCR4/Full

                             40000baseSR4/Full

      Supported pause frame use: Symmetric Receive-only

      Supports auto-negotiation: Yes

      Advertised link modes:  1000baseKX/Full

                             10000baseKX4/Full

                             10000baseKR/Full

                             40000baseCR4/Full

                             40000baseSR4/Full

      Advertised pause frame use: Symmetric

      Advertised auto-negotiation: Yes

      Link partner advertised link modes:  40000baseCR4/Full

      Link partner advertised pause frame use: No

      Link partner advertised auto-negotiation: Yes

      Speed: 40000Mb/s

      Duplex: Full

      Port: Direct Attach Copper

      PHYAD: 0

      Transceiver: internal

      Auto-negotiation: on

      Supports Wake-on: d

      Wake-on: d

      Current message level: 0x00000014 (20)

            link ifdown

      Link detected: yes

     

    2. Set the Speed to 10000Mb/s.

    # ethtool -s ens817 speed 10000 autoneg off

    Note: You must disable the auto-negotiation (autoneg off) otherwise, the command will fail.

     

    3. Get the post speed.

    #  ethtool ens817

    Settings for ens817:

      Supported ports: [ FIBRE ]

      Supported link modes:   1000baseKX/Full

                             10000baseKX4/Full

                             10000baseKR/Full

                             40000baseCR4/Full

                             40000baseSR4/Full

      Supported pause frame use: Symmetric Receive-only

      Supports auto-negotiation: Yes

      Advertised link modes:  10000baseKX4/Full

                             10000baseKR/Full

      Advertised pause frame use: Symmetric

      Advertised auto-negotiation: Yes

      Speed: 10000Mb/s

      Duplex: Full

      Port: Direct Attach Copper

      PHYAD: 0

      Transceiver: internal

      Auto-negotiation: off

      Supports Wake-on: d

      Wake-on: d

      Current message level: 0x00000014 (20)

            link ifdown

      Link detected: yes