New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg: Add Bitwise LPM Trie Library #29717
Conversation
c116566
to
3e06323
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably good to solicit review from @cilium/ipcache and @cilium/sig-policy given they will own this pkg. The CODEOWNERs change LGTM, but I have not reviewed the trie in detail.
For me, I think the biggest question is whether we really need/want to roll our own trie implementation when we already have a radix tree vendored.
Nice, I was just lamenting the lack of a good bitwise lpm trie in go. |
000d788
to
ec259ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CODEOWNERS lgtm
Looks like this cannot be backported to v1.13 because it doesn't build using Go 1.20 which is still the default Go version on that branch:
|
That's fine. 1.14 is far enough. |
This bitwise lpm trie is a non-thread-safe binary
trie that indexes arbitrarily long bit-based keys
with associated prefixes indexed from most
significant bit to least significant bit using
the longest prefix match algorithm.
Documenting the behavior of the data structure is
localized around the method calls in the trie.go
file.
The tests specifically test boundary cases for the various methods.
Fixes: #29519