201. vhost/virtio-user interrupt mode test plan¶
Virtio-user interrupt need test with l3fwd-power sample, small packets send from traffic generator to virtio side, check virtio-user cores can be wakeup status, and virtio-user cores should be sleep status after stop sending packets from traffic generator.This test plan cover both vhost-net and vhost-user as the backend.
201.1. Prerequisites¶
Modify l3fwd-power example code and recompile:
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -245,10 +245,9 @@ uint16_t nb_lcore_params = RTE_DIM(lcore_params_array_default);
static struct rte_eth_conf port_conf = {
.rxmode = {
- .mq_mode = ETH_MQ_RX_RSS,
+ .mq_mode = ETH_MQ_RX_NONE,
.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
.split_hdr_size = 0,
- .offloads = DEV_RX_OFFLOAD_CHECKSUM,
},
.rx_adv_conf = {
.rss_conf = {
201.2. Test Case1: Split ring virtio-user interrupt test with vhost-user as backend¶
flow: TG –> NIC –> Vhost –> Virtio
Bind one NIC port to igb_uio, launch testpmd with a virtual vhost device as backend:
./testpmd -c 0x7c -n 4 --vdev 'net_vhost0,iface=vhost-net,queues=1' -- -i --rxq=1 --txq=1 testpmd>start
Start l3fwd-power with a virtio-user device:
./l3fwd-power -c 0xc000 -n 4 --log-level='user1,7' --no-pci --file-prefix=l3fwd-pwd \ --vdev=virtio_user0,path=./vhost-net -- -p 1 -P --config="(0,0,14)" --parse-ptype
Send packets with packet generator, check the virtio-user related core can be wakeup status.
Stop sending packets with packet generator, check virtio-user related core change to sleep status.
Restart sending packets with packet generator, check virtio-user related core change to wakeup status again.
201.3. Test Case2: Split ring virtio-user interrupt test with vhost-net as backend¶
flow: Tap –> Vhost-net –> Virtio
Start l3fwd-power with a virtio-user device, vhost-net as backend:
./l3fwd-power -c 0xc000 -n 4 --log-level='user1,7' --no-pci --file-prefix=l3fwd-pwd \ --vdev=virtio_user0,path=/dev/vhost-net -- -p 1 -P --config="(0,0,14)" --parse-ptype
Vhost-net will generate one tap device, normally, it’s TAP0, config it and generate packets on it using pind cmd:
ifconfig tap0 up ifconfig tap0 1.1.1.1 ping -I tap0 1.1.1.2
Check the virtio-user related core can be wake up.
Stop sending packets with tap device, check virtio-user related core change to sleep status.
Restart sending packets with tap device, check virtio-user related core change to wakeup status again.
201.4. Test Case3: LSC event between vhost-user and virtio-user with split ring¶
flow: Vhost <–> Virtio
Start vhost-user side:
./testpmd -c 0x3000 -n 4 --no-pci --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=1,client=0' -- -i testpmd>set fwd mac testpmd>start
Start virtio-user side:
./testpmd -c 0xc000 -n 4 --no-pci --file-prefix=virtio --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net -- -i --tx-offloads=0x00 testpmd>set fwd mac testpmd>start
Check the virtio-user side link status:
testpmd> show port info 0 #it should show "up"
Quit the vhost-user side with testpmd, then check the virtio-user side link status:
testpmd> show port info 0 #it should show "down"
201.5. Test Case4: Packed ring virtio-user interrupt test with vhost-user as backend¶
flow: TG –> NIC –> Vhost –> Virtio
Bind one NIC port to igb_uio, launch testpmd with a virtual vhost device as backend:
./testpmd -c 0x7c -n 4 --vdev 'net_vhost0,iface=vhost-net,queues=1' -- -i --rxq=1 --txq=1 testpmd>start
Start l3fwd-power with a virtio-user device:
./l3fwd-power -c 0xc000 -n 4 --log-level='user1,7' --no-pci --file-prefix=l3fwd-pwd \ --vdev=virtio_user0,path=./vhost-net,packed_vq=1 -- -p 1 -P --config="(0,0,14)" --parse-ptype
Send packets with packet generator, check the virtio-user related core can be wakeup status.
Stop sending packets with packet generator, check virtio-user related core change to sleep status.
Restart sending packets with packet generator, check virtio-user related core change to wakeup status again.
201.6. Test Case5: Packed ring virtio-user interrupt test with vhost-net as backend with¶
flow: Tap –> Vhost-net –> Virtio
Start l3fwd-power with a virtio-user device, vhost-net as backend:
./l3fwd-power -c 0xc000 -n 4 --log-level='user1,7' --no-pci --file-prefix=l3fwd-pwd \ --vdev=virtio_user0,path=/dev/vhost-net,packed_vq=1 -- -p 1 -P --config="(0,0,14)" --parse-ptype
Vhost-net will generate one tap device, normally, it’s TAP0, config it and generate packets on it using pind cmd:
ifconfig tap0 up ifconfig tap0 1.1.1.1 ping -I tap0 1.1.1.2
Check the virtio-user related core can be wake up.
Stop sending packets with tap device, check virtio-user related core change to sleep status.
Restart sending packets with tap device, check virtio-user related core change to wakeup status again.
201.7. Test Case6: LSC event between vhost-user and virtio-user with packed ring¶
flow: Vhost <–> Virtio
Start vhost-user side:
./testpmd -c 0x3000 -n 4 --no-pci --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=1,client=0' -- -i testpmd>set fwd mac testpmd>start
Start virtio-user side:
./testpmd -c 0xc000 -n 4 --no-pci --file-prefix=virtio --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,packed_vq=1 -- -i --tx-offloads=0x00 testpmd>set fwd mac testpmd>start
Check the virtio-user side link status:
testpmd> show port info 0 #it should show "up"
Quit the vhost-user side with testpmd, then check the virtio-user side link status:
testpmd> show port info 0 #it should show "down"
201.8. Test Case7: LSC event between vhost-user and virtio-user with split ring and cbdma enabled¶
flow: Vhost <–> Virtio
Bind one cbdma port to igb_uio driver, then start vhost-user side:
./testpmd -c 0x3000 -n 4 -w 00:04.0 --file-prefix=vhost --vdev 'net_vhost0,iface=vhost-net,queues=1,client=0,dmas=[txq0@00:04.0]' -- -i testpmd>set fwd mac testpmd>start
Start virtio-user side:
./testpmd -c 0xc000 -n 4 --no-pci --file-prefix=virtio --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net -- -i --tx-offloads=0x00 testpmd>set fwd mac testpmd>start
Check the virtio-user side link status:
testpmd> show port info 0 #it should show "up"
Quit the vhost-user side with testpmd, then check the virtio-user side link status:
testpmd> show port info 0 #it should show "down"
201.9. Test Case8: Split ring virtio-user interrupt test with vhost-user as backend and cbdma enabled¶
flow: TG –> NIC –> Vhost –> Virtio
Bind one cbdma port and one NIC port to igb_uio, launch testpmd with a virtual vhost device as backend:
./testpmd -c 0x7c -n 4 --vdev 'net_vhost0,iface=vhost-net,queues=1,dmas=[txq0@00:04.0]' -- -i --rxq=1 --txq=1 testpmd>start
Start l3fwd-power with a virtio-user device:
./l3fwd-power -c 0xc000 -n 4 --log-level='user1,7' --no-pci --file-prefix=l3fwd-pwd \ --vdev=virtio_user0,path=./vhost-net -- -p 1 -P --config="(0,0,14)" --parse-ptype
Send packets with packet generator, check the virtio-user related core can be wakeup status.
Stop sending packets with packet generator, check virtio-user related core change to sleep status.
Restart sending packets with packet generator, check virtio-user related core change to wakeup status again.