Mellanox: SR-IOV (Single Root IO Virtualization)

Install Mellanox Driver
http://www.panticz.de/mellanox/install-dirver

lspci | grep Mellanox
mstconfig -y -d  18:00.1 set SRIOV_EN=1 NUM_OF_VFS=16
 
#cat /etc/modprobe.d/mlnx.conf 
#options mlx4_core num_vfs=5 probe_vf=5
 
apt install -y sysfsutils
 
cat <<EOF> /etc/sysfs.d/mlnx-sriov_numvfs.conf
class/net/ens6f0/device/sriov_numvfs = 8
class/net/ens6f1/device/sriov_numvfs = 8
class/net/ens7f0/device/sriov_numvfs = 8
class/net/ens7f1/device/sriov_numvfs = 8
EOF
 
# /boot/grub/grub.cf
intel_iommu=on
 
ll /sys/class/net/en{p,s}*
echo 8 > /sys/class/net/ens6f0/device/sriov_numvfs

Configure VLAN

ip link add link ens7f0v6 vlan1234  type vlan id 1234
dhclient -v vlan1234

Configure netplan
http://www.panticz.de/netplan

network:
  version: 2
  renderer: networkd
 
  ethernets:
    eno1:
      dhcp4: yes
    eno2:
      virtual-function-count: 4
    vf1:
      match:
        name: eno2v[0-3]
      dhcp4: no
      #    eno2v0:
      #dhcp4: no
       #mtu: 9000
 
  vlans:
    stage-mgmt:
      id: 3649
      #link: eno2v0
      link: vf1
      dhcp4: yes

OpenStack SR-IOV
https://docs.openstack.org/neutron/latest/admin/config-sriov.html

Links
https://docs.mellanox.com/pages/viewpage.action?pageId=19801751
https://www.mellanox.com/related-docs/prod_software/Mellanox_EN_for_Linux_User_Manual_v3_20.pdf
https://community.mellanox.com/s/article/howto-configure-and-probe-vfs-on-mlx5-drivers
http://bloggf.dannf.org/index.php/2019/10/22/passing-lots-of-pcie-devices-to-a-kvm-guest/