15630257fSFerruh Yigit.. SPDX-License-Identifier: BSD-3-Clause 25630257fSFerruh Yigit Copyright(c) 2010-2014 Intel Corporation. 3972e365bSThomas Monjalon 4972e365bSThomas MonjalonDriver for VM Emulated Devices 5972e365bSThomas Monjalon============================== 6972e365bSThomas Monjalon 7972e365bSThomas MonjalonThe DPDK EM poll mode driver supports the following emulated devices: 8972e365bSThomas Monjalon 9972e365bSThomas Monjalon* qemu-kvm emulated Intel® 82540EM Gigabit Ethernet Controller (qemu e1000 device) 10972e365bSThomas Monjalon 11*d2e5ab2bSWilliam Tu* VMware emulated Intel® 82545EM Gigabit Ethernet Controller 12972e365bSThomas Monjalon 13*d2e5ab2bSWilliam Tu* VMware emulated Intel® 82574L Gigabit Ethernet Controller. 14972e365bSThomas Monjalon 15972e365bSThomas MonjalonValidated Hypervisors 16972e365bSThomas Monjalon--------------------- 17972e365bSThomas Monjalon 18972e365bSThomas MonjalonThe validated hypervisors are: 19972e365bSThomas Monjalon 20972e365bSThomas Monjalon* KVM (Kernel Virtual Machine) with Qemu, version 0.14.0 21972e365bSThomas Monjalon 22972e365bSThomas Monjalon* KVM (Kernel Virtual Machine) with Qemu, version 0.15.1 23972e365bSThomas Monjalon 24972e365bSThomas Monjalon* VMware ESXi 5.0, Update 1 25972e365bSThomas Monjalon 26972e365bSThomas MonjalonRecommended Guest Operating System in Virtual Machine 27972e365bSThomas Monjalon----------------------------------------------------- 28972e365bSThomas Monjalon 29972e365bSThomas MonjalonThe recommended guest operating system in a virtualized environment is: 30972e365bSThomas Monjalon 31972e365bSThomas Monjalon* Fedora* 18 (64-bit) 32972e365bSThomas Monjalon 33972e365bSThomas MonjalonFor supported kernel versions, refer to the *DPDK Release Notes*. 34972e365bSThomas Monjalon 35972e365bSThomas MonjalonSetting Up a KVM Virtual Machine 36972e365bSThomas Monjalon-------------------------------- 37972e365bSThomas Monjalon 38972e365bSThomas MonjalonThe following describes a target environment: 39972e365bSThomas Monjalon 40972e365bSThomas Monjalon* Host Operating System: Fedora 14 41972e365bSThomas Monjalon 42972e365bSThomas Monjalon* Hypervisor: KVM (Kernel Virtual Machine) with Qemu version, 0.14.0 43972e365bSThomas Monjalon 44972e365bSThomas Monjalon* Guest Operating System: Fedora 14 45972e365bSThomas Monjalon 46972e365bSThomas Monjalon* Linux Kernel Version: Refer to the DPDK Getting Started Guide 47972e365bSThomas Monjalon 48972e365bSThomas Monjalon* Target Applications: testpmd 49972e365bSThomas Monjalon 50972e365bSThomas MonjalonThe setup procedure is as follows: 51972e365bSThomas Monjalon 52972e365bSThomas Monjalon#. Download qemu-kvm-0.14.0 from 53972e365bSThomas Monjalon `http://sourceforge.net/projects/kvm/files/qemu-kvm/ <http://sourceforge.net/projects/kvm/files/qemu-kvm/>`_ 54972e365bSThomas Monjalon and install it in the Host OS using the following steps: 55972e365bSThomas Monjalon 56972e365bSThomas Monjalon When using a recent kernel (2.6.25+) with kvm modules included: 57972e365bSThomas Monjalon 58972e365bSThomas Monjalon .. code-block:: console 59972e365bSThomas Monjalon 60972e365bSThomas Monjalon tar xzf qemu-kvm-release.tar.gz cd qemu-kvm-release 61972e365bSThomas Monjalon ./configure --prefix=/usr/local/kvm 62972e365bSThomas Monjalon make 63972e365bSThomas Monjalon sudo make install 64972e365bSThomas Monjalon sudo /sbin/modprobe kvm-intel 65972e365bSThomas Monjalon 66972e365bSThomas Monjalon When using an older kernel or a kernel from a distribution without the kvm modules, 67972e365bSThomas Monjalon you must download (from the same link), compile and install the modules yourself: 68972e365bSThomas Monjalon 69972e365bSThomas Monjalon .. code-block:: console 70972e365bSThomas Monjalon 71972e365bSThomas Monjalon tar xjf kvm-kmod-release.tar.bz2 72972e365bSThomas Monjalon cd kvm-kmod-release 73972e365bSThomas Monjalon ./configure 74972e365bSThomas Monjalon make 75972e365bSThomas Monjalon sudo make install 76972e365bSThomas Monjalon sudo /sbin/modprobe kvm-intel 77972e365bSThomas Monjalon 78972e365bSThomas Monjalon Note that qemu-kvm installs in the /usr/local/bin directory. 79972e365bSThomas Monjalon 80972e365bSThomas Monjalon For more details about KVM configuration and usage, please refer to: 81972e365bSThomas Monjalon `http://www.linux-kvm.org/page/HOWTO1 <http://www.linux-kvm.org/page/HOWTO1>`_. 82972e365bSThomas Monjalon 83972e365bSThomas Monjalon#. Create a Virtual Machine and install Fedora 14 on the Virtual Machine. 84972e365bSThomas Monjalon This is referred to as the Guest Operating System (Guest OS). 85972e365bSThomas Monjalon 86972e365bSThomas Monjalon#. Start the Virtual Machine with at least one emulated e1000 device. 87972e365bSThomas Monjalon 88972e365bSThomas Monjalon .. note:: 89972e365bSThomas Monjalon 90972e365bSThomas Monjalon The Qemu provides several choices for the emulated network device backend. 91972e365bSThomas Monjalon Most commonly used is a TAP networking backend that uses a TAP networking device in the host. 92972e365bSThomas Monjalon For more information about Qemu supported networking backends and different options for configuring networking at Qemu, 93972e365bSThomas Monjalon please refer to: 94972e365bSThomas Monjalon 95972e365bSThomas Monjalon — `http://www.linux-kvm.org/page/Networking <http://www.linux-kvm.org/page/Networking>`_ 96972e365bSThomas Monjalon 97972e365bSThomas Monjalon — `http://wiki.qemu.org/Documentation/Networking <http://wiki.qemu.org/Documentation/Networking>`_ 98972e365bSThomas Monjalon 99972e365bSThomas Monjalon — `http://qemu.weilnetz.de/qemu-doc.html <http://qemu.weilnetz.de/qemu-doc.html>`_ 100972e365bSThomas Monjalon 101972e365bSThomas Monjalon For example, to start a VM with two emulated e1000 devices, issue the following command: 102972e365bSThomas Monjalon 103972e365bSThomas Monjalon .. code-block:: console 104972e365bSThomas Monjalon 105972e365bSThomas Monjalon /usr/local/kvm/bin/qemu-system-x86_64 -cpu host -smp 4 -hda qemu1.raw -m 1024 106972e365bSThomas Monjalon -net nic,model=e1000,vlan=1,macaddr=DE:AD:1E:00:00:01 107972e365bSThomas Monjalon -net tap,vlan=1,ifname=tapvm01,script=no,downscript=no 108972e365bSThomas Monjalon -net nic,model=e1000,vlan=2,macaddr=DE:AD:1E:00:00:02 109972e365bSThomas Monjalon -net tap,vlan=2,ifname=tapvm02,script=no,downscript=no 110972e365bSThomas Monjalon 111972e365bSThomas Monjalon where: 112972e365bSThomas Monjalon 113972e365bSThomas Monjalon — -m = memory to assign 114972e365bSThomas Monjalon 115972e365bSThomas Monjalon — -smp = number of smp cores 116972e365bSThomas Monjalon 117972e365bSThomas Monjalon — -hda = virtual disk image 118972e365bSThomas Monjalon 119972e365bSThomas Monjalon This command starts a new virtual machine with two emulated 82540EM devices, 120972e365bSThomas Monjalon backed up with two TAP networking host interfaces, tapvm01 and tapvm02. 121972e365bSThomas Monjalon 122972e365bSThomas Monjalon .. code-block:: console 123972e365bSThomas Monjalon 124972e365bSThomas Monjalon # ip tuntap show 125972e365bSThomas Monjalon tapvm01: tap 126972e365bSThomas Monjalon tapvm02: tap 127972e365bSThomas Monjalon 128972e365bSThomas Monjalon#. Configure your TAP networking interfaces using ip/ifconfig tools. 129972e365bSThomas Monjalon 130972e365bSThomas Monjalon#. Log in to the guest OS and check that the expected emulated devices exist: 131972e365bSThomas Monjalon 132972e365bSThomas Monjalon .. code-block:: console 133972e365bSThomas Monjalon 134972e365bSThomas Monjalon # lspci -d 8086:100e 135972e365bSThomas Monjalon 00:04.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03) 136972e365bSThomas Monjalon 00:05.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03) 137972e365bSThomas Monjalon 138972e365bSThomas Monjalon#. Install the DPDK and run testpmd. 139972e365bSThomas Monjalon 140972e365bSThomas MonjalonKnown Limitations of Emulated Devices 141972e365bSThomas Monjalon------------------------------------- 142972e365bSThomas Monjalon 143972e365bSThomas MonjalonThe following are known limitations: 144972e365bSThomas Monjalon 145972e365bSThomas Monjalon#. The Qemu e1000 RX path does not support multiple descriptors/buffers per packet. 146972e365bSThomas Monjalon Therefore, rte_mbuf should be big enough to hold the whole packet. 147972e365bSThomas Monjalon For example, to allow testpmd to receive jumbo frames, use the following: 148972e365bSThomas Monjalon 149e3f15be4SSarosh Arif dpdk-testpmd [options] -- --mbuf-size=<your-max-packet-size> 150972e365bSThomas Monjalon 151972e365bSThomas Monjalon#. Qemu e1000 does not validate the checksum of incoming packets. 152715e9654SYong Liu 153715e9654SYong Liu#. Qemu e1000 only supports one interrupt source, so link and Rx interrupt should be exclusive. 154715e9654SYong Liu 155715e9654SYong Liu#. Qemu e1000 does not support interrupt auto-clear, application should disable interrupt immediately when woken up. 156