Skip to content

Instantly share code, notes, and snippets.

Avatar
🌏
Zzz...

Siyuan Liu koallen

🌏
Zzz...
View GitHub Profile
@koallen
koallen / mlnx_sriov.sh
Last active Apr 4, 2022
Script to enable SRIOV virtual functions on Mellanox cards (https://shawnliu.me/post/configuring-sr-iov-for-mellanox-adapters/)
View mlnx_sriov.sh
#!/bin/bash
# params
# - device name (e.g. mlx5_0)
# - number of virtual functions (e.g. 10)
configure_dev () {
local num_of_vfs="$2"
local devid=$(echo $1 | cut -d_ -f2)
local max_id="0"
local num_vfs_path="/sys/class/infiniband/$1/device/mlx5_num_vfs"