Skip to content

Latest commit

 

History

History
74 lines (51 loc) · 2.15 KB

README.org

File metadata and controls

74 lines (51 loc) · 2.15 KB

A userspace switch for virtual machines.

Prerequisites

sv3 currently only supports Linux on x86-64 with Qemu/KVM as virtualization layer. It also needs a relatively recent kernel, at least 3.6, but it hasn’t been tested with anything older than 3.9.

Building

Qemu

The switch needs a patched qemu. Build it using:

git submodule init
git submodule update

cd contrib/qemu
./configure --target-list=x86_64-softmmu --enable-kvm --disable-fdt
make

Switch

Execute scons. If you installed prerequisite libraries after you first scons run, you might have to do scons --config=force afterwards.

Usage

Starting a Guest

Start the switch and attach a guest using:

./sv3
# Switch to another terminal
export PATH=$PWD/contrib/qemu/x86_64-softmmu:$PATH
qemu-system-x86_64 -mem-path /tmp -net none -device externalpci,socket=/tmp/sv3 additional-args...

Adding -mem-path /tmp to qemu is important, because it will create files there that serve as backing store for RAM. /tmp should be a tmpfs! If this is not the case, guest RAM will be periodically written to disk.

Creating an Upstream Port

By default, the switch is not connected to the outside world. You need an upstream port to do this. sv3 is able to drive network cards itself, but needs some preparation. Currently, sv3 can drive a single upstream port at a time.

If the PCI ID of the desired network card is 0000:02:00.1 and the user that runs the switch is john, use scripts/vfio-rebind.sh like this:

sudo ./scripts/vfio-rebind.sh 0000:02:00.1 john

This will unload the device’s driver and attach it to VFIO with access rights for john. The script might tell you to rebind unrelated devices as well to make the IOMMU happy.

Currently, sv3 supports Intel 82599 10G “Niantic” NICs (sold as x520).

Known Bugs

  • The switch will segfault, if passed file descriptors point to files that are too short.
  • The switch sometimes segfaults when clients disappear unexpectedly.