]> git.droids-corp.org - dpdk.git/commitdiff
mempool: remove const qualifier when browsing pools
authorOlivier Matz <olivier.matz@6wind.com>
Wed, 18 May 2016 11:04:28 +0000 (13:04 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 19 May 2016 12:40:13 +0000 (14:40 +0200)
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 <olivier.matz@6wind.com>
drivers/net/mlx4/mlx4.c
drivers/net/mlx5/mlx5_rxtx.c
drivers/net/mlx5/mlx5_rxtx.h
lib/librte_mempool/rte_mempool.c
lib/librte_mempool/rte_mempool.h

index c5d8535acbe2e83d0bde30c03a791e337445b63b..2dcb5b48b348d37c1baabf890cc861b12b920784 100644 (file)
@@ -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 = {
index 1832a21a124541783d79d7269510d5ade80fb9a6..73a9a1c62bc5a6497512fc620d474938dffbf14e 100644 (file)
@@ -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 = {
index 0e2b607d5acc7c7ccb8291ebc0ae74155b214f28..db054d6c664ea2ab2d6385764c3dc79e3765433f 100644 (file)
@@ -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);
index c29a4c7f4cdbb9b68b4091782cb666352eb41d18..8c220acc5870f6ebdba31540e9a0f581883a1cb2 100644 (file)
@@ -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;
index acc75f8ef13c33690e58f3032344b09cc79609e3..95f7505a5ed3c0722414b2607faffc222f12cbb4 100644 (file)
@@ -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