testpmd hanging using virtualbox and virtio
Hi,
I would like to request help using DPDK, virtualbox and virtio to exchange data between two virtual machines (generator and receiver). To be able to describe my problem I have created a github repository with a sample setup using vagrant.
The setup is using DPDK 2.1.0, uio_pci_generic and rte_virtio_pmd on the generator and the plain kernel virtio-net driver on the receiver.
sb@host ~ $ vagrant --version
Vagrant 1.7.4
sb@host ~ $ virtualbox -h
Oracle VM VirtualBox Manager 4.3.30
[...]
sb@host ~ $ git clone https://github.com/steffenbauch/vagrant-dpdk-virtio-trial.git
sb@host ~ $ cd vagrant-dpdk-virtio-trial/
sb@host ~ $ vagrant up
sb@host ~ $ vagrant ssh generator
vagrant@vagrant-ubuntu-vivid-64:~/$ cd dpdk/x86_64-native-linuxapp-gcc/app
vagrant@vagrant-ubuntu-vivid-64:~/dpdk/x86_64-native-linuxapp-gcc/app$ sudo ./testpmd -b 0000:00:03.0 -c 3 -n 1 -- -i EAL: Detected lcore 0 as core 0 on socket 0 EAL: Detected lcore 1 as core 1 on socket 0 EAL: Support maximum 128 logical core(s) by configuration. EAL: Detected 2 lcore(s) EAL: VFIO modules not all loaded, skip VFIO support... EAL: Setting up physically contiguous memory... EAL: Ask a virtual area of 0x200000 bytes EAL: Virtual area found at 0x7fc5ee600000 (size = 0x200000) EAL: Ask a virtual area of 0x200000 bytes EAL: Virtual area found at 0x7fc5ee200000 (size = 0x200000) EAL: Ask a virtual area of 0x200000 bytes EAL: Virtual area found at 0x7fc5ede00000 (size = 0x200000) EAL: Ask a virtual area of 0x11400000 bytes EAL: Virtual area found at 0x7fc5dc800000 (size = 0x11400000) EAL: Ask a virtual area of 0x2e400000 bytes EAL: Virtual area found at 0x7fc5ae200000 (size = 0x2e400000) EAL: Ask a virtual area of 0x200000 bytes EAL: Virtual area found at 0x7fc5ade00000 (size = 0x200000) EAL: Requesting 512 pages of size 2MB from socket 0 EAL: TSC frequency is ~2195200 KHz EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable clock cycles ! EAL: Master lcore 0 is ready (tid=f03568c0;cpuset=[0]) EAL: lcore 1 is ready (tid=addff700;cpuset=[1]) EAL: PCI device 0000:00:03.0 on NUMA socket -1 EAL: probe driver: 1af4:1000 rte_virtio_pmd EAL: Device is blacklisted, not initializing EAL: PCI device 0000:00:08.0 on NUMA socket -1 EAL: probe driver: 1af4:1000 rte_virtio_pmd EAL: PCI device 0000:00:09.0 on NUMA socket -1 EAL: probe driver: 1af4:1000 rte_virtio_pmd Interactive-mode selected Configuring Port 0 (socket 0)
[blocking]
At this point the process is hanging and not progressing towards the command line prompt.
I attached with gdb to the process and identified the configuration of the promiscious mode as the hanging call
(gdb) bt
#0 0x00007fc5ef50ec4d in nanosleep () at ../sysdeps/unix/syscall-template.S:81 #1 0x00007fc5ef541e84 in usleep (useconds=<optimized out>) at ../sysdeps/unix/sysv/linux/usleep.c:32 #2 0x00000000004e857d in virtio_dev_promiscuous_disable () #3 0x00000000004b5daf in rte_eth_dev_start () #4 0x0000000000435df0 in start_port () #5 0x0000000000431591 in main ()
Apparently the initialization is hanging sleeping in a while loop in virtio_send_command().
In an experiment I temporarily disabled the functions for setting the promiscous mode and multicast mode and was able to progress to to the command line prompt of testpmd. It was possible to send a burst of 32 frames towards the receiver (using start tx_first).
Due to missing knowledge about the gory details of virtio I can not fix the problem and request help.
drivers/net/virtio/virtio_ethdev.c +12 -12
@@ -462,9 +462,9 @@ virtio_dev_close(struct rte_eth_dev *dev) }static void -virtio_dev_promiscuous_enable (struct rte_eth_dev *dev) +virtio_dev_promiscuous_enable (__attribute__((unused))struct rte_eth_dev *dev) { -struct virtio_hw *hw = dev->data->dev_private; +/* struct virtio_hw *hw = dev->data->dev_private; struct virtio_pmd_ctrl ctrl; int dlen[1]; int ret;
@@ -481,13 +481,13 @@ virtio_dev_promiscuous_enable(struct rte_eth_dev *dev)ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1); if (ret) -PMD_INIT_LOG (ERR ,"Failed to enable promisc" ); +PMD_INIT_LOG(ERR, "Failed to enable promisc"); */ }static void -virtio_dev_promiscuous_disable (struct rte_eth_dev *dev) +virtio_dev_promiscuous_disable (__attribute__((unused))struct rte_eth_dev *dev) { -struct virtio_hw *hw = dev->data->dev_private; +/* struct virtio_hw *hw = dev->data->dev_private; struct virtio_pmd_ctrl ctrl; int dlen[1]; int ret;
@@ -504,13 +504,13 @@ virtio_dev_promiscuous_disable(struct rte_eth_dev *dev)ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1); if (ret) -PMD_INIT_LOG (ERR ,"Failed to disable promisc" ); +PMD_INIT_LOG(ERR, "Failed to disable promisc"); */ }static void -virtio_dev_allmulticast_enable (struct rte_eth_dev *dev) +virtio_dev_allmulticast_enable (__attribute__((unused))struct rte_eth_dev *dev) { -struct virtio_hw *hw = dev->data->dev_private; +/* struct virtio_hw *hw = dev->data->dev_private; struct virtio_pmd_ctrl ctrl; int dlen[1]; int ret;
@@ -527,13 +527,13 @@ virtio_dev_allmulticast_enable(struct rte_eth_dev *dev)ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1); if (ret) -PMD_INIT_LOG (ERR ,"Failed to enable allmulticast" ); +PMD_INIT_LOG(ERR, "Failed to enable allmulticast"); */ }static void -virtio_dev_allmulticast_disable (struct rte_eth_dev *dev) +virtio_dev_allmulticast_disable (__attribute__((unused))struct rte_eth_dev *dev) { -struct virtio_hw *hw = dev->data->dev_private; +/* struct virtio_hw *hw = dev->data->dev_private; struct virtio_pmd_ctrl ctrl; int dlen[1]; int ret;
@@ -550,7 +550,7 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)ret = virtio_send_command(hw->cvq, &ctrl, dlen, 1); if (ret) -PMD_INIT_LOG (ERR ,"Failed to disable allmulticast" ); +PMD_INIT_LOG(ERR, "Failed to disable allmulticast"); */ }/*