From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Bly, Mike" <mbly@ciena.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
Subject: Re: [dpdk-dev] ACL priority field
Date: Wed, 29 Jan 2020 14:03:54 +0000 [thread overview]
Message-ID: <SN6PR11MB25582A51D08CF1EB5D3AFCD09A050@SN6PR11MB2558.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MWHPR04MB0592ACF553B909EC621E4AD3CF0B0@MWHPR04MB0592.namprd04.prod.outlook.com>
Hi,
>
> Hello,
>
> Can someone clarify what I am interpreting as a documentation conflict regarding the "priority" field for rte_table_acl_rule_add_params?
> Below documentation says "highest priority wins", but the header file comment says 0 is highest priority. Based on my testing with
> conflicting entries, I would like ask if we can/should update the documentation/descriptions to state "the lowest non-negative integer
> priority value will be selected". Highest priority implies select X, when X > Y >= 0. However, based on my testing, that is not the case.
> Instead, Y is selected.
>
> From: https://doc.dpdk.org/guides/prog_guide/packet_classif_access_ctrl.html
>
> When creating a set of rules, for each rule, additional information must be supplied also:
> * priority: A weight to measure the priority of the rules (higher is better)... If the input tuple matches more than one rule, then the rule
> with the higher priority is returned. Note that if the input tuple matches more than one rule and these rules have equal priority, it is
> undefined which rule is returned as a match. It is recommended to assign a unique priority for each rule.
> From: http://doc.dpdk.org/api/structrte__table__acl__rule__add__params.html
>
> int32_t priority
> ACL rule priority, with 0 as the highest priority
I think you are mixing 2 different entities here:
librte_acl and librte_table.
For librte_acl - higher priority wins.
librte_table_acl.c uses librte_acl inside,
but AFAIK has reverse ordering for priority:
'lesser priority wins'.
Inside it reverts rules priority before adding it
into the ACL lib ctx.
static int
rte_table_acl_entry_add(
void *table,
void *key,
void *entry,
int *key_found,
void **entry_ptr)
{
...
if (rule->priority > RTE_ACL_MAX_PRIORITY) {
RTE_LOG(ERR, TABLE, "%s: Priority is too high\n", __func__);
return -EINVAL;
}
/* Setup rule data structure */
memset(&acl_rule, 0, sizeof(acl_rule));
...
acl_rule.data.priority = RTE_ACL_MAX_PRIORITY - rule->priority;
next prev parent reply other threads:[~2020-01-29 14:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-27 21:42 Bly, Mike
2020-01-29 14:03 ` Ananyev, Konstantin [this message]
2020-01-29 16:30 ` Bly, Mike
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SN6PR11MB25582A51D08CF1EB5D3AFCD09A050@SN6PR11MB2558.namprd11.prod.outlook.com \
--to=konstantin.ananyev@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=mbly@ciena.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).