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 8CD5C3977 for ; Thu, 14 Apr 2016 12:20:26 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 7E7C428F45; Thu, 14 Apr 2016 12:19:41 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org Cc: bruce.richardson@intel.com, stephen@networkplumber.org Date: Thu, 14 Apr 2016 12:19:47 +0200 Message-Id: <1460629199-32489-25-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1460629199-32489-1-git-send-email-olivier.matz@6wind.com> References: <1457540381-20274-1-git-send-email-olivier.matz@6wind.com> <1460629199-32489-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH 24/36] mempool: replace mempool physaddr by a memzone pointer 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: Thu, 14 Apr 2016 10:20:26 -0000 Storing the pointer to the memzone instead of the physical address provides more information than just the physical address: for instance, the memzone flags. Moreover, keeping the memzone pointer will allow us to free the mempool (this is done later in the series). Signed-off-by: Olivier Matz --- lib/librte_mempool/rte_mempool.c | 4 ++-- lib/librte_mempool/rte_mempool.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 54f2ab2..7336616 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -719,7 +719,7 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size, /* init the mempool structure */ memset(mp, 0, sizeof(*mp)); snprintf(mp->name, sizeof(mp->name), "%s", name); - mp->phys_addr = mz->phys_addr; + mp->mz = mz; mp->socket_id = socket_id; mp->size = n; mp->flags = flags; @@ -983,7 +983,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) fprintf(f, "mempool <%s>@%p\n", mp->name, mp); fprintf(f, " flags=%x\n", mp->flags); fprintf(f, " ring=<%s>@%p\n", mp->ring->name, mp->ring); - fprintf(f, " phys_addr=0x%" PRIx64 "\n", mp->phys_addr); + fprintf(f, " phys_addr=0x%" PRIx64 "\n", mp->mz->phys_addr); fprintf(f, " nb_mem_chunks=%u\n", mp->nb_mem_chunks); fprintf(f, " size=%"PRIu32"\n", mp->size); fprintf(f, " populated_size=%"PRIu32"\n", mp->populated_size); diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 82b0334..4a8c76b 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -203,7 +203,7 @@ struct rte_mempool_memhdr { struct rte_mempool { char name[RTE_MEMPOOL_NAMESIZE]; /**< Name of mempool. */ struct rte_ring *ring; /**< Ring to store objects. */ - phys_addr_t phys_addr; /**< Phys. addr. of mempool struct. */ + const struct rte_memzone *mz; /**< Memzone where mempool is allocated */ int flags; /**< Flags of the mempool. */ int socket_id; /**< Socket id passed at mempool creation. */ uint32_t size; /**< Max size of the mempool. */ -- 2.1.4