From: Olivier Matz Date: Wed, 18 May 2016 11:04:28 +0000 (+0200) Subject: mempool: remove const qualifier when browsing pools X-Git-Tag: spdx-start~6894 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c2c66588e294b62c39ebcb4d4348e4f9896dd712;p=dpdk.git mempool: remove const qualifier when browsing pools This commit removes the const qualifier for the mempool in rte_mempool_walk() callback prototype. Indeed, most functions that can be done on a mempool require a non-const mempool pointer, except the dump and the audit. Therefore, the mempool_walk() is more useful if the mempool pointer is not const. This is required by next commit where the mellanox drivers use rte_mempool_walk() to iterate the mempools, then rte_mempool_obj_iter() to iterate the objects in each mempool. Signed-off-by: Olivier Matz --- diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index c5d8535acb..2dcb5b48b3 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -1369,7 +1369,7 @@ txq_mp2mr_mbuf_check(void *arg, void *start, void *end, * Pointer to TX queue structure. */ static void -txq_mp2mr_iter(const struct rte_mempool *mp, void *arg) +txq_mp2mr_iter(struct rte_mempool *mp, void *arg) { struct txq *txq = arg; struct txq_mp2mr_mbuf_check_data data = { diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 1832a21a12..73a9a1c62b 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -311,7 +311,7 @@ txq_mp2mr_mbuf_check(void *arg, void *start, void *end, * Pointer to TX queue structure. */ void -txq_mp2mr_iter(const struct rte_mempool *mp, void *arg) +txq_mp2mr_iter(struct rte_mempool *mp, void *arg) { struct txq *txq = arg; struct txq_mp2mr_mbuf_check_data data = { diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 0e2b607d5a..db054d6c66 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -342,7 +342,7 @@ uint16_t mlx5_tx_burst_secondary_setup(void *dpdk_txq, struct rte_mbuf **pkts, /* mlx5_rxtx.c */ struct ibv_mr *mlx5_mp2mr(struct ibv_pd *, const struct rte_mempool *); -void txq_mp2mr_iter(const struct rte_mempool *, void *); +void txq_mp2mr_iter(struct rte_mempool *, void *); uint16_t mlx5_tx_burst(void *, struct rte_mbuf **, uint16_t); uint16_t mlx5_rx_burst_sp(void *, struct rte_mbuf **, uint16_t); uint16_t mlx5_rx_burst(void *, struct rte_mbuf **, uint16_t); diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index c29a4c7f4c..8c220acc58 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -971,7 +971,7 @@ rte_mempool_lookup(const char *name) return mp; } -void rte_mempool_walk(void (*func)(const struct rte_mempool *, void *), +void rte_mempool_walk(void (*func)(struct rte_mempool *, void *), void *arg) { struct rte_tailq_entry *te = NULL; diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index acc75f8ef1..95f7505a5e 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -1309,7 +1309,7 @@ ssize_t rte_mempool_xmem_usage(void *vaddr, uint32_t elt_num, * @param arg * Argument passed to iterator */ -void rte_mempool_walk(void (*func)(const struct rte_mempool *, void *arg), +void rte_mempool_walk(void (*func)(struct rte_mempool *, void *arg), void *arg); #ifdef __cplusplus