summaryrefslogtreecommitdiff
path: root/lib/librte_acl
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2015-01-20 18:40:52 +0000
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-01-28 17:11:25 +0100
commitefb25293859b380585c4ba9a5f9ff385a12b208f (patch)
tree60d4b1d41ece84d8cb8c3dd52eee097c396a5cc4 /lib/librte_acl
parent589758eb1c367773cbe0b76ac5837bde76916511 (diff)
downloaddpdk-efb25293859b380585c4ba9a5f9ff385a12b208f.zip
dpdk-efb25293859b380585c4ba9a5f9ff385a12b208f.tar.gz
dpdk-efb25293859b380585c4ba9a5f9ff385a12b208f.tar.xz
acl: make data indexes long enough to survive idle transitions
Make data_indexes long enough to survive idle transitions. That allows to simplify match processing code. Also fix incorrect size calculations for data indexes. Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Diffstat (limited to 'lib/librte_acl')
-rw-r--r--lib/librte_acl/acl_bld.c5
-rw-r--r--lib/librte_acl/acl_run.h4
2 files changed, 3 insertions, 6 deletions
diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c
index d6e0c45..c5a674a 100644
--- a/lib/librte_acl/acl_bld.c
+++ b/lib/librte_acl/acl_bld.c
@@ -1948,7 +1948,7 @@ acl_set_data_indexes(struct rte_acl_ctx *ctx)
memcpy(ctx->data_indexes + ofs, ctx->trie[i].data_index,
n * sizeof(ctx->data_indexes[0]));
ctx->trie[i].data_index = ctx->data_indexes + ofs;
- ofs += n;
+ ofs += RTE_ACL_MAX_FIELDS;
}
}
@@ -1988,7 +1988,8 @@ rte_acl_build(struct rte_acl_ctx *ctx, const struct rte_acl_config *cfg)
/* allocate and fill run-time structures. */
rc = rte_acl_gen(ctx, bcx.tries, bcx.bld_tries,
bcx.num_tries, bcx.cfg.num_categories,
- RTE_ACL_IPV4VLAN_NUM * RTE_DIM(bcx.tries),
+ RTE_ACL_MAX_FIELDS * RTE_DIM(bcx.tries) *
+ sizeof(ctx->data_indexes[0]),
bcx.num_build_rules);
if (rc == 0) {
diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h
index c191053..4c843c1 100644
--- a/lib/librte_acl/acl_run.h
+++ b/lib/librte_acl/acl_run.h
@@ -256,10 +256,6 @@ acl_match_check(uint64_t transition, int slot,
/* Fill the slot with the next trie or idle trie */
transition = acl_start_next_trie(flows, parms, slot, ctx);
-
- } else if (transition == ctx->idle) {
- /* reset indirection table for idle slots */
- parms[slot].data_index = idle;
}
return transition;