Mellanox ConnectX-3 Firmware Flashing and Configuration for Both Ethernet and InfiniBand in 2021

Introduction

Although old, Mellanox ConnectX-3 has been a good card with decent performance and a good price on second-hand markets. This makes it the straightforward choice for a high-performance home or lab network. (If you intend to run InfiniBand on ESXi 7.0 or higher, go for CX4.) Sometimes you would find a card with a strange firmware or one not compatible with your existent gear. Luckily you can change the port configuration on all CX3 cards with a simple firmware flash. Here’s how.

Disclaimer:

  • Flashing firmware may brick your card and I’m not responsible for it
  • Do not power off or reboot your computer during firmware flashing

Preparation

I’ll assume you are using Windows Server 2019 with all the latest patches; all programs are available under Linux too so you can apply all the instructions for a Linux server with only minor deviations.

All the download links are for ConnectX-3 non-pro version; If you have a ConnectX-2 or ConnectX-3 Pro, you need to download a different firmware.

Downloads

Download and install Mellanox firmware tools. Install ALL the components (some of them are not selected by default).

Download the ConnectX-3 VPI firmware package. EN firmware can only run Ethernet; VPI firmware run both Ethernet and IB. Thus, VPI firmware is always recommended.

Check Your Card

First of all, we need the card’s machine-dependent device ID. This device ID is used for all the commands below.

In this case, the card’s ID is mt4099_pci_cr0 . Then we make sure the card communicates:

Now we are good to go.

Firmware Backup

ALWAYS make a backup so you can go back when something went wrong.

Manually open all the txt & ini files to make sure they are not empty and no error messages exist.

Firmware Flashing

Unzip the firmware downloaded from Mellanox, change the file extension from .bin to .mlx , then verify the firmware is OK:

Make sure the PSID from the first command is the target PSID (model number) you want; and make sure the second command outputs “Image is bootable”. Then we proceed to actually burn the card. (For demonstration purposes, I burned firmware with a different PSID.)

Reboot to use the new firmware.

FAQ/Miscellaneous

Firmware Compatibility?

In theory, all firmware for the same chip are compatible with all the cards with that chip. In practice, only flash a firmware that contains the same physical configuration as your card. For example, if your card have one physical port, do not flash any 2-port firmware. If your card have SFP+ ports, do not flash any QSFP firmware.

How to Switch Port Protocol (Ethernet/IB)

In devmgmt.msc , expand System Devices, double click on Mellanox ConnectX-3 VPI (MT04099) Network Adapter, go to Port Protocol tab, uncheck HW Defaults, select your desired port type. It should look like this:

Unable to Switch Port Protocol

If the port protocol is locked to Ethernet or IB and the options are all grayed out, it is likely that some boot-time configuration is set incorrectly. First read them out:

For link type fields, 1 means IB only, 2 means Ethernet only, 3 means online configurable. In this case, we configure them all to 3:

Reboot the machine and profit.

SR-IOV?

Then reboot. For detailed instructions, see the official documentation.

DO NOT configure too many VFs (e.g. NUM_OF_VFS=64 ) as the card might become IB only on that configuration even if it is in VPI mode (mode 3).

“Compile” the Firmware?

It’s known that old CX3 firmware need to be “compiled” (basically you bake a configuration into the firmware) then be flashed. New stock firmware doesn’t need this process anymore. For the completeness of this article, I’ll put the commands below.

The ini files are available for download here.

OEM Card Firmware?

If you really want OEM (HP, IBM, etc.) ConnectX-3 firmware for some reason, download from here.

Bricked Card?

If you unfortunately have a bricked card, power off, try to find the DFU pins (2-pin jumper on the card), short them, then power on the computer. The card will boot in DFU mode and you might be able to flash a new firmware onto it. Then power off the computer, disconnect DFU jumper, power on again.

References

4 thoughts on “Mellanox ConnectX-3 Firmware Flashing and Configuration for Both Ethernet and InfiniBand in 2021

  1. loebl

    Nice post, but doesn’t work on ConnectX-3 model MCX311A:
    That seems to be the one model in the ConnectX-3 series that is limited in capabilities.

    https://community.mellanox.com/s/question/0D51T00006lDPyFSAW/multiple-issues-with-connectx3-cx311axcat-firmware

    It cannot be flashed with any other image due to insufficient space, the on-board config cannot be changed (I wanted to activate SRIOV), not through mlxconfig (“Failed to query device”), not through FlexBoot (“insufficient permission”), and applying a patched firmware with the config setup up also does not bring the desired effect.

    It’s probably still a fine 10G card, but I wanted to toy around with the IO virtualization feature, so I am probably going to switch it out.

    Reply
  2. Cyril Baratoff

    I stumbled over your post when looking at how to add some lines to an .ini config file and have a request: could you please shed some light on why you think it is OK to use .mlx and .bin files interchangeably (rename .bin to .mlx and export .mlx where flint ri writes a .bin)?

    There has been a discussion of enabling 56Gb over back-to-back Ethernet connections and some participants are alienated by your approach 😉
    Here is the discussion:
    https://forums.servethehome.com/index.php?threads/help-getting-56gb-on-connectx-3-pros.40427/post-394256

    Reply
  3. Andrew

    One thing to watch out for, that I was recently bit by, is if you’re using Connectx-3 cards, be careful what version of the firmware tools you use. The latest versions no longer support Connectx-3, and provide some truly useless error messages.

    The last firmware tools that works with ConnectX-3 is 4.22.1-406-LTS

    If you have no cards listed when you run mst status, and you get “device not supported” when running other commands, make sure your firmware tools isn’t too new.

    Reply
  4. BertO

    Excellent post, thanks so much!!

    This helped me out with a different problem. I bought two Mellanox MCX312A-XCBT ConnectX-3 Ethernet Dual SFP+ cards. Installed into two Windows systems (W11 and W10). Initially the card worked fine in the W11 system. Installed the MLX drivers and during that process, it asked to update the firmware to 2.42. Stupidly I said yes. After reboot, I kept getting Windows driver error 43. Uninstalled, reinstalled but no luck. Checked the system log files which said this:
    Mellanox ConnectX-3 VPI (MT04099) Network Adapter (PCI bus 3, device 0, function 0): SR-IOV cannot be enabled because FW does not support SR-IOV. In order to resolve this issue please re-burn FW, having added parameters related to SR-IOV support.

    Native_3_0_0: Execution of FW command failed. op 0xfff, status 0x1, errno -5, token 0xffff, in_modifier 0x100, op_modifier 0, in_param 189ff000.

    Native_3_0_0: MAP_FA command failed with error -5.
    The adapter card is non-functional.
    Most likely a FW problem.
    Please burn the last FW and restart the mlx4_bus driver.

    Native_3_0_0: Driver startup failed because the hca could not be initialized.

    So I followed your instruction, re-flashed the firmware with older 2.40 rebooted and voila, working again!
    Interestingly, the W10 machine has no problems with the newer firmware. Gigabyte Z97 board, whereas the W11 system is an Aorus Z390.

    Thanks again, you saved the day!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *