#!/bin/sh # --------------------------------------------------------------- # Mellanox NIC firmware performance tuning for Intel platforms. # # Iterates over all detected Mellanox network devices # and applies selected optimizations. # # Run this once after installing new NIC. # Requires system reboot. # -------------------------------------------------------------- # Enable aggressive CQE Zipping. cqe_compression=1 # Disable relaxed ordering for PCI operations. pci_wr_ordering=0 # Enable DevX. uctx_en=1 devs=$(ls -d /sys/class/net/*/device/infiniband_verbs/uverbs* | cut -d / -f 5) for dev in $devs; do pci_addr=$(grep PCI_SLOT_NAME /sys/class/net/$dev/device/uevent | tail -c +15) echo Device: $dev $pci_addr mstconfig -y -d $pci_addr s \ CQE_COMPRESSION=$cqe_compression \ PCI_WR_ORDERING=$pci_wr_ordering \ UCTX_EN=$uctx_en # Switch link type to Ethernet if supported mstconfig -y -d $pci_addr s LINK_TYPE_P1=2 mstconfig -y -d $pci_addr s LINK_TYPE_P2=2 done