3.2. How to Use

3.2.1. SPP Controller

First, run SPP Controller with port numbers for spp primary and secondary.

$ python ./src/spp_vf.py -p 5555 -s 6666

3.2.2. SPP Primary

SPP primary allocates and manages resources for secondary processes. You need to run SPP primary before secondary processes.

SPP primary has two kinds of options for DPDK and spp. Before -- are for DPDK is, and after -- are for spp.

See Running a Sample Application in DPDK documentation for options.

Options of spp primary are:

  • -p : port mask
  • -n : number of rings
  • -s : IPv4 address and port for spp primary

Then, spp primary can be launched like this.

$ sudo ./src/primary/x86_64-native-linuxapp-gcc/spp_primary \
  -c 0x02 -n 4 --socket-mem 512,512 \
  --huge-dir=/run/hugepages/kvm \
  --proc-type=primary \
  -- -p 0x03 -n 9 -s 127.0.0.1:5555

3.2.3. SPP Secondary

spp secondary processes(spp_vf) can be launched with two kinds of options, like primary process.

Like primary process, spp_vf has two kinds of options. One is for DPDK, the other is spp_vf.

spp_vf specific options are:

  • –client-id: client id
  • -s: IPv4 address and port for spp secondary
  • –vhost-client: vhost-user client enable setting

spp_vf can be launched like this.

$ sudo ./src/vf/x86_64-native-linuxapp-gcc/spp_vf \
-c 0x3ffd -n 4 --proc-type=secondary \
-- --client-id 1 -s 127.0.0.1:6666 --vhost-client

If --vhost-client option is specified, then vhost-user act as the client, otherwise the server. For reconnect feature from SPP to VM, --vhost-client option can be used. This reconnect features requires QEMU 2.7 (or later). See also Vhost Sample Application.

3.2.4. VM

Launch VMs with virsh command.

$ virsh start [VM]

3.2.4.1. Additional Network Configurations

To enable processes running on the VM to communicate through spp, it is required additional network configurations on host and guest VMs.

  1. Guest VMs
# Interface for vhost
$ sudo ifconfig [IF_NAME] inet [IP_ADDR] netmask [NETMASK] up

# Disable offload for vhost interface
$ sudo ethtool -K [IF_NAME] tx off
  1. Host2
# Disable offload for VM interface
$ ethtool -K [IF_NAME] tx off