Update Mellanox firmware under Ubuntu

Install MFT
# Check latest MFT version
https://www.mellanox.com/products/adapter-software/firmware-tools

Install

URL=https://www.mellanox.com/downloads/MFT/mft-4.14.0-105-x86_64-deb.tgz
 
wget -q ${URL} -P /tmp
tar xzf /tmp/mft-4.14.0-105-x86_64-deb.tgz -C /tmp/
 
sudo apt-get update
sudo apt install -y gcc make dkms linux-headers-$(uname -r)
/tmp/mft-4.14.0-105-x86_64-deb/install.sh 
 
mst start

Get NIC info

# get controller info
for MST in $(mst status | grep "mst" | cut -d" " -f1); do
    flint -d ${MST} query #| egrep "FW Version|UEFI|PSID"
    echo
done
 
# get board id for update
for MST in $(ls /dev/mst/*); do
    echo ${MST}
    flint -d ${MST} query | grep PSID | cut -d":" -f2 | tr -d ' '
    echo
done
 
# reset parameter
for MST in $(ls /dev/mst/*); do
    mlxconfig -y -d ${MST} reset
    echo
done

Links
http://www.mellanox.com/page/firmware_HCA_FW_identification - Firmware Support and Downloads - Identifying Adapter Cards
http://www.mellanox.com/page/firmware_table_IBM
http://www.mellanox.com/page/firmware_HCA_FW_update
http://www.mellanox.com/page/firmware_NIC_FW_update
http://www.mellanox.com/content/pages.php?pg=firmware_HCA_FW_update
http://www.mellanox.com/pdf/MFT/ESXi_bootable_mst_README.txt
http://www.mellanox.com/page/products_dyn?product_family=27
http://www.mellanox.com/page/products_dyn?product_family=26&mtag=linux_sw_drivers
http://www.mellanox.com/page/infiniband_cards_overview
http://www.mellanox.com/page/firmware_table_ConnectX2EN
http://www.mellanox.com/content/pages.php?pg=firmware_HCA_FW_identification
http://www.mellanox.com/content/pages.php?pg=management_tools&menu_section=34
http://packages.ubuntu.com/search?searchon=names&keywords=libmlx