mempool: remove deprecated count functions
[dpdk.git] / lib / librte_mempool / rte_mempool.h
index 9ccb107..7a31685 100644 (file)
@@ -551,7 +551,7 @@ int rte_mempool_register_ops(const struct rte_mempool_ops *ops);
 /**
  * Macro to statically register the ops of a mempool handler.
  * Note that the rte_mempool_register_ops fails silently here when
- * more then RTE_MEMPOOL_MAX_OPS_IDX is registered.
+ * more than RTE_MEMPOOL_MAX_OPS_IDX is registered.
  */
 #define MEMPOOL_REGISTER_OPS(ops)                                      \
        void mp_hdlr_init_##ops(void);                                  \
@@ -1038,19 +1038,15 @@ rte_mempool_default_cache(struct rte_mempool *mp, unsigned lcore_id)
  */
 static inline void __attribute__((always_inline))
 __mempool_generic_put(struct rte_mempool *mp, void * const *obj_table,
-                     unsigned n, struct rte_mempool_cache *cache, int flags)
+                     unsigned n, struct rte_mempool_cache *cache)
 {
        void **cache_objs;
 
        /* increment stat now, adding in mempool always success */
        __MEMPOOL_STAT_ADD(mp, put, n);
 
-       /* No cache provided or single producer */
-       if (unlikely(cache == NULL || flags & MEMPOOL_F_SP_PUT))
-               goto ring_enqueue;
-
-       /* Go straight to ring if put would overflow mem allocated for cache */
-       if (unlikely(n > RTE_MEMPOOL_CACHE_MAX_SIZE))
+       /* No cache provided or if put would overflow mem allocated for cache */
+       if (unlikely(cache == NULL || n > RTE_MEMPOOL_CACHE_MAX_SIZE))
                goto ring_enqueue;
 
        cache_objs = &cache->objs[cache->len];
@@ -1104,10 +1100,11 @@ ring_enqueue:
  */
 static inline void __attribute__((always_inline))
 rte_mempool_generic_put(struct rte_mempool *mp, void * const *obj_table,
-                       unsigned n, struct rte_mempool_cache *cache, int flags)
+                       unsigned n, struct rte_mempool_cache *cache,
+                       __rte_unused int flags)
 {
        __mempool_check_cookies(mp, obj_table, n, 0);
-       __mempool_generic_put(mp, obj_table, n, cache, flags);
+       __mempool_generic_put(mp, obj_table, n, cache);
 }
 
 /**
@@ -1244,15 +1241,14 @@ rte_mempool_put(struct rte_mempool *mp, void *obj)
  */
 static inline int __attribute__((always_inline))
 __mempool_generic_get(struct rte_mempool *mp, void **obj_table,
-                     unsigned n, struct rte_mempool_cache *cache, int flags)
+                     unsigned n, struct rte_mempool_cache *cache)
 {
        int ret;
        uint32_t index, len;
        void **cache_objs;
 
-       /* No cache provided or single consumer */
-       if (unlikely(cache == NULL || flags & MEMPOOL_F_SC_GET ||
-                    n >= cache->size))
+       /* No cache provided or cannot be satisfied from cache */
+       if (unlikely(cache == NULL || n >= cache->size))
                goto ring_dequeue;
 
        cache_objs = cache->objs;
@@ -1326,10 +1322,10 @@ ring_dequeue:
  */
 static inline int __attribute__((always_inline))
 rte_mempool_generic_get(struct rte_mempool *mp, void **obj_table, unsigned n,
-                       struct rte_mempool_cache *cache, int flags)
+                       struct rte_mempool_cache *cache, __rte_unused int flags)
 {
        int ret;
-       ret = __mempool_generic_get(mp, obj_table, n, cache, flags);
+       ret = __mempool_generic_get(mp, obj_table, n, cache);
        if (ret == 0)
                __mempool_check_cookies(mp, obj_table, n, 1);
        return ret;
@@ -1511,22 +1507,6 @@ rte_mempool_get(struct rte_mempool *mp, void **obj_p)
  */
 unsigned int rte_mempool_avail_count(const struct rte_mempool *mp);
 
-/**
- * @deprecated
- * Return the number of entries in the mempool.
- *
- * When cache is enabled, this function has to browse the length of
- * all lcores, so it should not be used in a data path, but only for
- * debug purposes.
- *
- * @param mp
- *   A pointer to the mempool structure.
- * @return
- *   The number of entries in the mempool.
- */
-__rte_deprecated
-unsigned rte_mempool_count(const struct rte_mempool *mp);
-
 /**
  * Return the number of elements which have been allocated from the mempool
  *
@@ -1542,31 +1522,6 @@ unsigned rte_mempool_count(const struct rte_mempool *mp);
 unsigned int
 rte_mempool_in_use_count(const struct rte_mempool *mp);
 
-/**
- * @deprecated
- * Return the number of free entries in the mempool ring.
- * i.e. how many entries can be freed back to the mempool.
- *
- * NOTE: This corresponds to the number of elements *allocated* from the
- * memory pool, not the number of elements in the pool itself. To count
- * the number elements currently available in the pool, use "rte_mempool_count"
- *
- * When cache is enabled, this function has to browse the length of
- * all lcores, so it should not be used in a data path, but only for
- * debug purposes. User-owned mempool caches are not accounted for.
- *
- * @param mp
- *   A pointer to the mempool structure.
- * @return
- *   The number of free entries in the mempool.
- */
-__rte_deprecated
-static inline unsigned
-rte_mempool_free_count(const struct rte_mempool *mp)
-{
-       return rte_mempool_in_use_count(mp);
-}
-
 /**
  * Test if the mempool is full.
  *