-
Notifications
You must be signed in to change notification settings - Fork 35
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
Basic project structure + Build scripts #1
Conversation
putting on hold, as I'd like to do a later investigation about wrapping https://github.com/libbpf/libbpf-bootstrap, which seems to work pretty well, in Go. |
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.
LGTM
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.
Thanks, this is great to see the first step here!
LGTM, my comments are more about the code and this is going to change since this is a POC
bpf/headers/update.sh
Outdated
@@ -0,0 +1,19 @@ | |||
#!/usr/bin/env bash |
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.
May be we should move this script to another directory?
Here we are mixing c headers and bash scripts
__uint(max_entries, 1 << 24); | ||
} flows SEC(".maps"); | ||
|
||
struct egress_t { |
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.
My understanding is that this struct and the go struct RawStats have to be equivalent.
Anyway we could generate one from the other?
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.
Unfortunately, I don't know any way (unless we create some kind of parser, which it would be a nice side project)
bpf/headers/update.sh
Outdated
#!/usr/bin/env bash | ||
|
||
# Version of libbpf to fetch headers from | ||
LIBBPF_VERSION=0.7.0 |
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.
How can we make sure we fetch the correct version? libbpf comes pre-installed, or do we install it?
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.
Libbpf is bundled with the Cilium library. We just need the headers for compiling the C code. I'll check if there is a way that we can fetch the Cilium's libbpf version. The destination machine does not need to install any extra library, as libbpf is only used to build the eBPF VM bytecode.
This PR includes: