From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fm2nodo5.polito.it (fm2nodo5.polito.it [130.192.180.14]) by dpdk.org (Postfix) with ESMTP id 262695936 for ; Tue, 21 Jul 2015 11:45:57 +0200 (CEST) Received: from frontmail1.polito.it (frontmail1.polito.it [130.192.180.41]) by fm2nodo5.polito.it with ESMTP id t6L9juDe009746-t6L9juDg009746 (version=TLSv1.0 cipher=DES-CBC3-SHA bits=112 verify=NO); Tue, 21 Jul 2015 11:45:56 +0200 X-ExtScanner: Niversoft's FindAttachments (free) Received: from [130.192.5.93] (account d003306@polito.it HELO [192.168.1.102]) by polito.it (CommuniGate Pro SMTP 6.0.7) with ESMTPSA id 94895674; Tue, 21 Jul 2015 11:45:56 +0200 To: dev@dpdk.org From: Fulvio Risso Message-ID: <55AE14D2.9050608@polito.it> Date: Tue, 21 Jul 2015 11:45:54 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-FEAS-SYSTEM-WL: 130.192.180.41 Subject: [dpdk-dev] Does PCI hotplug work with IVSHMEM? 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: , X-List-Received-Date: Tue, 21 Jul 2015 09:45:57 -0000 Dear all, we're adding dynamically an IVSHMEM device on a VM that is already running, but apparently this is not visible in DPDK, while it is correctly recognized by the Guest OS. This is the list of steps we execute: 1) Launch a new Guest VM with Qemu 2) Create a new IVSHMEM metadata file in the Host 3) Map that file as a new IVSHMEM device in the Guest For this step, we use the "device_add" command from Qemu: (qemu) device_add ivshmem,size=2048M,shm=fd:/dev/hugepages /rtemap_0:0x0:0x40000000:/dev/zero:0x0:0x3fffc000:/var/run /.dpdk_ivshmem_metadata_vm_1:0x0:0x4000 4) List the available PCI devices in the Guest with "lspci": $ sudo lspci 00:04.0 RAM memory: Red Hat, Inc Virtio Inter-VM shared memory ==> hence, the Guest OS correctly recognizes the new device 5) Lauch a DPDK simple application such as 'helloworld' in the Guest: $ sudo ./build/helloworld -c 0x1 -n 4 EAL: Detected lcore 0 as core 0 on socket 0 EAL: Detected lcore 1 as core 0 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: Searching for IVSHMEM devices... EAL: No IVSHMEM configuration found! EAL: Setting up memory... ==> Hence, the DPDK app in the Guest OS doesn't recognize the new device. An additional observations that may be important here. If we reboot the Guest and re-lauch the same DPDK as before, the IVSHMEM is correclty detected by the DPDK app: $ sudo reboot .... $ sudo ./build/helloworld -c 0x1 -n 4 EAL: Detected lcore 0 as core 0 on socket 0 EAL: Detected lcore 1 as core 0 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: Searching for IVSHMEM devices... EAL: Parsing metadata for "vm_1" EAL: Found IVSHMEM device 00:04.0 EAL: Memory segment mapped: 0x7f8b40d8c000 (len 3937000) at offset 0xd8c000 EAL: IVSHMEM segment found, size: 0x3936ec0 EAL: Setting up memory... Finally, this is what the DPDK programming guide says about IVSHMEM: ----------------------------------------------------------------------- http://dpdk.org/doc/guides/prog_guide/ivshmem_lib.html Currently, there is no hot plug support for QEMU IVSHMEM devices, so one cannot add additional memory to an IVSHMEM device once it has been created. Therefore, the correct sequence to run an IVSHMEM application is to run host application first, obtain the command lines for each IVSHMEM device and then run all QEMU instances with guest applications afterwards. ----------------------------------------------------------------------- To our understanding, IVSHMEM HotPlug is supported, but we cannot resize dynamically the memory. Is that correct? fulvio