From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from compass.polito.it (compass.polito.it [130.192.55.110]) by dpdk.org (Postfix) with ESMTP id 23FE89A9E for ; Mon, 18 May 2015 10:32:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by compass.polito.it (Postfix) with ESMTP id E5D2C1000E9 for ; Mon, 18 May 2015 10:32:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= studenti.polito.it; h=content-type:content-type:to:from:from :subject:subject:message-id:date:date:received:mime-version :received:received:received; s=y2k10; t=1431937958; bh=52ELe9K6T YBcg9t3D3CWQaKQcRSM6SZXL5sgNdxF3zc=; b=DcTKX+vWUoRIATHmES0hKlJUi d/3XChJT6W1KRgktm0lAiGO7y+WZ/KHujY7NwypGmt8NzAhUE/rGJY4VN++gualc dhBo6ftH3ZgeHHi9cqCU6RHGFsGcKYE9yalzJaPItgZuoflg8mhmYRmsAc4SPwHI wWC5ff6R6U7b9DAWTI= X-Virus-Scanned: amavisd-new at studenti.polito.it Received: from compass.polito.it ([127.0.0.1]) by localhost (compass.polito.it [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2glTJHjsYBRR for ; Mon, 18 May 2015 10:32:38 +0200 (CEST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: s203403@studenti.polito.it) by compass.polito.it (Postfix) with ESMTPSA id 7576D1000D9 for ; Mon, 18 May 2015 10:32:38 +0200 (CEST) Received: by lagv1 with SMTP id v1so208160652lag.3 for ; Mon, 18 May 2015 01:32:37 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.152.116.49 with SMTP id jt17mr6966048lab.82.1431937957866; Mon, 18 May 2015 01:32:37 -0700 (PDT) Received: by 10.25.149.144 with HTTP; Mon, 18 May 2015 01:32:37 -0700 (PDT) Date: Mon, 18 May 2015 10:32:37 +0200 Message-ID: From: =?UTF-8?Q?Mauricio_V=C3=A1squez?= To: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] dpdk 2.0.0: Issue mapping mempool into guest using 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: Mon, 18 May 2015 08:32:40 -0000 Hi all, I'm trying to map a mempool into a guest using the IVSHMEM library but the mempool is not visible from the guest. The code I'm running is quite simple, on the host I run a primary DPDK process that creates the mempool, creates a metadata file and then adds the mempool to it. The code is: ... int main(int argc, char * argv[]) { int retval = 0; /* Init EAL, parsing EAL args */ retval = rte_eal_init(argc, argv); if (retval < 0) return -1; char cmdline[PATH_MAX] = {0}; struct rte_mempool *packets_pool; //Create mempool packets_pool = rte_mempool_create( "packets", NUM_PKTS, MBUF_SIZE, CACHE_SIZE, //This is the size of the mempool cache sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init, NULL, rte_pktmbuf_init, NULL, rte_socket_id(), 0 /*NO_FLAGS*/); if (packets_pool == NULL) rte_exit(EXIT_FAILURE,"Cannot init the packets pool\n"); //Create metadata file if (rte_ivshmem_metadata_create(metadata_name) < 0) rte_exit(EXIT_FAILURE, "Cannot create metadata file\n"); //Add mempool to metadata file if(rte_ivshmem_metadata_add_mempool(packets_pool, metadata_name) < 0) rte_exit(EXIT_FAILURE, "Cannot add mempool metadata file\n"); //Get qemu command line if (rte_ivshmem_metadata_cmdline_generate(cmdline, sizeof(cmdline), metadata_name) < 0) rte_exit(EXIT_FAILURE, "Failed generating command line for qemu\n"); RTE_LOG(INFO, APP, "Command line for qemu: %s\n", cmdline); save_ivshmem_cmdline_to_file(cmdline); //Avoids the application closes char x = getchar(); (void) x; return 0; } When I run it I can see clearly that the memzone is added: EAL: Adding memzone 'MP_packets' at 0x7ffec0e8c1c0 to metadata vm_1 EAL: Adding memzone 'RG_MP_packets' at 0x7ffec0d8c140 to metadata vm_1 APP: Command line for qemu: -device ivshmem,size=2048M,shm=fd:/dev/hugepages/rtemap_0:0x0:0x40000000:/dev/zero:0x0:0x3fffc000:/var/run/.dpdk_ivshmem_metadata_vm_1:0x0:0x4000 I run the modified version of QEMU provided by dpdk-ovs using the command line generated by the host application, then in the guest I run an even simpler application: ... void mempool_walk_f(const struct rte_mempool *r, void * arg) { RTE_LOG(INFO, APP, "Mempool: %s\n", r->name); (void) arg; } int main(int argc, char *argv[]) { int retval = 0; if ((retval = rte_eal_init(argc, argv)) < 0) return -1; argc -= retval; argv += retval; struct rte_mempool * packets; packets = rte_mempool_lookup("packets"); if(packets == NULL) { RTE_LOG(ERR, APP, "Failed to find mempool\n"); } RTE_LOG(INFO, APP, "List of mempool: \n"); rte_mempool_walk(mempool_walk_f, NULL); return 0; } ... I can see in the application output that the mem zones that were added are found: EAL: Found memzone: 'RG_MP_packets' at 0x7ffec0d8c140 (len 0x100080) EAL: Found memzone: 'MP_packets' at 0x7ffec0e8c1c0 (len 0x3832100) But, the rte_mempool_lookup function returns NULL. Using the rte_mempool_walker the program only prints a memzone called log_history. Do you have any suggestion? Thank you very much for your help.