Hi Wengfeng, On Tue, 10 Jan 2017 08:26:42 +0000, Wenfeng Liu <li...@arraynetworks.com.cn> wrote: > Currently we will check mempool flags when we put/get objects from > mempool. However, this makes cache useless when mempool is SC|SP, > SC|MP, MC|SP cases. > This patch makes cache available in above cases and improves > performance. > > Signed-off-by: Wenfeng Liu <li...@arraynetworks.com.cn>
I agree with you and Konstantin. This should enhance performance in single consumer/producer mode. > @@ -1104,10 +1100,10 @@ static inline void > __attribute__((always_inline)) */ > 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) { Small nit, seen with checkpatch: WARNING:LONG_LINE: line over 80 characters #43: FILE: lib/librte_mempool/rte_mempool.h:1103: + unsigned n, struct rte_mempool_cache *cache, __rte_unused int flags) The other warnings (Prefer 'unsigned int' to bare use of 'unsigned') can be ignored, since it's not coming from your patch. While there, I suggest another title that better reflects what is done: "mempool: use cache in single producer or consumer mode" Thanks, Olivier