From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hiroyuki Mikita Subject: [PATCH] mempool: fix check flags Date: Thu, 8 Sep 2016 23:28:15 +0900 Message-ID: <1473344895-18491-1-git-send-email-h.mikita89@gmail.com> Cc: dev@dpdk.org To: olivier.matz@6wind.com Return-path: Received: from mail-pa0-f68.google.com (mail-pa0-f68.google.com [209.85.220.68]) by dpdk.org (Postfix) with ESMTP id 42EF7376C for ; Thu, 8 Sep 2016 16:28:25 +0200 (CEST) Received: by mail-pa0-f68.google.com with SMTP id h5so2489304pao.0 for ; Thu, 08 Sep 2016 07:28:25 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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)) 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); -- 2.7.4