Skip to content

Instantly share code, notes, and snippets.

@avirambh
Created April 14, 2016 19:33
Show Gist options
  • Select an option

  • Save avirambh/08909fe72a3b9cbf397da3b123a753d1 to your computer and use it in GitHub Desktop.

Select an option

Save avirambh/08909fe72a3b9cbf397da3b123a753d1 to your computer and use it in GitHub Desktop.
# Create a file in /etc/infiniband/vfs with content of the form:
ib0 3
enp5s0 12
# and after modules start in openibd:
if [ -f /etc/infiniband/vfs ]; then
while read -r line
do
arrline=($line)
iface=`echo ${arrline[0]}`
num_vfs=`echo ${arrline[1]}`
echo $num_vfs > /sys/class/net/$iface/device/sriov_numvfs
done < "/etc/infiniband/vfs"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment