191. 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.

191.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 = {

191.2. Test Case1: Split ring virtio-user interrupt test with vhost-user as backend

flow: TG –> NIC –> Vhost –> Virtio

  1. 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
    
  2. 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
    
  3. Send packets with packet generator, check the virtio-user related core can be wakeup status.

  4. Stop sending packets with packet generator, check virtio-user related core change to sleep status.

  5. Restart sending packets with packet generator, check virtio-user related core change to wakeup status again.

191.3. Test Case2: Split ring virtio-user interrupt test with vhost-net as backend

flow: Tap –> Vhost-net –> Virtio

  1. 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
    
  2. 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
    
  3. Check the virtio-user related core can be wake up.

  4. Stop sending packets with tap device, check virtio-user related core change to sleep status.

  5. Restart sending packets with tap device, check virtio-user related core change to wakeup status again.

191.4. Test Case3: LSC event between vhost-user and virtio-user with split ring

flow: Vhost <–> Virtio

  1. 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
    
  2. 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
    
  3. Check the virtio-user side link status:

    testpmd> show port info 0
    #it should show "up"
    
  4. Quit the vhost-user side with testpmd, then check the virtio-user side link status:

    testpmd> show port info 0
    #it should show "down"
    

191.5. Test Case4: Packed ring virtio-user interrupt test with vhost-user as backend

flow: TG –> NIC –> Vhost –> Virtio

  1. 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
    
  2. 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
    
  3. Send packets with packet generator, check the virtio-user related core can be wakeup status.

  4. Stop sending packets with packet generator, check virtio-user related core change to sleep status.

  5. Restart sending packets with packet generator, check virtio-user related core change to wakeup status again.

191.6. Test Case5: Packed ring virtio-user interrupt test with vhost-net as backend with

flow: Tap –> Vhost-net –> Virtio

  1. 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
    
  2. 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
    
  3. Check the virtio-user related core can be wake up.

  4. Stop sending packets with tap device, check virtio-user related core change to sleep status.

  5. Restart sending packets with tap device, check virtio-user related core change to wakeup status again.

191.7. Test Case6: LSC event between vhost-user and virtio-user with packed ring

flow: Vhost <–> Virtio

  1. 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
    
  2. 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
    
  3. Check the virtio-user side link status:

    testpmd> show port info 0
    #it should show "up"
    
  4. Quit the vhost-user side with testpmd, then check the virtio-user side link status:

    testpmd> show port info 0
    #it should show "down"
    

191.8. Test Case7: LSC event between vhost-user and virtio-user with split ring and cbdma enabled

flow: Vhost <–> Virtio

  1. 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
    
  2. 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
    
  3. Check the virtio-user side link status:

    testpmd> show port info 0
    #it should show "up"
    
  4. Quit the vhost-user side with testpmd, then check the virtio-user side link status:

    testpmd> show port info 0
    #it should show "down"
    

191.9. Test Case8: Split ring virtio-user interrupt test with vhost-user as backend and cbdma enabled

flow: TG –> NIC –> Vhost –> Virtio

  1. 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
    
  2. 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
    
  3. Send packets with packet generator, check the virtio-user related core can be wakeup status.

  4. Stop sending packets with packet generator, check virtio-user related core change to sleep status.

  5. Restart sending packets with packet generator, check virtio-user related core change to wakeup status again.