bpf: Add tests for the lpm trie map
authorDavid Herrmann <dh.herrmann@gmail.com>
Sat, 21 Jan 2017 16:26:12 +0000 (17:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Jan 2017 21:10:38 +0000 (16:10 -0500)
commit4d3381f5a322dd5db2477e224821790478488173
tree1a6807d2ca42f2f8c99d7486fcde67b3fa8f6ae9
parentb95a5c4db09bc7c253636cb84dc9b12c577fd5a0
bpf: Add tests for the lpm trie map

The first part of this program runs randomized tests against the
lpm-bpf-map. It implements a "Trivial Longest Prefix Match" (tlpm)
based on simple, linear, single linked lists. The implementation
should be pretty straightforward.

Based on tlpm, this inserts randomized data into bpf-lpm-maps and
verifies the trie-based bpf-map implementation behaves the same way
as tlpm.

The second part uses 'real world' IPv4 and IPv6 addresses and tests
the trie with those.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/test_lpm_map.c [new file with mode: 0644]