* Flush a user-owned mempool cache to the specified mempool. * * @param cache * A pointer to the mempool cache. * @param mp * A pointer to the mempool. */
| 1340 | * A pointer to the mempool. |
| 1341 | */ |
| 1342 | static __rte_always_inline void |
| 1343 | rte_mempool_cache_flush(struct rte_mempool_cache *cache, |
| 1344 | struct rte_mempool *mp) |
| 1345 | { |
| 1346 | if (cache == NULL) |
| 1347 | cache = rte_mempool_default_cache(mp, rte_lcore_id()); |
| 1348 | if (cache == NULL || cache->len == 0) |
| 1349 | return; |
| 1350 | rte_mempool_trace_cache_flush(cache, mp); |
| 1351 | rte_mempool_ops_enqueue_bulk(mp, cache->objs, cache->len); |
| 1352 | cache->len = 0; |
| 1353 | } |
| 1354 | |
| 1355 | /** |
| 1356 | * @internal Put several objects back in the mempool; used internally. |