From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH v3] mempool: don't check mempool flags when cache is enabled Date: Tue, 10 Jan 2017 16:14:34 +0100 Message-ID: <20170110161434.1b190c49@glumotte.dev.6wind.com> References: <1484032450-1329-1-git-send-email-liuwf@arraynetworks.com.cn> <1484036802-3031-1-git-send-email-liuwf@arraynetworks.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: , , , "konstantin.ananyev@intel.com" To: Wenfeng Liu Return-path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id A0B495589 for ; Tue, 10 Jan 2017 16:14:42 +0100 (CET) Received: by mail-wm0-f49.google.com with SMTP id c206so76958705wme.0 for ; Tue, 10 Jan 2017 07:14:42 -0800 (PST) In-Reply-To: <1484036802-3031-1-git-send-email-liuwf@arraynetworks.com.cn> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Wengfeng, On Tue, 10 Jan 2017 08:26:42 +0000, Wenfeng Liu 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 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