{"id":1077,"date":"2021-05-29T11:40:46","date_gmt":"2021-05-29T10:40:46","guid":{"rendered":"https:\/\/www.marcinwilk.eu\/?p=1077"},"modified":"2021-06-01T16:28:09","modified_gmt":"2021-06-01T15:28:09","slug":"aktualizacja-firmware-connectx-za-pomoca-mstflint","status":"publish","type":"post","link":"https:\/\/www.marcinwilk.eu\/en\/2021\/05\/aktualizacja-firmware-connectx-za-pomoca-mstflint\/","title":{"rendered":"ConnectX firmware update with mstflint"},"content":{"rendered":"Today I had the opportunity to update the firmware of the Mellanox ConnectX-3 card, and I thought I'd give a closer look at the process (it should work for previous ConnectX series card models as well).<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<p>ConnectX-3 PCIe device is a network card manufactured by Mellanox (now owned by nVidia) and equipped with SFP+ interface (or two) with 10Gbps network performance.<\/p>\n<p>The interface is equipped with inserts that have appropriate sockets adjusted to local network &#8211; optical (e.g. LC), copper (e.g. RJ45), and with fixed (copper) cable &#8211; so called DAC cables. To update the firmware you need to prepare the mstflint software (<a href=\"https:\/\/github.com\/Mellanox\/mstflint\/\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/Mellanox\/mstflint\/<\/a>) and install some libraries in the system. I've done the update in RedHat Enteprise Linux 8.4 operating system (which guarantees that identical steps will work in RockyLinux 8 or CentOS 8). We need to perform all the steps with root user privileges.<br \/>\nSystem preparation:<\/p>\n<pre># installation of compilation tools\r\ndnf group install \"Development Tools\" -y\r\n# installation of required libraries\r\ndnf install openssl-devel libibmad-devel zlib-devel wget unzip pciutils -y<\/pre>\n<p>The next step is to download the sources and compile the mstflint program &#8211; this is a package that allows you to communicate with the ConnectX network card and manage its firmware.<br \/>\nInstalling mstflint:<\/p>\n<pre># move to \/tmp\/ folder to avoid messing up your system\r\ncd \/tmp\r\n# downloading current mstflint sources\r\nwget https:\/\/github.com\/Mellanox\/mstflint\/archive\/refs\/heads\/master.zip\r\n# unpacking and running the preparation script\r\nunzip master.zip\r\ncd mstflint-master\/\r\n.\/autogen.sh\r\n# configuration, compilation and installation in the system\r\n.\/configure\r\nmake\r\nmake install<\/pre>\n<p>Now we need to determine the address of our network card. Just use the \"lspci\" command, which will display a list of devices. The number on the left is the address we will use to communicate with the card (as in the picture below):<\/p>\n<p><a href=\"https:\/\/www.marcinwilk.eu\/wp-content\/2021\/05\/connectx-device-lspci.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1093 size-large\" title=\"lspci connectx\" src=\"https:\/\/www.marcinwilk.eu\/wp-content\/2021\/05\/connectx-device-lspci-1024x156.png\" alt=\"\" width=\"840\" height=\"128\" srcset=\"https:\/\/www.marcinwilk.eu\/wp-content\/2021\/05\/connectx-device-lspci-1024x156.png 1024w, https:\/\/www.marcinwilk.eu\/wp-content\/2021\/05\/connectx-device-lspci-300x46.png 300w, https:\/\/www.marcinwilk.eu\/wp-content\/2021\/05\/connectx-device-lspci-768x117.png 768w, https:\/\/www.marcinwilk.eu\/wp-content\/2021\/05\/connectx-device-lspci-1200x183.png 1200w, https:\/\/www.marcinwilk.eu\/wp-content\/2021\/05\/connectx-device-lspci.png 1283w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<p>It's worth checking if mstflint is working, to do this we'll ask for information about the current version of the firmware the card is using with the command (type after -d the address that lspci displayed to you):<\/p>\n<pre>mstflint -d <strong><span style=\"color: #ff0000;\">01:00.0<\/span><\/strong> q full<\/pre>\n<p>The result should resemble something like this:<\/p>\n<pre># mstflint -d 01:00.0 q \r\nImage type: \r\nFS2 FW Version: 2.33.5220 \r\nFW Release Date: 29.3.2015 \r\nMIC Version: 1.5.0 \r\nConfig Sectors: 1\r\nProduct Version: 02.33.52.20 \r\nRom Info: type=PXE version=3.4.467 \r\nDevice ID: 4099 \r\nDescription: Node Port1 Port2 Sys image \r\nGUIDs: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff \r\nMACs: f4521427b0c0 f4521427b0c1 \r\nVSD: \r\n<span style=\"color: #3366ff;\"><strong>PSID: MT_1170110023<\/strong><\/span><\/pre>\n<p>As you can see, the communication was successful and we can update the firmware. We should start by downloading the version matching our network card from the manufacturer's website &#8211; i.e. <a href=\"https:\/\/www.mellanox.com\/support\/firmware\/firmware-downloads\" target=\"_blank\" rel=\"noopener\">https:\/\/www.mellanox.com\/support\/firmware\/firmware-downloads<\/a>.<\/p>\n<p>On the left we look for the model we have (e.g. ConnectX-3) and on the right we choose the type of device (Ethernet in the case of a network card). Looking at the available versions you can see that it is possible to upload a newer one. However, you have to choose (from the OPN table) the version of the device. You may find it out again using the lspci tool and the command (type after -s the address displayed by lspci):<\/p>\n<pre>lspci -vv -s <span style=\"color: #ff0000;\"><strong>01:00.0<\/strong><\/span> | grep \"Part number\" -A 3<\/pre>\n<p>The result (shown below) indicates the version of the device you have, and it is this version that you should indicate in the OPN column of the firmware page.<\/p>\n<pre>[PN] <span style=\"color: #ff0000;\"><strong>Part number: MCX311A-XCAT<\/strong><\/span>\r\n[EC] Engineering changes: A6\r\n[SN] Serial number: MT1402X13666\r\n[V0] Vendor specific: PCIe Gen3 x4<\/pre>\n<p>In the next column \"PSID\" choose the number consistent with that shown by msflint with the argument g full (marked above in blue). On the right in the \"Download\/Documentation\" column you will see a link to the appropriate archive containing the firmware for the device. Download it, unpack and program our card:<\/p>\n<pre># download\r\nwget http:\/\/www.mellanox.com\/downloads\/firmware\/file.zip\r\n# extracting (the extracted file has the extension .bin)\r\nunzip file.zip\r\n# programming, you must confirm that you want to do it by clicking on the \"y\"\r\nmstflint -d <span style=\"color: #ff0000;\"><strong>01:00.0<\/strong><\/span> -i file.bin burn\r\n\r\nCurrent FW version on flash: 2.33.5220 <span style=\"color: #3366ff;\"><em>(current firmware version)<\/em><\/span>\r\nNew FW version: 2.42.5000 <span style=\"color: #3366ff;\"><em>(upload version)<\/em><\/span>\r\n\r\nBurn process will not be failsafe. No checks will be performed.\r\nALL flash, including the Invariant Sector will be overwritten.\r\nIf this process fails, computer may remain in an inoperable state.\r\n\r\nDo you want to continue ? (<strong>y<\/strong>\/n) [n] : <span style=\"color: #ff0000;\"><strong>y<\/strong><\/span>\r\n\r\nBurning FS2 FW image without signatures - OK\r\nRestoring signature - OK<\/pre>\n<p>After this operation just restart your computer and you are done! We can enjoy the network card software fixes.\n<input class=\"fooboxshare_post_id\" type=\"hidden\" value=\"1077\"\/>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in Polski.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,111,59,65,63,64,61,60],"tags":[66,41,149,26,171,159,97,40,170,42,158],"class_list":["post-1077","post","type-post","status-publish","format-standard","hentry","category-computers","category-firmware","category-hardware","category-linux","category-network","category-siec","category-sieci","category-sprzet","tag-bash","tag-centos","tag-centos8","tag-computer","tag-connectx","tag-el8","tag-firmware","tag-linux","tag-mellanox","tag-rhel","tag-rhel8"],"_links":{"self":[{"href":"https:\/\/www.marcinwilk.eu\/en\/wp-json\/wp\/v2\/posts\/1077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.marcinwilk.eu\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.marcinwilk.eu\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.marcinwilk.eu\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.marcinwilk.eu\/en\/wp-json\/wp\/v2\/comments?post=1077"}],"version-history":[{"count":0,"href":"https:\/\/www.marcinwilk.eu\/en\/wp-json\/wp\/v2\/posts\/1077\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.marcinwilk.eu\/en\/wp-json\/wp\/v2\/media?parent=1077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.marcinwilk.eu\/en\/wp-json\/wp\/v2\/categories?post=1077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.marcinwilk.eu\/en\/wp-json\/wp\/v2\/tags?post=1077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}