From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 242853989 for ; Mon, 13 Jun 2016 13:24:39 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 0772A25813; Mon, 13 Jun 2016 13:24:39 +0200 (CEST) From: Olivier Matz To: christian.ehrhardt@canonical.com, david.marchand@6wind.com, dev@dpdk.org Date: Mon, 13 Jun 2016 13:24:29 +0200 Message-Id: <1465817069-16587-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1465806137-32619-1-git-send-email-olivier.matz@6wind.com> References: <1465806137-32619-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH v2] xenvirt: fix compilation after mempool changes 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, 13 Jun 2016 11:24:39 -0000 The field elt_va_start has been removed from the mempool structure, and it was not replaced in xenvirt. Fix this by getting the mempool objects address by using the address of the first memory chunk list. Note that it won't work with mempool composed of several chunks, but it was already the case before. Fixes: 84121f197187 ("mempool: store memory chunks in a list") Reported-by: Christian Ehrhardt Signed-off-by: Olivier Matz Acked-by: Christian Ehrhardt --- v1->v2: - fix mempool variable name - fix typo in Reported-by drivers/net/xenvirt/rte_xen_lib.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/xenvirt/rte_xen_lib.c b/drivers/net/xenvirt/rte_xen_lib.c index de63cd3..6c9a1d4 100644 --- a/drivers/net/xenvirt/rte_xen_lib.c +++ b/drivers/net/xenvirt/rte_xen_lib.c @@ -423,6 +423,7 @@ grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *g { char key_str[PATH_MAX] = {0}; char val_str[PATH_MAX] = {0}; + void *mempool_obj_va; if (grant_node_create(pg_num, gref_arr, pa_arr, val_str, sizeof(val_str))) { return -1; @@ -437,7 +438,14 @@ grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *g if (snprintf(key_str, sizeof(key_str), DPDK_XENSTORE_PATH"%d"MEMPOOL_VA_XENSTORE_STR, mempool_idx) == -1) return -1; - if (snprintf(val_str, sizeof(val_str), "%"PRIxPTR, (uintptr_t)mpool->elt_va_start) == -1) + if (mpool->nb_mem_chunks != 1) { + RTE_LOG(ERR, PMD, + "mempool with more than 1 chunk is not supported\n"); + return -1; + } + mempool_obj_va = STAILQ_FIRST(&mpool->mem_list)->addr; + if (snprintf(val_str, sizeof(val_str), "%"PRIxPTR, + (uintptr_t)mempool_obj_va) == -1) return -1; if (xenstore_write(key_str, val_str) == -1) return -1; -- 2.8.0.rc3