[dpdk-dev,1/8] ACL: fix invalid rule wildness calculation for RTE_ACL_FIELD_TYPE_BITMASK
Commit Message
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
lib/librte_acl/acl_bld.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Comments
Several fixes and code cleanups for the librte_acl.
New test-cases for acl UT.
Konstantin Ananyev (8):
acl: fix invalid rule wildness calculation for bitmask field type
acl: code cleanup - use global EAL macro, instead of creating a local
copy
acl: add function to check build input parameters
acl: fix avoid unneeded trie splitting for subset of rules.
acl: code dedup - introduce a new macro
acl: cleanup remove unused code from acl_bld.c
acl: fix ambiguity between ACL rules in UT.
acl: add new test-cases into UT
app/test-acl/main.c | 3 +-
app/test/test_acl.c | 431 +++++++++++++++++++++++++++++++++++++-
app/test/test_acl.h | 52 ++---
lib/librte_acl/acl_bld.c | 455 +++++++----------------------------------
lib/librte_acl/rte_acl.c | 3 +-
lib/librte_acl/rte_acl.h | 5 +-
lib/librte_acl/rte_acl_osdep.h | 2 -
7 files changed, 530 insertions(+), 421 deletions(-)
2015-06-08 11:41, Konstantin Ananyev:
> Several fixes and code cleanups for the librte_acl.
> New test-cases for acl UT.
>
> Konstantin Ananyev (8):
> acl: fix invalid rule wildness calculation for bitmask field type
> acl: code cleanup - use global EAL macro, instead of creating a local
> copy
> acl: add function to check build input parameters
> acl: fix avoid unneeded trie splitting for subset of rules.
> acl: code dedup - introduce a new macro
> acl: cleanup remove unused code from acl_bld.c
> acl: fix ambiguity between ACL rules in UT.
> acl: add new test-cases into UT
Applied, thanks
@@ -1362,6 +1362,9 @@ acl_calc_wildness(struct rte_acl_build_rule *head,
for (n = 0; n < config->num_fields; n++) {
double wild = 0;
+ uint64_t msk_val =
+ RTE_LEN2MASK(CHAR_BIT * config->defs[n].size,
+ typeof(msk_val));
double size = CHAR_BIT * config->defs[n].size;
int field_index = config->defs[n].field_index;
const struct rte_acl_field *fld = rule->f->field +
@@ -1369,8 +1372,8 @@ acl_calc_wildness(struct rte_acl_build_rule *head,
switch (rule->config->defs[n].type) {
case RTE_ACL_FIELD_TYPE_BITMASK:
- wild = (size - __builtin_popcount(
- fld->mask_range.u8)) /
+ wild = (size - __builtin_popcountll(
+ fld->mask_range.u64 & msk_val)) /
size;
break;