From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D351A37A8 for ; Thu, 8 Sep 2016 16:44:46 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP; 08 Sep 2016 07:44:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,301,1470726000"; d="scan'208";a="165868246" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.92]) ([10.237.220.92]) by fmsmga004.fm.intel.com with ESMTP; 08 Sep 2016 07:44:45 -0700 To: Hiroyuki Mikita , olivier.matz@6wind.com References: <1473344895-18491-1-git-send-email-h.mikita89@gmail.com> Cc: dev@dpdk.org From: Ferruh Yigit Message-ID: <39302a3a-9662-7f75-db3b-e7dd4244c32f@intel.com> Date: Thu, 8 Sep 2016 15:44:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1473344895-18491-1-git-send-email-h.mikita89@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] mempool: fix check flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2016 14:44:47 -0000 On 9/8/2016 3:28 PM, Hiroyuki Mikita wrote: > fix check flags in case of single producer and single consumer > > Fixes: 449c49b9 ("mempool: support handler operations") > > Signed-off-by: Hiroyuki Mikita > --- > lib/librte_mempool/rte_mempool.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c > index 2e28e2e..61bd63c 100644 > --- a/lib/librte_mempool/rte_mempool.c > +++ b/lib/librte_mempool/rte_mempool.c > @@ -879,7 +879,7 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size, > * Since we have 4 combinations of the SP/SC/MP/MC examine the flags to > * set the correct index into the table of ops structs. > */ > - if (flags & (MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET)) > + if ((flags & MEMPOOL_F_SP_PUT) & (flags & MEMPOOL_F_SC_GET)) Isn't this always false? What about: if ((flags & MEMPOOL_F_SP_PUT) && (flags & MEMPOOL_F_SC_GET)) > rte_mempool_set_ops_byname(mp, "ring_sp_sc", NULL); > else if (flags & MEMPOOL_F_SP_PUT) > rte_mempool_set_ops_byname(mp, "ring_sp_mc", NULL); >