From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rere.qmqm.pl (rere.qmqm.pl [84.10.57.10]) by dpdk.org (Postfix) with ESMTP id A1A4C282 for ; Tue, 13 Dec 2016 14:54:44 +0100 (CET) Received: by rere.qmqm.pl (Postfix, from userid 1000) id DDD996082; Tue, 13 Dec 2016 14:54:43 +0100 (CET) Date: Tue, 13 Dec 2016 14:54:43 +0100 From: Michal Miroslaw To: "Ananyev, Konstantin" Cc: "dev@dpdk.org" Message-ID: <20161213135443.ovmlunbh67dr4tew@rere.qmqm.pl> References: <2601191342CEEE43887BDE71AB9772583F0E6E0B@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2601191342CEEE43887BDE71AB9772583F0E6E0B@irsmsx105.ger.corp.intel.com> User-Agent: Mutt/1.6.2-neo (2016-07-23) Subject: Re: [dpdk-dev] [PATCH 04/13] acl: allow zero verdict X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2016 13:54:44 -0000 On Tue, Dec 13, 2016 at 10:36:16AM +0000, Ananyev, Konstantin wrote: > Hi Michal, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michal Miroslaw > > Sent: Tuesday, December 13, 2016 1:08 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH 04/13] acl: allow zero verdict > > > > Signed-off-by: Michał Mirosław > > --- > > lib/librte_acl/rte_acl.c | 3 +-- > > lib/librte_acl/rte_acl.h | 2 -- > > lib/librte_table/rte_table_acl.c | 2 +- > > 3 files changed, 2 insertions(+), 5 deletions(-) > > > > diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c > > index 8b7e92c..d1f40be 100644 > > --- a/lib/librte_acl/rte_acl.c > > +++ b/lib/librte_acl/rte_acl.c > > @@ -313,8 +313,7 @@ acl_check_rule(const struct rte_acl_rule_data *rd) > > if ((RTE_LEN2MASK(RTE_ACL_MAX_CATEGORIES, typeof(rd->category_mask)) & > > rd->category_mask) == 0 || > > rd->priority > RTE_ACL_MAX_PRIORITY || > > - rd->priority < RTE_ACL_MIN_PRIORITY || > > - rd->userdata == RTE_ACL_INVALID_USERDATA) > > + rd->priority < RTE_ACL_MIN_PRIORITY) > > return -EINVAL; > > return 0; > > } > > I am not sure, how it supposed to work properly? > Zero value is reserved and ifnicates that no match were found for that input. This is actually in use by us. In our use we don't need to differentiate matching a rule with zero verdict vs not matching a rule at all. I also have a patch that changes the value returned in non-matching case, but it's in "dirty hack" state, as of yet. The ACL code does not treat zero userdata specially, so this is only a policy choice and as such would be better to be made by the user. Best Regards, Michał Mirosław