Message ID | 1473344895-18491-1-git-send-email-h.mikita89@gmail.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> 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 29FEF378E; Thu, 8 Sep 2016 16:28:26 +0200 (CEST) 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 <dev@dpdk.org>; Thu, 8 Sep 2016 16:28:25 +0200 (CEST) Received: by mail-pa0-f68.google.com with SMTP id h5so2489304pao.0 for <dev@dpdk.org>; Thu, 08 Sep 2016 07:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=z+I/s72yJAQvAVspYtVNmqDpPT/I2nlqN8f8xfFCiJ0=; b=r6MtiOP/VEkmxxu18trehYyKL6XffjopxdkW2SktBnwlveL4JdFXhnbeea2q6kBv1+ GBjOJTI4GUcxIlXEL2HBX1rWyRQeEXR8bFVitL8ndPQ0S+YCponFcW/E++I8Sf5G3YVO yLAGBWs6Bp2xGpyrdKSe7p9MkKhnERFRVaO0p/KqxpML/3NwrB7XyeWaYYKhDtK+yuy8 pJq4MpZaEms1OT9fvtrpgCOft+AqPL3RTlWD6XCcXmgSOxgEPzF5iZFRKY0I4oxcU4sv wB/i1LRasNdmhTW2kAUiqOb64TKvn42sV9BfpEXX6Ts4drqk+oSB0myZxYHs8o1+A3md WEZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=z+I/s72yJAQvAVspYtVNmqDpPT/I2nlqN8f8xfFCiJ0=; b=myvhysguzeac4Zgqf9329enIf5kWx2t9kN5jl/wgywS+n1cg7kP7QsCBM84FqoLqaF UYDxTLggGkSGdNxumsk2dUNKh2giFw+aLw8CD8ImwpxwlXjvvy10ce1D3rWj1S/POFEM ymHOWnv78JCh2eeVe9oKF0iGhI/LPb8e5rU5gYOsc4M4Yt/KGaFhH3bqX2YbuQYxn1eg Hu5OGwK5OKE9oV6sH+0X6vhuU7SoXcc+Xf2vTu7ARRt7ggKP3dhUr9OVn0RXYNXUCVyJ cVPovPo4tHajGHgDJG9gk2QlZE8H96q470S7k/lnZglvqLvEu1C0VnhKA7ehn1ssXEqi RgnQ== X-Gm-Message-State: AE9vXwOazzdbyS7Q7XG3SAYLAU81a5e0kRnFtd9qNt6kF1KzcExoCI9NR//DUiYK6FUlTw== X-Received: by 10.66.160.200 with SMTP id xm8mr22287804pab.12.1473344904563; Thu, 08 Sep 2016 07:28:24 -0700 (PDT) Received: from localhost.localdomain (183.180.67.214.ap.gmobb-fix.jp. [183.180.67.214]) by smtp.gmail.com with ESMTPSA id a198sm29404052pfa.27.2016.09.08.07.28.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Sep 2016 07:28:24 -0700 (PDT) From: Hiroyuki Mikita <h.mikita89@gmail.com> To: olivier.matz@6wind.com Cc: dev@dpdk.org Date: Thu, 8 Sep 2016 23:28:15 +0900 Message-Id: <1473344895-18491-1-git-send-email-h.mikita89@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Hiroyuki Mikita
Sept. 8, 2016, 2:28 p.m. UTC
fix check flags in case of single producer and single consumer
Fixes: 449c49b9 ("mempool: support handler operations")
Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
---
lib/librte_mempool/rte_mempool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
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 <h.mikita89@gmail.com> > --- > 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); >
Hi Hiroki, Ferruh, On 09/08/2016 04:44 PM, Ferruh Yigit wrote: > 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 <h.mikita89@gmail.com> >> --- >> 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); >> > Looks the same kind of patch was posted few hours before: http://dpdk.org/dev/patchwork/patch/15686/ Regards, Olivier
Sorry, I did not notice the same kind of patch. I close this patch. Hiroyuki 2016-09-08 23:46 GMT+09:00 Olivier Matz <olivier.matz@6wind.com>: > Hi Hiroki, Ferruh, > > On 09/08/2016 04:44 PM, Ferruh Yigit wrote: >> 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 <h.mikita89@gmail.com> >>> --- >>> 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); >>> >> > > Looks the same kind of patch was posted few hours before: > http://dpdk.org/dev/patchwork/patch/15686/ > > Regards, > Olivier
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);