From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: [RFC v2 09/17] mempool/dpaa: convert to use populate driver op Date: Tue, 23 Jan 2018 13:16:04 +0000 Message-ID: <1516713372-10572-10-git-send-email-arybchenko@solarflare.com> References: <1511539591-20966-1-git-send-email-arybchenko@solarflare.com> <1516713372-10572-1-git-send-email-arybchenko@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Olivier Matz , Hemant Agrawal , Shreyansh Jain To: Return-path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 99FB17CEF for ; Tue, 23 Jan 2018 14:16:53 +0100 (CET) In-Reply-To: <1516713372-10572-1-git-send-email-arybchenko@solarflare.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Populate mempool driver callback is executed a bit later than register memory area, provides the same information and will substitute the later since it gives more flexibility and in addition to notification about memory area allows to customize how mempool objects are stored in memory. Signed-off-by: Andrew Rybchenko --- drivers/mempool/dpaa/dpaa_mempool.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c index ddc4e47..a179804 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -260,10 +260,9 @@ dpaa_mbuf_get_count(const struct rte_mempool *mp) } static int -dpaa_register_memory_area(const struct rte_mempool *mp, - char *vaddr __rte_unused, - rte_iova_t paddr __rte_unused, - size_t len) +dpaa_populate(const struct rte_mempool *mp, unsigned int max_objs, + char *vaddr, rte_iova_t paddr, size_t len, + rte_mempool_populate_obj_cb_t *obj_cb) { struct dpaa_bp_info *bp_info; unsigned int total_elt_sz; @@ -286,7 +285,9 @@ dpaa_register_memory_area(const struct rte_mempool *mp, /* Else, Memory will be allocated from multiple memzones */ bp_info->flags |= DPAA_MPOOL_MULTI_MEMZONE; - return 0; + return rte_mempool_populate_one_by_one(mp, max_objs, vaddr, paddr, len, + obj_cb); + } struct rte_mempool_ops dpaa_mpool_ops = { @@ -296,7 +297,7 @@ struct rte_mempool_ops dpaa_mpool_ops = { .enqueue = dpaa_mbuf_free_bulk, .dequeue = dpaa_mbuf_alloc_bulk, .get_count = dpaa_mbuf_get_count, - .register_memory_area = dpaa_register_memory_area, + .populate = dpaa_populate, }; MEMPOOL_REGISTER_OPS(dpaa_mpool_ops); -- 2.7.4