From patchwork Thu Sep 8 03:36:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiliang Luo X-Patchwork-Id: 15686 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4EF799212; Thu, 8 Sep 2016 05:36:30 +0200 (CEST) Received: from Weiliangs-MacBook-Pro-3.local (cpe-70-113-18-193.austin.res.rr.com [70.113.18.193]) by dpdk.org (Postfix) with ESMTP id 60953920C for ; Thu, 8 Sep 2016 05:36:29 +0200 (CEST) Received: by Weiliangs-MacBook-Pro-3.local (Postfix, from userid 501) id 5B5DB15641E; Wed, 7 Sep 2016 22:36:27 -0500 (CDT) From: Weiliang Luo To: dev@dpdk.org Cc: Weiliang Luo Date: Wed, 7 Sep 2016 22:36:00 -0500 Message-Id: <1473305760-2420-1-git-send-email-droidluo@gmail.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) Subject: [dpdk-dev] [PATCH] mempool: fix sp sc mempool bug 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Weiliang Luo Signed-off-by: Weiliang Luo Acked-by: Olivier Matz --- 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..350d77a 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);