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

pull out enums from main BPF class to avoid namespace collisions #3490

Merged

Conversation

davemarchevsky
Copy link
Collaborator

In #3479, the bpf_attach_type enum was pulled into the BPF class so
that its members could be used in attach_func and detach_func
functions introduced to the Python API.

Unfortunately this caused a redefinition of BPF.XDP, which was similarly
pulled in from bpf_prog_type enum, thus breaking program loading
(#3489).

Let's pull these enum- and flag-type class variables out into their own
wrapper classes. For backwards compatibility, keep them all (except for
bpf_attach_type, which was merged 2 days ago) defined in the BPF
class, but add a comment to not continue doing this.

In iovisor#3479, the `bpf_attach_type` enum was pulled into the `BPF` class so
that its members could be used in `attach_func` and `detach_func`
functions introduced to the Python API.

Unfortunately this caused a redefinition of BPF.XDP, which was similarly
pulled in from `bpf_prog_type` enum, thus breaking program loading
(iovisor#3489).

Let's pull these enum- and flag-type class variables out into their own
wrapper classes. For backwards compatibility, keep them all (except for
`bpf_attach_type`, which was merged 2 days ago) defined in the BPF
class, but add a comment to not continue doing this.
@davemarchevsky
Copy link
Collaborator Author

[buildbot, test this please]

1 similar comment
@yonghong-song
Copy link
Collaborator

[buildbot, test this please]

@yonghong-song
Copy link
Collaborator

[buildbot, ok to test]

@yonghong-song
Copy link
Collaborator

LGTM. Thanks!

@yonghong-song yonghong-song merged commit 2731825 into iovisor:master Jun 16, 2021
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.

Python load_func broken in master
2 participants