ConnectX-4/Connect-IBのSRIOV+InfiniBandでVFをアップさせる

opensmのmlx5仮想化対応を有効にする

opensm.confに
virt_enabled 2
を追加してopensmを起動。

ファイルがない場合は
opensm --create-config /etc/opensm/opensm.conf
で生成する。

(要Mellanox版 opensm)

HBAのSRIOVを設定する

SRIOV_EN=1
NUM_OF_VFS=8
Connect-IBの場合はFPP_ENがディフォルトでOFFなのでONにする。

mlx5_coreがVFを握らない様にする

options mlx5_core probe_vf=0

mlx5のVFを増やす

echo 4 > /sys/class/infiniband/mlx5_0/device/mlx5_num_vfs

VFのポートステータスがDownなのでPFフォローに変更する

echo Follow > /sys/class/infiniband/mlx5_0/device/sriov/VF番号/policy

(要Mellanox版 OFED)

VFのNode GUIDとPort GUIDが00:00:00:00:00:00:00:00なので値を付ける

echo xx:xx:xx:xx:xx:xx:xx:xx >/sys/class/infiniband/mlx5_0/device/sriov/VF番号/node
echo xx:xx:xx:xx:xx:xx:xx:xx >/sys/class/infiniband/mlx5_0/device/sriov/VF番号/port

(要Mellanox版 OFED)