netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] bpf: add longest prefix match map
@ 2016-12-29 17:28 Daniel Mack
  2016-12-29 17:28 ` [PATCH v1 1/2] bpf: add a longest prefix match trie map implementation Daniel Mack
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Daniel Mack @ 2016-12-29 17:28 UTC (permalink / raw)
  To: ast; +Cc: dh.herrmann, daniel, netdev, davem, Daniel Mack

This patch set adds a longest prefix match algorithm that can be used
to match IP addresses to a stored set of ranges. It is exposed as a
bpf map type.
   
Internally, data is stored in an unbalanced tree of nodes that has a
maximum height of n, where n is the prefixlen the trie was created
with.
 
Not that this has nothing to do with fib or fib6 and is in no way meant
to replace or share code with it. It's rather a much simpler
implementation that is specifically written with bpf maps in mind.
 
Patch 1/2 adds the implementation, and 2/2 an extensive test suite.
 
Feedback is much appreciated.
 
 
Thanks,
Daniel

Changelog:

rfc -> v1:
	* Add __rcu pointer annotations to make sparse happy
	* Fold _lpm_trie_find_target_node() into its only caller
	* Fix some minor documentation issues


Daniel Mack (1):
  bpf: add a longest prefix match trie map implementation

David Herrmann (1):
  bpf: Add tests for the lpm trie map

 include/uapi/linux/bpf.h                   |   7 +
 kernel/bpf/Makefile                        |   2 +-
 kernel/bpf/lpm_trie.c                      | 468 +++++++++++++++++++++++++++++
 tools/testing/selftests/bpf/.gitignore     |   1 +
 tools/testing/selftests/bpf/Makefile       |   4 +-
 tools/testing/selftests/bpf/test_lpm_map.c | 348 +++++++++++++++++++++
 6 files changed, 827 insertions(+), 3 deletions(-)
 create mode 100644 kernel/bpf/lpm_trie.c
 create mode 100644 tools/testing/selftests/bpf/test_lpm_map.c

-- 
2.9.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-01-06 19:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-29 17:28 [PATCH v1 0/2] bpf: add longest prefix match map Daniel Mack
2016-12-29 17:28 ` [PATCH v1 1/2] bpf: add a longest prefix match trie map implementation Daniel Mack
2017-01-05 16:25   ` Daniel Borkmann
2017-01-05 16:40     ` Daniel Borkmann
2017-01-05 20:01     ` Daniel Borkmann
2017-01-05 20:14       ` Daniel Mack
2017-01-06 10:43         ` Daniel Borkmann
2017-01-06 19:59           ` Alexei Starovoitov
2017-01-05 20:04     ` Daniel Mack
2017-01-05 20:20       ` Daniel Borkmann
2016-12-29 17:28 ` [PATCH v1 2/2] bpf: Add tests for the lpm trie map Daniel Mack
2016-12-30 20:25 ` [PATCH v1 0/2] bpf: add longest prefix match map David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).