numam-dpdk/lib/librte_acl
Konstantin Ananyev 2f372ab5c9 acl: fix matching rule
Reported by Zi Hu:
"
cat test_data/rule1
@192.168.0.0/24 192.168.0.0/24 400 : 500 0 : 52 6/0xff
@192.168.0.0/24 192.168.0.0/24 400 : 500 54 : 65280 6/0xff
@192.168.0.0/24 192.168.0.0/24 400 : 500 0 : 65535 6/0xff

cat test_data/trace1
0xc0a80005 0xc0a80009 450 53 0x06

I run the test by:
sudo ./testacl -n 2 -c 4 -- --rulesf=./test_data/rule1
 --tracef=./test_data/trace1

The result shows that the packet matches the second rule,  which is wrong.
The dest port of the pkt is 53, so it should match the third rule.
"

Indeed there is problem at ACL build stage.
Sometimes acl_merge_trie() is too aggressive in trying to conserve
space at build time.
So it takes a wrong assumptions and didn't duplicate a node,
even when it should.
The easiest and safest fix seems to always duplicate a left non-root/non-leaf
node first, and let the further code to destroy the node, if it is not needed.

Reported-by: Zi Hu <huzilucky@gmail.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-04 11:14:45 +02:00
..
acl_bld.c acl: fix matching rule 2015-06-04 11:14:45 +02:00
acl_gen.c acl: introduce config parameter for performance/space trade-off 2015-01-28 17:11:26 +01:00
acl_run_avx2.c acl: use scalar method fastest for some cases 2015-01-28 17:11:25 +01:00
acl_run_avx2.h acl: deduplicate some SSE and AVX2 code 2015-01-28 17:11:25 +01:00
acl_run_scalar.c acl: deduplicate a bit of RT code 2015-01-28 17:11:25 +01:00
acl_run_sse.c acl: use scalar method fastest for some cases 2015-01-28 17:11:25 +01:00
acl_run_sse.h acl: deduplicate some SSE and AVX2 code 2015-01-28 17:11:25 +01:00
acl_run.h acl: use scalar method fastest for some cases 2015-01-28 17:11:25 +01:00
acl_vect.h acl: deduplicate some SSE and AVX2 code 2015-01-28 17:11:25 +01:00
acl.h acl: add comments about internal layout 2015-01-28 17:12:16 +01:00
Makefile mk: add library version extension 2015-02-03 16:56:58 +01:00
rte_acl_osdep.h eal/x86: move header file for vector instructions 2015-03-20 19:24:38 +01:00
rte_acl_version.map lib: provide initial versioning 2015-02-03 16:56:58 +01:00
rte_acl.c tailq: move to dynamic tailq 2015-03-10 12:06:08 +01:00
rte_acl.h tailq: move to dynamic tailq 2015-03-10 12:06:08 +01:00
tb_mem.c acl: use setjmp/longjmp to handle alloc failures at build phase 2015-04-28 11:55:03 +02:00
tb_mem.h acl: use setjmp/longjmp to handle alloc failures at build phase 2015-04-28 11:55:03 +02:00