From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gmobb.jp (smtpbb012.gmobb.jp [157.7.156.159]) by dpdk.org (Postfix) with ESMTP id 1294D493D for ; Tue, 19 Jun 2018 13:37:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by smtp.gmobb.jp (Postfix) with ESMTP id 1B3157E986; Tue, 19 Jun 2018 20:37:33 +0900 (JST) X-Virus-Scanned: amavisd-new at gmoserver.jp Received: from smtp.gmobb.jp ([127.0.0.1]) by localhost (smtp.gmoserver.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tnPTjiv1NGQ0; Tue, 19 Jun 2018 20:37:33 +0900 (JST) Received: from localhost.localdomain (unknown [192.47.164.146]) by smtp.gmobb.jp (Postfix) with ESMTPA id E96D57E97F; Tue, 19 Jun 2018 20:37:32 +0900 (JST) From: Kenta Shinohara To: spp@dpdk.org, ferruh.yigit@intel.com Cc: Kenta Shinohara Date: Tue, 19 Jun 2018 20:37:18 +0900 Message-Id: <20180619113720.8336-6-shinohara.kenta@lab.ntt.co.jp> X-Mailer: git-send-email 2.15.1 (Apple Git-101) In-Reply-To: <20180619113720.8336-1-shinohara.kenta@lab.ntt.co.jp> References: <20180619113720.8336-1-shinohara.kenta@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [spp] [PATCH 5/7] spp_vm: fix changing spec of rte_mem_config X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 11:37:37 -0000 Spp_vm is encountered the following error on DPDK v18.05. build error: /home/k-shino/spp/src/vm/main.c: In function ‘get_memzone_by_addr’: /home/k-shino/spp/src/vm/main.c:321:14: error: ‘struct rte_mem_config’ has no member named ‘memzone’ tmp = &mcfg->memzone[i]; ^ /home/k-shino/.dpdkenv/versions/dpdk-18.05@x86_64-native-linuxapp-gcc/ mk/internal/rte.compile-pre.mk:114: recipe for target 'main.o' failed make[3]: *** [main.o] Error 1 /home/k-shino/.dpdkenv/versions/dpdk-18.05@x86_64-native-linuxapp-gcc/ mk/rte.extapp.mk:14: recipe for target 'all' failed make[2]: *** [all] Error 2 /home/k-shino/.dpdkenv/versions/dpdk-18.05@x86_64-native-linuxapp-gcc/ mk/rte.extsubdir.mk:21: recipe for target 'vm' failed make[1]: *** [vm ] Error 2 /home/k-shino/.dpdkenv/versions/dpdk-18.05@x86_64-native-linuxapp-gcc/ mk/rte.extsubdir.mk:21: recipe for target 'src' failed make: *** [src] Error 2 This error caused by changing specification of struct 'rte_fbarray'. To fix this, use 'rte_fbarray_get' and experimental method 'rte_fbarray_find_next_used' instead of array 'memzone[]'. Signed-off-by: Kenta Shinohara --- src/vm/main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/vm/main.c b/src/vm/main.c index 94ba8d1..6522d55 100644 --- a/src/vm/main.c +++ b/src/vm/main.c @@ -340,19 +340,22 @@ get_memzone_by_addr(const void *addr) { struct rte_memzone *tmp, *mz; struct rte_mem_config *mcfg; + struct rte_fbarray *arr; int i; mcfg = rte_eal_get_configuration()->mem_config; + arr = &mcfg->memzones; mz = NULL; /* find memzone for the ring */ - for (i = 0; i < RTE_MAX_MEMZONE; i++) { - tmp = &mcfg->memzone[i]; - - if (tmp->addr_64 == (uint64_t) addr) { + i = rte_fbarray_find_next_used(arr, 0); + while (i >= 0) { + tmp = rte_fbarray_get(arr, i); + if (mz->addr_64 == (uint64_t) addr) { mz = tmp; break; } + i = rte_fbarray_find_next_used(arr, i+1); } return mz; -- 2.15.1 (Apple Git-101)