### Build and Install MSTFLINT from Source Source: https://context7.com/mellanox/mstflint/llms.txt Instructions for cloning the MSTFLINT repository, building it using autotools, and installing the toolkit. Includes steps for enabling OpenSSL features and building Debian packages. ```bash # Clone and build from source git clone https://github.com/Mellanox/mstflint.git cd mstflint ./autogen.sh mkdir build && cd build ../configure make sudo make install # Optional: enable OpenSSL features (code signing, CS support) ../configure --enable-openssl make && sudo make install # Build a Debian package dpkg-buildpackage -uc -us sudo dpkg -i ../mstflint_4.35.0_amd64.deb sudo dpkg -i ../mstflint-dkms_4.35.0_all.deb ``` -------------------------------- ### Bundle ConnectX5 Firmware Variants with mstarchive Source: https://context7.com/mellanox/mstflint/llms.txt Example of creating an MFA2 archive specifically for ConnectX5 firmware variants. It lists the firmware files and then uses mstarchive to bundle them. ```bash ls /opt/fw_binaries/ # fw-ConnectX5-rel-16_35_1012-MCX556A-ECAT.bin # fw-ConnectX5-rel-16_35_1012-MCX555A-ECAT.bin # fw-ConnectX5-rel-16_35_1012-MCX553A-EDAT.bin mstarchive \ --version 16.35.1012 \ --bins-dir /opt/fw_binaries/ \ --out-file fw-ConnectX5-rel-16_35_1012.mfa2 ``` -------------------------------- ### Generate and Display UUIDs (C++) Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/sole/README.md Demonstrates the creation and display of UUIDs of versions 0, 1, and 4 using the Sole library. Shows how to get UUIDs as hex strings, base62 strings, and pretty-printed details. Also includes rebuilding UUIDs from string representations. ```c++ #include #include "sole.hpp" int main() { sole::uuid u0 = sole::uuid0(), u1 = sole::uuid1(), u4 = sole::uuid4(); std::cout << "uuid v0 string : " << u0 << std::endl; std::cout << "uuid v0 base62 : " << u0.base62() << std::endl; std::cout << "uuid v0 pretty : " << u0.pretty() << std::endl << std::endl; std::cout << "uuid v1 string : " << u1 << std::endl; std::cout << "uuid v1 base62 : " << u1.base62() << std::endl; std::cout << "uuid v1 pretty : " << u1.pretty() << std::endl << std::endl; std::cout << "uuid v4 string : " << u4 << std::endl; std::cout << "uuid v4 base62 : " << u4.base62() << std::endl; std::cout << "uuid v4 pretty : " << u4.pretty() << std::endl << std::endl; u1 = sole::rebuild("F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6"); std::cout << "uuid v1 rebuilt: " << u1 << " -> " << u1.pretty() << std::endl; u4 = sole::rebuild("GITheR4tLlg-BagIW20DGja"); std::cout << "uuid v4 rebuilt: " << u4 << " -> " << u4.pretty() << std::endl; } ``` ```bash g++ sample.cc -std=c++11 -lrt && ./a.out ``` -------------------------------- ### Get Basic Link Info Source: https://github.com/mellanox/mstflint/blob/master/man/mstlink.md Retrieve general information about a specific device and port. This is a foundational command for any link inspection. ```bash mstlink -d -p ``` -------------------------------- ### Set GUIDs on Existing Firmware with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Modify the GUIDs on an already burned firmware image without burning a new image. This is useful for updating GUIDs post-installation. ```bash # Set GUIDs on already-burned image (sg command) mstflint -d 02:00.0 --guid 0x0002c903000000e0 sg ``` -------------------------------- ### Burn Firmware Image with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Burn a firmware image to Mellanox device flash memory. Supports interactive, non-interactive (-y), custom GUIDs, MAC addresses, and using image-specific GUIDs. ```bash # Burn a firmware image (failsafe, interactive) mstflint -d 02:00.0 -i fw-ConnectX3-rel-10_2_0010.bin burn # Burn non-interactively (answer yes to all prompts) mstflint -d 02:00.0 -i fw-ConnectX3-rel-10_2_0010.bin -y burn # Burn with custom GUID base (node, port1, port2, sys-image derived automatically) mstflint -d 02:00.0 -i firmware.bin --guid 0x0002c903000000e0 burn # Burn with explicit 4 GUIDs mstflint -d 02:00.0 -i firmware.bin \ --guids 0x0002c903000000e0 0x0002c903000000e1 0x0002c903000000e2 0x0002c903000000e3 burn # Burn with Ethernet MAC addresses mstflint -d 02:00.0 -i firmware.bin --mac 0x0002c90300e0 burn # Burn image using image's own GUIDs (override device GUIDs) mstflint -d 02:00.0 -i firmware.bin --use_image_guids burn ``` -------------------------------- ### Query Firmware Information with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Use the 'mstflint' command to query firmware version, PSID, GUIDs, MAC addresses, and flash type on a Mellanox device. Supports basic and full query modes. ```bash # Query firmware info on a device mstflint -d 02:00.0 q # Output includes: FW version, PSID, GUIDs, MACs, flash type # Full query with extended information mstflint -d 02:00.0 q full ``` -------------------------------- ### INI File Key-Value Declaration Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/index.html Shows the syntax for declaring key-value pairs within an INI file section. Comments are optional and start with a semicolon. ```ini Key = value ; comment ``` -------------------------------- ### Get Link Info with Transmitter Parameters Source: https://github.com/mellanox/mstflint/blob/master/man/mstlink.md Retrieve link information including SerDes transmitter parameters for a given device and port. Aids in fine-tuning signal integrity. ```bash mstlink -d -p --show_serdes_tx ``` -------------------------------- ### Get Link Info with BER Counters Source: https://github.com/mellanox/mstflint/blob/master/man/mstlink.md Fetch detailed link information along with Bit Error Rate (BER) counters for a specified device and port. Useful for diagnosing performance issues. ```bash mstlink -d -p -c ``` -------------------------------- ### Show all available configuration parameters Source: https://context7.com/mellanox/mstflint/llms.txt Displays all configuration parameters available for the specific device type. ```bash mstconfig -d 04:00.0 i show_confs ``` -------------------------------- ### Apply a binary configuration file with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Applies a binary configuration file to the device. ```bash mstconfig apply config.bin ``` -------------------------------- ### Query configurations with default and current values shown Source: https://context7.com/mellanox/mstflint/llms.txt Queries a device for its configurations, displaying both default and current values. ```bash mstconfig -d 04:00.0 -e query ``` -------------------------------- ### iniparser_getstring Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/globals_func.html Gets a string value from the INI dictionary. ```APIDOC ## iniparser_getstring ### Description Gets a string value from the INI dictionary. ### Signature `char *iniparser_getstring(dictionary *ini, const char *key, char *def)` ### Parameters * `ini` (dictionary *) - Pointer to the INI dictionary. * `key` (const char *) - The key of the string value. * `def` (char *) - Default value to return if the key is not found. ### Returns Returns the string value or the default value. ``` -------------------------------- ### iniparser_getsecname Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/globals_func.html Gets the name of a section at a given index. ```APIDOC ## iniparser_getsecname ### Description Gets the name of a section at a given index. ### Signature `const char *iniparser_getsecname(dictionary *ini, int n)` ### Parameters * `ini` (dictionary *) - Pointer to the INI dictionary. * `n` (int) - The index of the section. ### Returns Returns the name of the section or NULL if the index is out of bounds. ``` -------------------------------- ### Create MFA2 Firmware Archive with mstarchive Source: https://context7.com/mellanox/mstflint/llms.txt Create an MFA2 (Multi-Firmware Archive version 2) file. This bundles multiple firmware binary files for different adapter variants into a single archive. ```bash mstarchive \ --version 1.2.3 \ --bins-dir /opt/fw_binaries/ \ --out-file mellanox_fw_bundle.mfa2 ``` -------------------------------- ### iniparser_getnsec Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/globals_func.html Gets the number of sections in the INI dictionary. ```APIDOC ## iniparser_getnsec ### Description Gets the number of sections in the INI dictionary. ### Signature `int iniparser_getnsec(dictionary *ini)` ### Parameters * `ini` (dictionary *) - Pointer to the INI dictionary. ### Returns Returns the number of sections. ``` -------------------------------- ### Show general device info with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Displays general information about the Mellanox device. ```bash mstlink -d 04:00.0 --show_device ``` -------------------------------- ### iniparser_getint Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/globals_func.html Gets an integer value from the INI dictionary. ```APIDOC ## iniparser_getint ### Description Gets an integer value from the INI dictionary. ### Signature `int iniparser_getint(dictionary *ini, const char *key, int def)` ### Parameters * `ini` (dictionary *) - Pointer to the INI dictionary. * `key` (const char *) - The key of the integer value. * `def` (int) - Default value to return if the key is not found. ### Returns Returns the integer value or the default value. ``` -------------------------------- ### iniparser_getdouble Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/globals_func.html Gets a double value from the INI dictionary. ```APIDOC ## iniparser_getdouble ### Description Gets a double value from the INI dictionary. ### Signature `double iniparser_getdouble(dictionary *ini, const char *key, double def)` ### Parameters * `ini` (dictionary *) - Pointer to the INI dictionary. * `key` (const char *) - The key of the double value. * `def` (double) - Default value to return if the key is not found. ### Returns Returns the double value or the default value. ``` -------------------------------- ### Backup device configuration with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Backs up the current device configuration to a raw file. Supported on ConnectIB/ConnectX4/LX devices only. ```bash mstconfig -d 04:00.0 backup -o config_backup.raw ``` -------------------------------- ### Set raw configuration from a file with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Applies raw configuration settings to a device from a specified file. This is supported on ConnectIB/ConnectX4/ConnectX4-LX devices only. ```bash mstconfig -d 05:00.0 -f conf_file.raw set_raw ``` -------------------------------- ### iniparser_getboolean Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/globals_func.html Gets a boolean value from the INI dictionary. ```APIDOC ## iniparser_getboolean ### Description Gets a boolean value from the INI dictionary. ### Signature `int iniparser_getboolean(dictionary *ini, const char *key, int def)` ### Parameters * `ini` (dictionary *) - Pointer to the INI dictionary. * `key` (const char *) - The key of the boolean value. * `def` (int) - Default value to return if the key is not found. ### Returns Returns the boolean value (1 for true, 0 for false) or the default value. ``` -------------------------------- ### Get Register Value with mstreg Source: https://context7.com/mellanox/mstflint/llms.txt Retrieve the value of a specific register by name, including its indexes. Values are expected in hexadecimal. ```bash mstreg -d 04:00.0 --get --reg_name PAOS --indexes "local_port=0x1,swid=0x5" ``` -------------------------------- ### Query all supported configurations with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Queries a device to display all supported non-volatile configuration parameters. ```bash mstconfig -d 04:00.0 query ``` -------------------------------- ### Generate binary config file from XML with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Creates a binary configuration file from an XML configuration file. ```bash mstconfig xml2bin config.xml config.bin ``` -------------------------------- ### Convert raw binary back to XML with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Converts a raw binary configuration file back into an XML format. ```bash mstconfig raw2xml config.raw config.xml ``` -------------------------------- ### Get register value with indexes Source: https://github.com/mellanox/mstflint/blob/master/man/mstreg.md Retrieve the value of a register, specifying its name and relevant indexes. This is useful for accessing specific data points within a register. ```bash mstreg -d --get --reg_name PAOS --indexes "local_port=0x1,swid=0x5" ``` -------------------------------- ### Enable SR-IOV and WoL with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Sets multiple non-volatile configurations on a device, including enabling SR-IOV with a specified number of VFs and enabling WoL on a specific port. ```bash mstconfig -d 04:00.0 set SRIOV_EN=1 NUM_OF_VFS=16 WOL_MAGIC_EN_P1=1 ``` -------------------------------- ### Read Block from Configuration Register with mstmcra Source: https://context7.com/mellanox/mstflint/llms.txt Read a block of data (in bytes) starting from a specific memory address. Specify the address and the number of bytes to read. ```bash mstmcra 02:00.0 0xf0014,16 ``` -------------------------------- ### INI File Comment Lines Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/index.html Describes the different ways comments can be represented in an INI file: lines starting with '#', blank lines, and inline comments after a semicolon. ```ini # This is a comment line ; This is also a comment ``` -------------------------------- ### Dump All VPD Fields with mstvpd Source: https://context7.com/mellanox/mstflint/llms.txt Read and display all Vital Product Data (VPD) fields from an InfiniBand device. ```bash mstvpd mlx5_0 ``` -------------------------------- ### Download default FW package with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Downloads the default firmware package for a specified operating system and type to a given directory. ```bash mstfwmanager --download-default --download-os Linux_x64 --download-type self_extractor --download /tmp/fw_download/ ``` -------------------------------- ### Show full link info with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Displays comprehensive link status information for a specific device port. ```bash mstlink -d 04:00.0 -p 1 ``` -------------------------------- ### Get Integer Value from INI Dictionary Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/index.html Retrieves the integer value associated with a given key from the parsed INI dictionary. The value is converted from its string representation to an integer. ```c int value = iniparser_getint(ini, "database:port", 0); ``` -------------------------------- ### Query devices with XML output using mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Queries Mellanox devices and formats the output as XML. ```bash mstfwmanager --query --query-format XML ``` -------------------------------- ### Get String Value from INI Dictionary Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/index.html Retrieves the string value associated with a given key from the parsed INI dictionary. Keys are case-insensitive and formatted as 'section:keyword'. ```c char *value = iniparser_getstring(ini, "pizza:cheese", NULL); ``` -------------------------------- ### Show all available access registers Source: https://github.com/mellanox/mstflint/blob/master/man/mstreg.md Use this command to list all accessible registers for a specified device. Ensure the device is correctly identified. ```bash mstreg -d --show_regs ``` -------------------------------- ### Show eye opening measurements with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Displays eye opening measurements for a specific device port, indicating signal quality. ```bash mstlink -d 04:00.0 -p 1 -e ``` -------------------------------- ### Sign Firmware Images with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Sign firmware images for FS3/FS4 secure boot using a private key and key UUID, or sign with HMAC for FS4. Also includes setting public keys and forbidden firmware versions. ```bash # Sign a firmware image file (FS3/FS4 secure boot) mstflint -i firmware.bin --private_key rsa_key.pem --key_uuid key_uuid.bin sign # Sign with HMAC (FS4 only) mstflint -i firmware.bin --hmac_key hmac_key.bin sign_with_hmac # Set public keys in firmware image mstflint -i firmware.bin set_public_keys public_keys.bin # Set forbidden firmware versions mstflint -i firmware.bin set_forbidden_versions forbidden.bin ``` -------------------------------- ### Restore device configuration with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Restores a device configuration from a previously backed-up raw file. ```bash mstconfig -d 04:00.0 -f config_backup.raw set_raw ``` -------------------------------- ### Convert XML config to raw binary with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Converts an XML configuration file into a raw binary format. ```bash mstconfig xml2raw config.xml config.raw ``` -------------------------------- ### Update firmware from a directory of images with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Updates a device's firmware using image files located in a specified directory. ```bash mstfwmanager -d 04:00.0 -D /opt/mellanox/fw/ -u ``` -------------------------------- ### Download MFA type package with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Downloads a firmware package of type MFA to the specified directory. ```bash mstfwmanager --download-default --download-type MFA --download /tmp/fw_download/ ``` -------------------------------- ### Configure Loopback Mode with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Configure PHY, external, or disable loopback mode on a specified port. ```bash mstlink -d 04:00.0 -p 1 --loopback PH ``` ```bash mstlink -d 04:00.0 -p 1 --loopback EX ``` ```bash mstlink -d 04:00.0 -p 1 --loopback NO ``` -------------------------------- ### Query Congestion Settings with mstcongestion Source: https://context7.com/mellanox/mstflint/llms.txt Query the current congestion control settings for a specific device. Use the -q flag for querying. ```bash mstcongestion -d 04:00.0 -q ``` -------------------------------- ### Query online PSID-based FW info with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Queries online firmware information based on provided PSID (Platform Specific ID) values. ```bash mstfwmanager --online-query-psid MT_0000000228,MT_0000000229 ``` -------------------------------- ### Access VPD by Sysfs Path with mstvpd Source: https://context7.com/mellanox/mstflint/llms.txt Read and display Vital Product Data (VPD) by accessing the device's sysfs path. ```bash mstvpd /sys/class/infiniband/mlx4_0/device ``` -------------------------------- ### Dump flash configuration file with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Use this command to dump the current flash configuration of a device to a specified file. ```bash mstflint -d 02:00.0 dc dump_config.ini ``` -------------------------------- ### Perform Live-Patch Reset (Level 0) with mstfwreset Source: https://context7.com/mellanox/mstflint/llms.txt Perform a live-patch reset (level 0) where the driver, PCI, and network link remain active. This minimizes disruption. ```bash mstfwreset -d 04:00.0 --level 0 reset ``` -------------------------------- ### List Access Registers with mstreg Source: https://context7.com/mellanox/mstflint/llms.txt List all available hardware access registers for a given device. ```bash mstreg -d 04:00.0 --show_regs ``` -------------------------------- ### Read Firmware Image from Flash with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Read the current firmware image from the device's flash memory and save it to a file. ```bash # Read firmware image from flash to file mstflint -d 02:00.0 ri saved_fw.bin ``` -------------------------------- ### Generate TLV list file with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Generates a file containing a list of all TLVs (Type-Length-Value) for device configurations. ```bash mstconfig gen_tlvs_file tlvs_list.txt ``` -------------------------------- ### Query all Mellanox devices with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Scans the system and lists all detected Mellanox devices. ```bash mstfwmanager --query ``` -------------------------------- ### Show module info with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Retrieves and displays detailed information about the transceiver or cable module connected to a device port. ```bash mstlink -d 04:00.0 -p 1 -m ``` -------------------------------- ### Perform Checksum and Query Timestamp with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Calculate the MD5 checksum of the firmware on the device's flash and query or set the firmware timestamp. ```bash # Perform MD5 checksum on flash firmware mstflint -d 02:00.0 checksum # Query firmware timestamp mstflint -d 02:00.0 timestamp query # Set firmware timestamp mstflint -d 02:00.0 timestamp set 2024-01-15T10:30:00 4.28.0 ``` -------------------------------- ### Perform PRBS Tuning with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Initiate PRBS tuning on the specified port. ```bash mstlink -d 04:00.0 -p 1 --test_mode TU ``` -------------------------------- ### Print Real Timestamps with mstfwtrace Source: https://context7.com/mellanox/mstflint/llms.txt Display firmware trace messages with real timestamps in streaming mode. ```bash mstfwtrace -d 04:00.0 --tracer_mode MEM --real_ts --stream ``` -------------------------------- ### Reactivate previous image with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Reactivates the previously loaded firmware image on FW-controlled devices. ```bash mstflint -d 02:00.0 image_reactivate ``` -------------------------------- ### Run mstfwtrace in Streaming Mode Source: https://context7.com/mellanox/mstflint/llms.txt Execute mstfwtrace in streaming mode for continuous output of firmware trace messages. ```bash mstfwtrace -d 04:00.0 --tracer_mode MEM --stream ``` -------------------------------- ### Manage Option ROMs with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Commands to burn an Option ROM image, remove an existing ROM, or read an Option ROM from the device's flash memory. ```bash # Burn ROM option ROM to device mstflint -d 02:00.0 brom pxe_rom.bin # Remove ROM from flash mstflint -d 02:00.0 drom # Read ROM from flash mstflint -d 02:00.0 rrom rom_backup.bin ``` -------------------------------- ### Generate XML template from TLV list with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Creates an XML template file from a given list of TLVs. ```bash mstconfig gen_xml_template tlvs_list.txt output_template.xml ``` -------------------------------- ### Query HW info and flash attributes with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Retrieves hardware information and flash attributes for the specified device. ```bash mstflint -d 02:00.0 hw query ``` -------------------------------- ### Dump Raw VPD Bytes with mstvpd Source: https://context7.com/mellanox/mstflint/llms.txt Output the raw Vital Product Data (VPD) bytes from an InfiniBand device to standard output. ```bash mstvpd -m mlx5_0 ``` -------------------------------- ### List contents of MFA2 firmware archive with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Lists the files contained within an MFA2 firmware archive without extracting them. ```bash mstfwmanager -m firmware.mfa2 -l ``` -------------------------------- ### Execute Default Reset with mstfwreset Source: https://context7.com/mellanox/mstflint/llms.txt Perform a default reset on the device. The tool automatically selects the minimum required reset level. ```bash mstfwreset -d 04:00.0 reset ``` -------------------------------- ### Configure SerDes TX Parameters with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Configure SerDes TX parameters for all lanes and optionally save to the database. Specify the lane index for fine-tuning. ```bash mstlink -d 04:00.0 -p 1 \ --serdes_tx 0,10,0,-4,20,0 \ --serdes_tx_lane 2 \ --database ``` -------------------------------- ### Configure port speeds with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Sets the allowed link speeds for a specific device port. Multiple speeds can be specified as a comma-separated list. ```bash mstlink -d 04:00.0 -p 1 --speeds 25G,50G,100G ``` -------------------------------- ### Write update log to file with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Performs a firmware update and writes the update log to a specified file. ```bash mstfwmanager -u -L /var/log/fw_update.log ``` -------------------------------- ### Perform Cold Reboot (Level 5) with mstfwreset Source: https://context7.com/mellanox/mstflint/llms.txt Execute a cold reboot (level 5) on the device. This performs a full system restart. ```bash mstfwreset -d 04:00.0 --level 5 reset ``` -------------------------------- ### INI File Section Declaration Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/index.html Demonstrates the syntax for declaring sections in an INI file. Section names are enclosed in square brackets. ```ini [Section Name] ``` -------------------------------- ### Execute Non-Interactive Reset at Level 3 with mstfwreset Source: https://context7.com/mellanox/mstflint/llms.txt Execute a reset at level 3 (driver restart + PCI reset) without user interaction. Use the --yes flag for non-interactive execution. ```bash mstfwreset -d 04:00.0 --level 3 --yes reset ``` -------------------------------- ### Reset all configurations to factory defaults with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Resets all non-volatile configurations on a device back to their factory default settings. ```bash mstconfig -d 04:00.0 reset ``` -------------------------------- ### Show link info with BER counters using mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Displays link status information along with Bit Error Rate (BER) counters for a device port. ```bash mstlink -d 04:00.0 -p 1 -c ``` -------------------------------- ### Configure Port Speeds Source: https://github.com/mellanox/mstflint/blob/master/man/mstlink.md Set the desired data transfer speeds for a port, accepting a comma-separated list of speeds. Use this to optimize bandwidth or compatibility. ```bash mstlink -d -p --speeds 25G,50G,100G ``` -------------------------------- ### Parse YAML and Access Data in C++ Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/mini-yaml/README.md Demonstrates parsing a YAML file and accessing scalar values and nested list items. Ensure the YAML file is correctly formatted. ```yaml key: foo bar list: - hello world - integer: 123 boolean: true ``` ```cpp Yaml::Node root; Yaml::Parse(root, "file.txt"); // Print all scalars. std::cout << root["key"].As() << std::endl; std::cout << root["list"][0].As() << std::endl; std::cout << root["list"][1]["integer"].As() << std::endl; std::cout << root["list"][1]["boolean"].As() << std::endl; // Iterate second sequence item. Node & item = root[1]; for(auto it = item.Begin(); it != item.End(); it++) { std::cout << (*it).first << ": " << (*it).second.As() << std::endl; } ``` -------------------------------- ### Parse MFA2 Firmware Archive with mstarchive Source: https://context7.com/mellanox/mstflint/llms.txt Parse and inspect the contents of an existing MFA2 archive file. This allows you to view the bundled firmware versions and variants. ```bash mstarchive --mfa2-file mellanox_fw_bundle.mfa2 ``` -------------------------------- ### PCIe Link Diagnostics with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Display PCIe link information or detailed PCIe index and node information. ```bash mstlink -d 04:00.0 --port_type PCIE --show_links ``` ```bash mstlink -d 04:00.0 --port_type PCIE --depth 1 --pcie_index 0 --node 0 ``` -------------------------------- ### Set Trace Level with mstfwtrace Source: https://context7.com/mellanox/mstflint/llms.txt Set the trace level for firmware message extraction. ```bash mstfwtrace -d 04:00.0 --tracer_mode MEM --level 2 ``` -------------------------------- ### Extract Traces in MEM Mode with mstfwtrace Source: https://context7.com/mellanox/mstflint/llms.txt Extract firmware trace messages from a device using the MEM tracer mode. ```bash mstfwtrace -d 04:00.0 --tracer_mode MEM ``` -------------------------------- ### Link Library in Compile Command Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/index.html Demonstrates how to link the compiled iniparser library to your C program during the compilation process. Use the '-l' flag followed by the library name. ```bash -liniparser.a ``` -------------------------------- ### Query Supported Reset Levels with mstfwreset Source: https://context7.com/mellanox/mstflint/llms.txt Query the supported reset levels for a specific device. This helps in understanding the available reset options before performing a reset. ```bash mstfwreset -d 04:00.0 query ``` -------------------------------- ### Non-interactive set with mstconfig Source: https://context7.com/mellanox/mstflint/llms.txt Sets device configurations without prompting for confirmation. Use with caution. ```bash mstconfig -d 04:00.0 -y set SRIOV_EN=1 NUM_OF_VFS=8 ``` -------------------------------- ### Set port state with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Controls the state of a device port, allowing it to be set to UP, DOWN, or TOGGLE. ```bash mstlink -d 04:00.0 -p 1 --port_state UP ``` ```bash mstlink -d 04:00.0 -p 1 --port_state DN ``` ```bash mstlink -d 04:00.0 -p 1 --port_state TG ``` -------------------------------- ### Show SerDes transmitter parameters with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Displays the SerDes (Serializer/Deserializer) transmitter parameters for a given device port. ```bash mstlink -d 04:00.0 -p 1 --show_serdes_tx ``` -------------------------------- ### Use External ADB File with mstreg Source: https://context7.com/mellanox/mstflint/llms.txt Define register access using an external ADB file, specifying the register name and indexes. ```bash mstreg -d 04:00.0 --adb_file /path/to/custom.adb --get --reg_name PMLP \ --indexes "local_port=0x1" ``` -------------------------------- ### Update a specific device with a specific firmware image Source: https://context7.com/mellanox/mstflint/llms.txt Updates the firmware of a single device using a specified firmware image file. ```bash mstfwmanager -d 04:00.0 -i fw-ConnectX5-rel-16_35_1012.bin -u ``` -------------------------------- ### Enable PRBS Physical Test Mode with mstlink Source: https://context7.com/mellanox/mstflint/llms.txt Enable PRBS test mode with specified RX and TX PRBS patterns and rates. ```bash mstlink -d 04:00.0 -p 1 --test_mode EN \ --rx_prbs PRBS31 --rx_rate 25G \ --tx_prbs PRBS7 --tx_rate 10G ``` -------------------------------- ### Update all devices from NVIDIA server with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Updates firmware on all Mellanox devices by downloading the latest packages directly from the NVIDIA online server. ```bash mstfwmanager --online -u ``` -------------------------------- ### Set Congestion Mode to Dynamic with Mark Action using mstcongestion Source: https://context7.com/mellanox/mstflint/llms.txt Configure congestion handling to 'dynamic' mode with a 'mark' action. This allows for more adaptive congestion management. ```bash mstcongestion -d 04:00.0 --mode dynamic --action mark ``` -------------------------------- ### Dump VPD from PCI Address with mstvpd Source: https://context7.com/mellanox/mstflint/llms.txt Read and display Vital Product Data (VPD) from a device specified by its PCI address. ```bash mstvpd 02:00.0 ``` -------------------------------- ### Filter VPD Fields with mstvpd Source: https://context7.com/mellanox/mstflint/llms.txt Display only specific Vital Product Data (VPD) fields (e.g., PN, ID, SN) from an InfiniBand device. ```bash mstvpd mlx5_0 -- PN ID SN ``` -------------------------------- ### Read a block of flash bytes to file with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Reads a specified number of bytes from a given flash address and saves them to a binary file. ```bash mstflint -d 02:00.0 rb 0x00000000 256 block_out.bin ``` -------------------------------- ### Include Header File in C Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/iniParser/html/index.html Shows the necessary include directive to use the iniParser library in a C program. Ensure the header file is accessible. ```c #include "iniparser.h" ``` -------------------------------- ### Skip Driver Restart during Reset with mstfwreset Source: https://context7.com/mellanox/mstflint/llms.txt Perform a reset at level 3 while skipping the driver start/stop process. This is useful if you manage the driver manually. ```bash mstfwreset -d 04:00.0 --level 3 --skip_driver reset ``` -------------------------------- ### C++ Reference vs. Copy for YAML Nodes Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/mini-yaml/README.md Illustrates the difference between using references and copies when modifying YAML nodes. Modifying a reference affects the original node, while modifying a copy does not. ```cpp Yaml::Node root; Yaml::Node & ref = root; // The content of "root" is not being copied. ref["key"] = "value"; // Modifying "root" node content. Yaml::Node copy = root; // The content of "root" is copied to "copy". // Slow operation if "root" contains a lot of content. copy["key"] = "value"; // Modifying "copy" node content. "root" is left untouched. ``` -------------------------------- ### UUID Generation and Manipulation Source: https://github.com/mellanox/mstflint/blob/master/ext_libs/sole/README.md Demonstrates the usage of the Sole library for generating UUIDs of different versions and rebuilding them from strings. ```APIDOC ## Public API - `sole::uuid` 128-bit UUID base type that allows comparison and sorting. `std::ostream <<` friendly. `.str()` to get a cooked hex string. `.base62()` to get a cooked base62 string. `.pretty()` to get a pretty decomposed report. - `sole::uuid0()` creates an UUID v0. - `sole::uuid1()` creates an UUID v1. - `sole::uuid4()` creates an UUID v4. - `sole::rebuild()` rebuilds an UUID from given string or 64-bit tuple. ### Showcase ```c++ ~sole> cat sample.cc #include #include "sole.hpp" int main() { sole::uuid u0 = sole::uuid0(), u1 = sole::uuid1(), u4 = sole::uuid4(); std::cout << "uuid v0 string : " << u0 << std::endl; std::cout << "uuid v0 base62 : " << u0.base62() << std::endl; std::cout << "uuid v0 pretty : " << u0.pretty() << std::endl << std::endl; std::cout << "uuid v1 string : " << u1 << std::endl; std::cout << "uuid v1 base62 : " << u1.base62() << std::endl; std::cout << "uuid v1 pretty : " << u1.pretty() << std::endl << std::endl; std::cout << "uuid v4 string : " << u4 << std::endl; std::cout << "uuid v4 base62 : " << u4.base62() << std::endl; std::cout << "uuid v4 pretty : " << u4.pretty() << std::endl << std::endl; u1 = sole::rebuild("F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6"); std::cout << "uuid v1 rebuilt: " << u1 << " -> " << u1.pretty() << std::endl; u4 = sole::rebuild("GITheR4tLlg-BagIW20DGja"); std::cout << "uuid v4 rebuilt: " << u4 << " -> " << u4.pretty() << std::endl; } ~sole> g++ sample.cc -std=c++11 -lrt && ./a.out uuid v0 string : 00aed2f9-c5f8-0030-0fd8-00ffb77bd832 uuid v0 base62 : 3dNJHWv0aW-1MKpXy7mEmf uuid v0 pretty : version=0,timestamp="03/07/2013 12:19:43",mac=00ffb77bd832,pid=4056, uuid v1 string : 14314b83-e3ca-11e2-8b83-00ffb77bd832 uuid v1 base62 : 1jU2TXBD9t4-BycINxiP5Jh uuid v1 pretty : version=1,timestamp="03/07/2013 12:19:43",mac=00ffb77bd832,clock_seq=2947, uuid v4 string : fa237b32-d580-42db-aeb9-b09a1d90067e uuid v4 base62 : LTTsO5t3jMR-F03eZqkMchC uuid v4 pretty : version=4,randbits=fa237b32d58002db2eb9b09a1d90067e, uuid v1 rebuilt : f81d4fae-7dec-11d0-a765-00a0c91e6bf6 -> version=1,timestamp="03/02/1997 18:43:12",mac=00a0c91e6bf6,clock_seq=10085, uuid v4 rebuilt : bdd55e2f-6f6b-4088-8703-ddedba9456a2 -> version=4,randbits=bdd55e2f6f6b0088703ddedba9456a2, ``` ``` -------------------------------- ### Configure Transmitter Parameters Source: https://github.com/mellanox/mstflint/blob/master/man/mstlink.md Set specific transmitter parameters such as polarity, tap values, and bias for a port. This can be done for a specific lane and saved to the database. ```bash mstlink -d -p --serdes_tx ,,,,, (--serdes_tx_lane ) (--database) ``` -------------------------------- ### Show fields of a specific register Source: https://github.com/mellanox/mstflint/blob/master/man/mstreg.md To view the detailed fields and attributes of a particular register, provide its name. This helps in understanding the register's structure. ```bash mstreg -d --show_reg PAOS ``` -------------------------------- ### Set Timeout for VPD Read with mstvpd Source: https://context7.com/mellanox/mstflint/llms.txt Set a custom timeout in seconds for reading Vital Product Data (VPD) from the specified InfiniBand device. ```bash mstvpd -t 60 mlx5_0 ``` -------------------------------- ### Dump Registers using IB Device Name with mstregdump Source: https://context7.com/mellanox/mstflint/llms.txt Dump internal configuration registers of a Mellanox device using its InfiniBand device name. ```bash mstregdump mlx5_0 > dumpfile.log ``` -------------------------------- ### Perform Warm Reboot (Level 4) with mstfwreset Source: https://context7.com/mellanox/mstflint/llms.txt Execute a warm reboot (level 4) on the device. This is a less disruptive reboot than a cold reboot. ```bash mstfwreset -d 04:00.0 --level 4 reset ``` -------------------------------- ### Force firmware update with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Forces a firmware update on a specific device, even if the new firmware version is the same or older than the current one. ```bash mstfwmanager -d 04:00.0 -i firmware.bin -f -u ``` -------------------------------- ### Query a specific device with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Queries the firmware status of a specific Mellanox device identified by its address. ```bash mstfwmanager -d 04:00.0 --query ``` -------------------------------- ### Show Register Fields with mstreg Source: https://context7.com/mellanox/mstflint/llms.txt Display all fields and attributes of a specific register by its name. ```bash mstreg -d 04:00.0 --show_reg PAOS ``` -------------------------------- ### Verify Flash Image Integrity with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt Verify the integrity of the firmware image stored on the device's flash memory. Optionally display ITOC headers for FS3/FS4 firmware. ```bash # Verify flash image integrity (optionally show ITOC headers for FS3/FS4) mstflint -d 02:00.0 v mstflint -d 02:00.0 v showitoc ``` -------------------------------- ### Filter Traces by Class with mstfwtrace Source: https://context7.com/mellanox/mstflint/llms.txt Filter firmware trace messages by specifying one or more trace classes. ```bash mstfwtrace -d 04:00.0 --tracer_mode MEM -m INIT+ICM+CMD_IF ``` -------------------------------- ### Read VPD Data from Stdin with mstvpd Source: https://context7.com/mellanox/mstflint/llms.txt Read Vital Product Data (VPD) from standard input, typically by piping from a file. ```bash cat vpd_data.bin | mstvpd - ``` -------------------------------- ### Ignore Old Events with mstfwtrace Source: https://context7.com/mellanox/mstflint/llms.txt In streaming mode, ignore old buffered firmware events and only display new ones. ```bash mstfwtrace -d 04:00.0 --tracer_mode MEM --stream --ignore_old_events ``` -------------------------------- ### Query Host Privilege Status with mstprivhost Source: https://context7.com/mellanox/mstflint/llms.txt Query the current host privilege status for a multi-host device like a BlueField DPU. This shows which host (x86 or ARM) has privilege. ```bash mstprivhost -d 04:00.0 ``` -------------------------------- ### Configure Port for Physical Test Mode Source: https://github.com/mellanox/mstflint/blob/master/man/mstlink.md Enable Physical Test Mode on a port, configuring PRBS settings and lane rates. This is used for link testing and validation. ```bash mstlink -d -p --test_mode EN (--rx_prbs PRBS31 --rx_rate 25G --tx_prbs PRBS7 --tx_rate 10G) ``` -------------------------------- ### Target Specific iRISC with mstfwtrace Source: https://context7.com/mellanox/mstflint/llms.txt Specify a particular iRISC core to extract firmware traces from; defaults to all cores. ```bash mstfwtrace -d 04:00.0 --tracer_mode MEM --irisc 0 ``` -------------------------------- ### Update firmware of all devices with mstfwmanager Source: https://context7.com/mellanox/mstflint/llms.txt Updates the firmware on all detected Mellanox devices using automatically matched firmware images. ```bash mstfwmanager -u ``` -------------------------------- ### Perform PRBS Tuning Source: https://github.com/mellanox/mstflint/blob/master/man/mstlink.md Initiate PRBS tuning for a port within Physical Test Mode. This command is used to optimize the signal for PRBS testing. ```bash mstlink -d -p --test_mode TU ``` -------------------------------- ### Read/Write raw flash dwords with mstflint Source: https://context7.com/mellanox/mstflint/llms.txt These commands allow reading and writing individual dwords (double words) directly from/to the device's flash memory at a specified address. ```bash mstflint -d 02:00.0 rw 0x00000000 # Read dword at address 0 ``` ```bash mstflint -d 02:00.0 ww 0x00000100 0xDEADBEEF # Write dword ```