Skip to content

Updating Firmware

Ido Schimmel edited this page Feb 9, 2020 · 19 revisions
Table of Contents
  1. In-Driver Firmware Flashing
    1. Flashing an ad hoc firmware version
  2. External Tool Firmware Flashing
    1. Getting the Firmware
    2. Updating Firmware
  3. Further Resources

In-Driver Firmware Flashing

Firmware flashing is supported from within the mlxsw driver ever since kernel version 4.13 and firmware version 13.1420.122. The supported firmware version is packaged in the linux-firmware package, relieving users from the need to flash the firmware themselves and synchronize the kernel and firmware versions.

The linux-firmware package is based on the linux-firmware repository and contains the kernel-required firmware binaries, which can be found under the /lib/firmware/mellanox directory in most distributions given the linux-firmware package is sufficiently up to date.

To check the current firmware version, run:

$ ethtool -i <DEV>

Where DEV is any switch port interface.

Upon driver initialization, the current firmware version used by the device is validated against the specific version supported by the driver. If the current version is different, the driver flashes its own firmware version.

Note that in-driver firmware flashing requires both the firmware and the kernel to be in a sufficiently up-to-date version, and if either the kernel or firmware versions are older than 4.13 or 13.1420.122 respectively, then in-driver firmware flashing fails.

Note: In-driver firmware flashing is performed using *.mfa2 files, whereas flashing using external tools (described below) is performed using *.mfa files.

Flashing an ad hoc firmware version

The ability to flash an ad hoc firmware version is mostly to be used when a firmware version is used for debugging and testing purposes. The driver is instructed not to flash the bundled firmware in this case. In order to use that firmware version permanently, it should bundled with a new mlxsw driver. In rare cases it is possible to keep this ad hoc firmware version in production, but it requires some modification. See the example below.

This option is supported from kernel 4.20 and corresponding iproute2 version.

Example:

  • Query the devlink parameters supported by the device
$ devlink dev param show
pci/0000:03:00.0:
  name fw_load_policy type generic
    values:
      cmode driverinit value driver
  • Flash new firmware using ethtool

    Where the ad hoc firmware file is a relative path to the /lib/firmware directory.

$ ethtool -f enp3s0np1 mellanox/mlxsw_spectrum-13.1703.4.mfa2
  • Toggle parameter
$ devlink dev param set pci/0000:03:00.0 name fw_load_policy value flash cmode driverinit
  • Driver reload via devlink
$ devlink dev reload pci/0000:03:00.0
  • Query firmware version to validate correct firmware version is used
$ ethtool -i enp3s0np1
driver: mlxsw_spectrum
version: 1.0
firmware-version: 13.1703.4
expansion-rom-version:
bus-info: 0000:03:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

As long as the firmware version is not bundled with the mlxsw driver, all the above steps should be done after each reboot.

External Tool Firmware Flashing

If it is not possible to use in-driver firmware flashing, mstflint software package should be used instead. The latest version of mstflint is available here. In Fedora it can be installed using dnf:

$ dnf install mstflint

Getting the Firmware

mstflint capable firmware is packed in a tarball together with the installation files, as an *.mfa file. In addition, firmware files are available separately here.

4.12+ kernel installations should use firmware matching the requirements of the kernel as listed in its release notes; Earlier versions should use firmware version 13.1302.120.

Updating Firmware

To update the firmware, the utility mstfwmanager from the mstflint package should be used. Run:

$ mstfwmanager -d 01:00.0 -i mlxsw_spectrum-13.2000.2308.mfa -f -u

Where mlxsw_spectrum-13.2000.2308.mfa is the firmware file described in the previous section and 01:00.0 is the PCI address of the device.

Note: Changes take effect following reboot.

Further Resources

  1. man mstfwmanager
Clone this wiki locally