From patchwork Wed Oct 7 21:34:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffen Bauch X-Patchwork-Id: 7477 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 64C998D87; Wed, 7 Oct 2015 23:34:43 +0200 (CEST) Received: from minos.steffenbauch.de (minos.steffenbauch.de [91.250.119.163]) by dpdk.org (Postfix) with ESMTP id BB45C68A5 for ; Wed, 7 Oct 2015 23:34:42 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by minos.steffenbauch.de (Postfix) with ESMTP id 62B9460B87 for ; Wed, 7 Oct 2015 23:34:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=steffenbauch.de; h=content-transfer-encoding:content-type:content-type :mime-version:user-agent:date:date:message-id:subject:subject :from:from:received:received; s=main; t=1444253681; x= 1446068082; bh=UD+e71r+OtZF0y+qjsKXMrGjTm/cAVjfqfFnoqJfki8=; b=T HaJa1ARdcPx4CD6uLA1VWGi5fOtf6DfN9qZK+nfdyEydFCaziuCKYce/I86EAsZJ zJfOUaxxUybmyslebCnqqAy71q81ZtEvIu2e14Z4eYp3nI0/1W8w1pIofeeLYJiL zOi/DVsVxM0JDsQHl2O1dWydiCiHkoBgLtCgaTMrfw= Received: from minos.steffenbauch.de ([127.0.0.1]) by localhost (minos.steffenbauch.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id W9WpD9rLT98e for ; Wed, 7 Oct 2015 23:34:41 +0200 (CEST) Received: from [10.1.1.213] (ipb2193648.dynamic.kabel-deutschland.de [178.25.54.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by minos.steffenbauch.de (Postfix) with ESMTPSA id 7196760B44 for ; Wed, 7 Oct 2015 23:34:41 +0200 (CEST) To: dev@dpdk.org From: Steffen Bauch Message-ID: <56158FE8.8090208@steffenbauch.de> Date: Wed, 7 Oct 2015 23:34:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Subject: [dpdk-dev] testpmd hanging using virtualbox and virtio X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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=) 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. 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"); */ } /* diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 465d3cd..e463c54 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -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];