我正在使用 DPDK-20.08 测试 DPDK-ACL 库性能。我已将数千条 acl 规则添加到 acl 上下文中,但仍然只有一个 trie。什么情况下可以拆分成multi-trie?
PS: 如果我将 rte_acl_config 中的 max_size 设置为小于所需的数字,则多次尝试后都会失败。
ACL: Gen phase for ACL ctx "ipv4_acl_0" exceeds max_size limit, bytes required: 38044176, allowed: 2097152
ACL: Build phase for ACL "ipv4_acl_0":
node limit for tree split: 16384
nodes created: 77950
memory consumed: 117440610
ACL: trie 0: number of rules: 4000, indexes: 4
ACL: Gen phase for ACL ctx "ipv4_acl_0" exceeds max_size limit, bytes required: 38044176, allowed: 2097152
ACL: Build phase for ACL "ipv4_acl_0":
node limit for tree split: 8192
nodes created: 77950
memory consumed: 117440610
ACL: trie 0: number of rules: 4000, indexes: 4
ACL: Gen phase for ACL ctx "ipv4_acl_0" exceeds max_size limit, bytes required: 38044176, allowed: 2097152
ACL: Build phase for ACL "ipv4_acl_0":
node limit for tree split: 4096
nodes created: 77950
memory consumed: 117440610
ACL: trie 0: number of rules: 4000, indexes: 4
ACL: Gen phase for ACL ctx "ipv4_acl_0" exceeds max_size limit, bytes required: 38044176, allowed: 2097152
ACL: Build phase for ACL "ipv4_acl_0":
node limit for tree split: 2048
nodes created: 77950
memory consumed: 117440610
ACL: trie 0: number of rules: 4000, indexes: 4
acl context <ipv4_acl_0>@0x10081fec0
socket_id=0
alg=3
max_rules=4000
rule_size=96
num_rules=4000
num_categories=0
num_tries=0
一个大的 acl trie 的构建和更新速度很慢,因此我们为具有 16 位长掩码的网络创建一个 rte_acl_ctx[255] 数组,并通过 pkt 的 ip 地址的第三个字节(a.b.c.d 中的“c”)选择 rte_acl_ctx ,它有一点开销,但节省了大量构建 trie 的时间,从 3 秒到 300 毫秒。