-
Notifications
You must be signed in to change notification settings - Fork 297
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
bpf: Maps live in maps section #248
Conversation
Note to self: add userspace component to the test case that uses the maps... |
@@ -49,11 +49,13 @@ impl Map { | |||
} | |||
|
|||
pub fn expand(&self) -> Result<TokenStream> { | |||
let section_name = format!("maps/{}", self.name); | |||
let section_name = "maps".to_string(); |
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 expects maps live in .maps
section.
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.
It only expects them in .maps
BTF maps.
But that being said, I think we need a way to specify it by using this macro.
I'm not suggesting it's the right PR to do this, it might be add as part of BTF map support.
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.
The legacy one is deprecated.
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.
The legacy, bpf_map_def
style of map definition is the only style that we support in aya-bpf
right now.
But that being said, I think we need a way to specify it by using this macro.
Not really. If we supported BTF defs, all maps would use BTF map defs.
I'm not sure if libbpf's deprecation notice means support will be removed from the kernel (I doubt it) or whether it's to give users a push to use BTF.
Anyhow, userspace support for BTF maps is proposed in #140 but still needs work.
Support in aya-bpf
for BTF maps is sadly not as simple as the BTF generated for Rust programs by LLVM isn't correct.
This forces all maps to the maps section so we remain compatible with libbpf. This requires aya-rs#181 to avoid breaking userspace. Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
This forces all maps to the maps section so we remain compatible with
libbpf. This requires #181 to avoid breaking userspace.
Signed-off-by: Dave Tucker dave@dtucker.co.uk