I'm continuing with my tests of the Mellanox/Nvidia ConnectX-6 Dx cards I got.
Over the last days I tested the integrated switching apabilities, called ASAP² by Mellanox. So what is it good for? Providing fast network access to virtual machines.
The conventional methods how this is done for KVM-based VMs on Linux is either a kernel bridge device, MacVTap or regular routing. But as you can see in mybenchmark graph, these methods have quite severe performance limits.
The alternative is Single Root I/O Virtualization (SR-IOV). A network adapter with this capability (nearly all server adapters offer this today) splits out several "virtual function" PCIe-devices. Then the virtual function devices
are made directly accessible to the VMs with the IOMMU of the CPU. It is faster because now the CPU doesn't have to do context switching between the VM and host.
While SR-IOV is available for quite some time now (it was first introduced around 2008), the implementations often had a few downsides:
- no communication between VMs or host and VM
- just basic briding supported, but newer designs often also offer VLAN capability
- no support for bonding two physical network ports with LACP for higher availability
Mellanox have implemented a complete switch ASIC that you can use to hook your physical
ports and SR-IOV virtual functions together. This switch can be controlled with the kernel
switchdev interface and it is able to apply complex switching rules.
As you can see in the light-blue line in my benchmark graph, it is able to do LACP bonding of two physical ports and applying a layer3+4 xmit_hash_policy to utilize both bonded ports. So a VM is hooked up with just one virtual function and doesn't have to care about bonding at all. If either port of the bond is disconnected, the other one is used (I tested this to be really sure it is supported).
This is quite a good feature and something I haven't seen from other vendors.
#networking #mellanox #homelab #virtualization