[dpdk-dev,v3,05/18] librte_acl: fix a bug at build phase that can cause matches beeing overwirtten.
Message ID | 1421779267-18492-6-git-send-email-konstantin.ananyev@intel.com (mailing list archive) |
---|---|
State | Accepted, 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 39BCA5AE6; Tue, 20 Jan 2015 19:41:52 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CC8D15ACE for <dev@dpdk.org>; Tue, 20 Jan 2015 19:41:42 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 20 Jan 2015 10:38:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,435,1418112000"; d="scan'208";a="664782659" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 20 Jan 2015 10:41:20 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t0KIfKBU029481; Tue, 20 Jan 2015 18:41:20 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t0KIfK81018819; Tue, 20 Jan 2015 18:41:20 GMT Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t0KIfKr3018815; Tue, 20 Jan 2015 18:41:20 GMT From: Konstantin Ananyev <konstantin.ananyev@intel.com> To: dev@dpdk.org Date: Tue, 20 Jan 2015 18:40:54 +0000 Message-Id: <1421779267-18492-6-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1421779267-18492-1-git-send-email-konstantin.ananyev@intel.com> References: <1421779267-18492-1-git-send-email-konstantin.ananyev@intel.com> Subject: [dpdk-dev] [PATCH v3 05/18] librte_acl: fix a bug at build phase that can cause matches beeing overwirtten. 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
Ananyev, Konstantin
Jan. 20, 2015, 6:40 p.m. UTC
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
lib/librte_acl/acl_bld.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, Jan 20, 2015 at 06:40:54PM +0000, Konstantin Ananyev wrote: > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> > --- > lib/librte_acl/acl_bld.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c > index 8bf4a54..22f7934 100644 > --- a/lib/librte_acl/acl_bld.c > +++ b/lib/librte_acl/acl_bld.c > @@ -1907,7 +1907,7 @@ rte_acl_build(struct rte_acl_ctx *ctx, const struct rte_acl_config *cfg) > bcx.num_tries, bcx.cfg.num_categories, > RTE_ACL_MAX_FIELDS * RTE_DIM(bcx.tries) * > sizeof(ctx->data_indexes[0]), > - bcx.num_build_rules); > + bcx.num_build_rules + 1); > if (rc == 0) { > > /* set data indexes. */ > -- > 1.8.5.3 > > Shouldn't you add to num_build_rules inside rte_acl_gen? That way other future users of the function don't have to remember to do so. Neil
Hi Neil, > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Sunday, January 25, 2015 5:35 PM > To: Ananyev, Konstantin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3 05/18] librte_acl: fix a bug at build phase that can cause matches beeing overwirtten. > > On Tue, Jan 20, 2015 at 06:40:54PM +0000, Konstantin Ananyev wrote: > > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> > > --- > > lib/librte_acl/acl_bld.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c > > index 8bf4a54..22f7934 100644 > > --- a/lib/librte_acl/acl_bld.c > > +++ b/lib/librte_acl/acl_bld.c > > @@ -1907,7 +1907,7 @@ rte_acl_build(struct rte_acl_ctx *ctx, const struct rte_acl_config *cfg) > > bcx.num_tries, bcx.cfg.num_categories, > > RTE_ACL_MAX_FIELDS * RTE_DIM(bcx.tries) * > > sizeof(ctx->data_indexes[0]), > > - bcx.num_build_rules); > > + bcx.num_build_rules + 1); > > if (rc == 0) { > > > > /* set data indexes. */ > > -- > > 1.8.5.3 > > > > > Shouldn't you add to num_build_rules inside rte_acl_gen? That way other future > users of the function don't have to remember to do so. In that patch, I just fix the bug to stop generate invalid tries for some corener cases. In the later patch in that set, I did something similar to what you are suggesting here - make rte_acl_gen() to allocate indexes for all match nodes too (as it already doing for all other nodes). See [PATCH v3 07/18] librte_acl: build/gen phase - simplify the way match nodes are allocated. Konstantin > Neil
On Sun, Jan 25, 2015 at 10:40:23PM +0000, Ananyev, Konstantin wrote: > Hi Neil, > > > -----Original Message----- > > From: Neil Horman [mailto:nhorman@tuxdriver.com] > > Sent: Sunday, January 25, 2015 5:35 PM > > To: Ananyev, Konstantin > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v3 05/18] librte_acl: fix a bug at build phase that can cause matches beeing overwirtten. > > > > On Tue, Jan 20, 2015 at 06:40:54PM +0000, Konstantin Ananyev wrote: > > > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> > > > --- > > > lib/librte_acl/acl_bld.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c > > > index 8bf4a54..22f7934 100644 > > > --- a/lib/librte_acl/acl_bld.c > > > +++ b/lib/librte_acl/acl_bld.c > > > @@ -1907,7 +1907,7 @@ rte_acl_build(struct rte_acl_ctx *ctx, const struct rte_acl_config *cfg) > > > bcx.num_tries, bcx.cfg.num_categories, > > > RTE_ACL_MAX_FIELDS * RTE_DIM(bcx.tries) * > > > sizeof(ctx->data_indexes[0]), > > > - bcx.num_build_rules); > > > + bcx.num_build_rules + 1); > > > if (rc == 0) { > > > > > > /* set data indexes. */ > > > -- > > > 1.8.5.3 > > > > > > > > Shouldn't you add to num_build_rules inside rte_acl_gen? That way other future > > users of the function don't have to remember to do so. > > In that patch, I just fix the bug to stop generate invalid tries for some corener cases. > In the later patch in that set, I did something similar to what you are suggesting here - > make rte_acl_gen() to allocate indexes for all match nodes too (as it already doing for all other nodes). > See [PATCH v3 07/18] librte_acl: build/gen phase - simplify the way match nodes are allocated. > Ok, thank you Neil > Konstantin > > > Neil > >
diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c index 8bf4a54..22f7934 100644 --- a/lib/librte_acl/acl_bld.c +++ b/lib/librte_acl/acl_bld.c @@ -1907,7 +1907,7 @@ rte_acl_build(struct rte_acl_ctx *ctx, const struct rte_acl_config *cfg) bcx.num_tries, bcx.cfg.num_categories, RTE_ACL_MAX_FIELDS * RTE_DIM(bcx.tries) * sizeof(ctx->data_indexes[0]), - bcx.num_build_rules); + bcx.num_build_rules + 1); if (rc == 0) { /* set data indexes. */