Skip to content

Instantly share code, notes, and snippets.

View koallen's full-sized avatar
🌏
Zzz...

Siyuan Liu koallen

🌏
Zzz...
View GitHub Profile
@koallen
koallen / mlnx_sriov.sh
Last active July 24, 2023 03:41
Script to enable SRIOV virtual functions on Mellanox cards (https://shawnliu.me/post/configuring-sr-iov-for-mellanox-adapters/)
#!/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"