Skip to content
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

Remove BTF type IDs on map creation if not supported #534

Merged
merged 3 commits into from
Jan 13, 2022

Conversation

chenhengqi
Copy link
Contributor

In libbpf commit 962f24137978 (0), we teach libbpf to recognize
BPF maps that do not support BTF-defined key/value and remove
BTF type IDs quietly on map creation. Make ebpf library support
this feature.

@ti-mo ti-mo self-requested a review January 13, 2022 10:09
chenhengqi and others added 3 commits January 13, 2022 11:46
In libbpf commit 962f24137978 ([0]), we teach libbpf to recognize
BPF maps that do not support BTF-defined key/value and remove
BTF type IDs quietly on map creation. Make ebpf library support
this feature.

  [0]: libbpf/libbpf@962f241

Signed-off-by: Hengqi Chen <chenhengqi@outlook.com>
go-staticcheck complains that the unused receiver name
should be omitted. Remove it.

Signed-off-by: Hengqi Chen <chenhengqi@outlook.com>
Removes the btfDisabled flag in createMap() to make the logic a bit leaner.

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo
Copy link
Collaborator

ti-mo commented Jan 13, 2022

Hi @chenhengqi, thanks for the patch! I've pushed a small helper to your branch to simplify the logic at the end of createMap() and renamed the mt helper to hasBTF().

@ti-mo ti-mo merged commit 13a518a into cilium:master Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants