3. Vdev_test

Vdev_test is a simple application that it forwards packets received from rx queue to tx queue on the main core. It can become a secondary process of the spp_primary. It is mainly used for testing spp_pipe but it can be used to test any virtual Ethernet devices as well.

3.1. Usage

vdev_test [EAL options] -- [--send] [--create devargs] device-name

Vdev_test runs foreground and stops when Ctrl-C is pressed. If --send option specified a packet is sent first. The virtual Ethernet device can be created to specify --create option.

Note

Since the device can be created by EAL --vdev option for a primary process, --create option mainly used by a secondary process.

3.2. Examples

3.2.1. Examining spp_pipe

../_images/vdev_test_example_pipe.svg

It is assumed that pipe ports were created beforehand. First run vdev_test without --send option.

# terminal 1
$ sudo vdev_test -l 8 -n 4 --proc-type secondary -- spp_pipe0

Then run vdev_test with --send option on another terminal.

# terminal 2
$ sudo vdev_test -l 9 -n 4 --proc-type secondary -- --send spp_pipe1

Press Ctrl-C to stop processes on both terminals after for a while.

3.2.2. Examining vhost

../_images/vdev_test_example_vhost.svg

This example is independent of SPP. First run vdev_test using eth_vhost0 without --send option.

# terminal 1
$ sudo vdev_test -l 8 -n 4 --vdev eht_vhost0,iface=/tmp/sock0,client=1 \
  --file-prefix=app1 -- eth_vhost0

Then run vdev_test using virtio_user0 with --send option on another terminal.

# terminal 1
$ sudo vdev_test -l 9 -n 4 --vdev virtio_user0,path=/tmp/sock0,server=1 \
  --file-prefix=app2 --single-file-segments -- --send virtio_user0

Press Ctrl-C to stop processes on both terminals after for a while.