<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacking on Charlie Chiang's blog</title><link>https://charlie0129.github.io/blog/categories/hacking/</link><description>Recent content in Hacking on Charlie Chiang's blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 19 Jul 2024 16:37:00 +0800</lastBuildDate><atom:link href="https://charlie0129.github.io/blog/categories/hacking/index.xml" rel="self" type="application/rss+xml"/><item><title>Flash 10G CX4121A to 25G</title><link>https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/</link><pubDate>Fri, 19 Jul 2024 16:37:00 +0800</pubDate><guid>https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/</guid><description>&lt;p>10G ConnectX-4 Lx NICs can be flashed to 25G with the right firmware. This is useful if you have a 10G NIC and want to upgrade to 25G without buying a new NIC. This article will guide you through the process of flashing a 10G Mellanox ConnectX-4 Lx NIC to 25G.&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g.jpg"
width="4032"
height="3024"
srcset="https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_e67c9199f79997b.webp 480w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_f473233eaea7608d.jpg 480w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_c3aef0b072ec866.webp 1024w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_dc742250568c7fee.jpg 1024w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_f66edbb97499b063.webp 1536w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_78d6e0bb25964f66.jpg 1536w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_91d79469bdb58ec7.webp 2048w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_30a548030205647.jpg 2048w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_4a93a94a834c4b11.webp 2560w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_da6e88a334cf467c.jpg 2560w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_be28c42d38efe826.webp 4032w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-10g_hu_b51529c87b4602cd.jpg 4032w"
loading="lazy"
alt="10G ConnectX-4 Lx"
class="gallery-image"
data-flex-grow="133"
data-flex-basis="320px"
>
&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g.jpg"
width="3455"
height="2591"
srcset="https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_56e8aacbea38e6dd.webp 480w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_8e6b89cef8aee16d.jpg 480w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_ed897d5a8fd11782.webp 1024w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_25c0489be6304c6c.jpg 1024w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_7763f81dd3853a26.webp 1536w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_a70cb4540c546c23.jpg 1536w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_39f701fb24c38667.webp 2048w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_d0e4c3fbcae55987.jpg 2048w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_244c2634c4e6d6e.webp 2560w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_2b581b867a6ad0ea.jpg 2560w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_fa581e091ddafd5b.webp 3455w, https://charlie0129.github.io/blog/p/mcx4121a-10g-to-25g/images/cx4121a-25g_hu_581adf59df5a6c23.jpg 3455w"
loading="lazy"
alt="25G ConnectX-4 Lx"
class="gallery-image"
data-flex-grow="133"
data-flex-basis="320px"
>
&lt;/p>
&lt;p>Warning: Do not try this on MCX4121C. It will brick the NIC.&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Download firmware from &lt;a class="link" href="https://network.nvidia.com/support/firmware/connectx4lxen/" target="_blank" rel="noopener"
>Firmware for ConnectX®-4 Lx EN&lt;/a>. Choose &lt;code>MCX4121A-ACUT&lt;/code>. I will assume the firmware file is named &lt;code>fw-ConnectX4Lx-rel-14_32_1010-MCX4121A-ACU_Ax-UEFI-14.25.17-FlexBoot-3.6.502.bin&lt;/code>.&lt;/p>
&lt;p>If you are wondering what&amp;rsquo;s the difference between models, here&amp;rsquo;s a table for ConnectX-4 Lx cards (&lt;a class="link" href="files/pb-connectx-4-lx-en-card.pdf" >original document&lt;/a>). You should choose 25G models to flash to.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Max Network Speed&lt;/th>
&lt;th>Interface Type&lt;/th>
&lt;th>Supported Ethernet Speeds (GbE)&lt;/th>
&lt;th>Host Interface&lt;/th>
&lt;th>Additional Features&lt;/th>
&lt;th>OPN&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1x 10GbE&lt;/td>
&lt;td>SFP28&lt;/td>
&lt;td>10, 1&lt;/td>
&lt;td>PCIe 3.0 x8&lt;/td>
&lt;td>&lt;/td>
&lt;td>MCX4111A-XCAT&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2x 10GbE&lt;/td>
&lt;td>SFP28&lt;/td>
&lt;td>10, 1&lt;/td>
&lt;td>PCIe 3.0 x8&lt;/td>
&lt;td>&lt;/td>
&lt;td>MCX4121A-XCAT&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2x 10GbE&lt;/td>
&lt;td>SFP28&lt;/td>
&lt;td>10, 1&lt;/td>
&lt;td>PCIe 3.0 x8&lt;/td>
&lt;td>Host Management, UEFI Enabled&lt;/td>
&lt;td>MCX4121A-XCHT&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1x 25GbE&lt;/td>
&lt;td>SFP28&lt;/td>
&lt;td>25, 10, 1&lt;/td>
&lt;td>PCIe 3.0 x8&lt;/td>
&lt;td>&lt;/td>
&lt;td>MCX4111A-ACAT&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1x 25GbE&lt;/td>
&lt;td>SFP28&lt;/td>
&lt;td>25, 10, 1&lt;/td>
&lt;td>PCIe 3.0 x8&lt;/td>
&lt;td>UEFI Enabled&lt;/td>
&lt;td>MCX4111A-ACUT&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2x 25GbE&lt;/td>
&lt;td>SFP28&lt;/td>
&lt;td>25, 10, 1&lt;/td>
&lt;td>PCIe 3.0 x8&lt;/td>
&lt;td>&lt;/td>
&lt;td>MCX4121A-ACAT&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2x 25GbE&lt;/td>
&lt;td>SFP28&lt;/td>
&lt;td>25, 10, 1&lt;/td>
&lt;td>PCIe 3.0 x8&lt;/td>
&lt;td>UEFI Enabled&lt;/td>
&lt;td>MCX4121A-ACUT&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1x 40GbE&lt;/td>
&lt;td>QSFP28&lt;/td>
&lt;td>40, 25, 10, 1&lt;/td>
&lt;td>PCIe 3.0 x8&lt;/td>
&lt;td>&lt;/td>
&lt;td>MCX4131A-BCAT&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1x 50GbE&lt;/td>
&lt;td>QSFP28&lt;/td>
&lt;td>50, 40, 25, 10, 1&lt;/td>
&lt;td>PCIe 3.0 x8&lt;/td>
&lt;td>&lt;/td>
&lt;td>MCX4131A-GCAT&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/li>
&lt;li>
&lt;p>Download and install &lt;a class="link" href="https://network.nvidia.com/products/adapter-software/firmware-tools/" target="_blank" rel="noopener"
>NVIDIA Firmware Tools (MFT)&lt;/a>.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;code>mst start&lt;/code>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;code>mst ststus&lt;/code> You will see you MST device, e.g. &lt;code>/dev/mst/mt4117_pciconf0&lt;/code>. I will use this device path in this article. If your path differs from this, please change it accordingly.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Save GUID, MAC: &lt;code>flint -d /dev/mst/mt4117_pciconf0 query full &amp;gt; flint_query.txt&lt;/code>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Save hardware info: &lt;code>flint -d /dev/mst/mt4117_pciconf0 hw query &amp;gt; flint_hwinfo.txt&lt;/code>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Save current firmware: &lt;code>flint -d /dev/mst/mt4117_pciconf0 ri orig_firmware.bin&lt;/code>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Save current firmware config: &lt;code>flint -d /dev/mst/mt4117_pciconf0 dc orig_firmware.ini&lt;/code>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Save current PXE ROM (if exists): &lt;code>flint -d /dev/mst/mt4117_pciconf0 rrom orig_rom.bin&lt;/code>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Save current PCI VPD: &lt;code>mlxburn -d /dev/mst/mt4117_pciconf0 -vpd &amp;gt; orig_vpd.txt&lt;/code>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;code>flint -i fw-ConnectX4Lx-rel-14_32_1010-MCX4121A-ACU_Ax-UEFI-14.25.17-FlexBoot-3.6.502.bin verify&lt;/code>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;code>flint -i fw-ConnectX4Lx-rel-14_32_1010-MCX4121A-ACU_Ax-UEFI-14.25.17-FlexBoot-3.6.502.bin -d /dev/mst/mt4117_pciconf0 -allow_psid_change burn&lt;/code>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>Reboot you machine. You should see your NIC is now have 25G speed.&lt;/p>
&lt;p>Bonus:&lt;/p>
&lt;ul>
&lt;li>To change MAC address: &lt;code>flint -d /dev/mst/mt4117_pciconf0 -mac 02c90abcdef0 sg&lt;/code>&lt;/li>
&lt;li>To change GUID: &lt;code>flint -d /dev/mst/mt4117_pciconf0 -guid 0002c9000abcdef0 sg&lt;/code>&lt;/li>
&lt;/ul></description></item></channel></rss>