* Get a pointer to the per-lcore default mempool cache. * * @param mp * A pointer to the mempool structure. * @param lcore_id * The logical core id. * @return * A pointer to the mempool cache or NULL if disabled or unregistered non-EAL * thread. */
| 1318 | * thread. |
| 1319 | */ |
| 1320 | static __rte_always_inline struct rte_mempool_cache * |
| 1321 | rte_mempool_default_cache(struct rte_mempool *mp, unsigned lcore_id) |
| 1322 | { |
| 1323 | if (mp->cache_size == 0) |
| 1324 | return NULL; |
| 1325 | |
| 1326 | if (lcore_id >= RTE_MAX_LCORE) |
| 1327 | return NULL; |
| 1328 | |
| 1329 | rte_mempool_trace_default_cache(mp, lcore_id, |
| 1330 | &mp->local_cache[lcore_id]); |
| 1331 | return &mp->local_cache[lcore_id]; |
| 1332 | } |
| 1333 | |
| 1334 | /** |
| 1335 | * Flush a user-owned mempool cache to the specified mempool. |
no outgoing calls