5.3.7. Persist the SR-IOV Configuration (Recommended)
SR-IOV settings do not persist across reboots. To persist the configuration:
Create a configuration file in
/etc/modprobe.d/to set themax_num_vfsmodule parameter.For example, create
/etc/modprobe.d/hfi1_sriov.confcontaining:options hfi1 max_num_vfs=7Configure a systemd unit or
udevrule to write the desired value tosriov_numvfsat boot.Example systemd service (
/etc/systemd/system/sriov-CN5000.service):[Unit] Description=Enable SR-IOV on CN5000 PF 0000:41:00.0 After=network.target [Service] Type=oneshot ExecStart=/bin/sh -c 'echo 7 > /sys/bus/pci/devices/0000:41:00.0/sriov_numvfs' RemainAfterExit=yes [Install] WantedBy=multi-user.targetEnable the service:
systemctl daemon-reload systemctl enable sriov-cnCN5000.service