Mellanox: automatic firmware update

Auto / Online firmware update
# Search latest mlxup version
http://www.mellanox.com/page/mlxup_firmware_tool

URL=https://www.mellanox.com/downloads/firmware/mlxup/4.26.0/SFX/linux_x64/mlxup
 
# Download mlxup
wget ${URL} -qO /tmp/mlxup
chmod +x /tmp/mlxup
 
# auto flash all Mellanox network cards
/tmp/mlxup -y

Manual firware update

Download firmware
http://www.mellanox.com/supportdownloader/

mst start
 
# get card description
flint -d /dev/mst/mt4103_pci_cr0 dc | grep Desc
 
for MST in $(mst status | grep "mst" | cut -d" " -f1); do
    flint -d ${MST} query #| egrep "FW Version|UEFI|PSID"
    echo
done
 
wget http://www.mellanox.com/downloads/firmware/fw-ConnectX3-rel-2_34_5000-MCX311A-XCA_Ax-FlexBoot-3.4.521.bin.zip -P /tmp
apt-get install -y unzip
unzip /tmp/fw-ConnectX3-rel-*-MCX312A-XCB_A2-A6-FlexBoot-*.bin.zip -d /tmp/

Update firmware

for MST in $(ls /dev/mst/mt*_pci_cr*); do
    echo ${MST}
    flint -y -d ${MST} -i /tmp/fw-ConnectX3Pro-rel-2_42_5000-MCX312B-XCC_Ax-FlexBoot-3.4.752-UEFI-14.11.46.bin b
done

Hot reload firmware (without reboot)
https://docs.mellanox.com/pages/viewpage.action?pageId=25137354

#mlxfwreset -d /dev/mst/mt4117_pciconf0 query
mlxfwreset -d /dev/mst/mt4117_pciconf0 reset
 
# show firmware version
for MST in $(mst status | grep "mst" | cut -d" " -f1); do     flint -d ${MST} query | egrep "FW Version"; done

Links
http://www.mellanox.com/supportdownloader/
http://www.mellanox.com/page/firmware_table_ConnectX3EN