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

chore: update BPF_PROG_TYPE_SCHED_ACT.md #95

Merged

Conversation

ianchen0119
Copy link
Contributor

Hi @dylandreimerink

I noticed that the page of BPF_PROG_TYPE_SCHED_ACT has a to be improved mark.
So, I added some information in this page.

However,
I'm not sure the Kfuncs and helpers sections are 100% correct.
My checking way is:

  • search the kernel source with keyword register_btf_kfunc_id_set(BPF_PROG_TYPE_SCHED_ACT for kfuncs section.
  • read the comments in tools/include/uapi/linux/bpf.h for helpers section.

Do you have any suggestion on this?

Thank you!

@dylandreimerink
Copy link
Collaborator

I noticed that the page of BPF_PROG_TYPE_SCHED_ACT has a to be improved mark. So, I added some information in this page.

Thank you. Do you happen to know what sets the SCHED_ACT program apart from a SCHED_CLS in direct-action mode? I have personally never seen SCHED_ACT used, its always the classifier in DA.

search the kernel source with keyword register_btf_kfunc_id_set(BPF_PROG_TYPE_SCHED_ACT for kfuncs section.

This is also how I have done it in the past.

read the comments in tools/include/uapi/linux/bpf.h for helpers section.

Resolving helpers is more difficult in general. The kernel has a bunch of functions that call into each other. I modeled this with the data file.

To double check it you start at the verifier ops for the SCHED_ACT programs and work down:

The data file contains "groups" for each of these functions that are squashed. So as long as the list of helpers in every group is correct, and the groups reference each other correctly the end result should be good.

Copy link
Collaborator

@dylandreimerink dylandreimerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks great, just the one thing.

@ianchen0119
Copy link
Contributor Author

Hi @dylandreimerink

Thank you. Do you happen to know what sets the SCHED_ACT program apart from a SCHED_CLS in direct-action mode? I have personally never seen SCHED_ACT used, its always the classifier in DA.

Me too, I have never seen the SCHED_ACT used. But I can find some example on GitHub link.

Resolving helpers is more difficult in general. The kernel has a bunch of functions that call into each other. I modeled this with the data file.
To double check it you start at the verifier ops for the SCHED_ACT programs and work down:
...

Thanks for your information, It's really helpful to me.

@dylandreimerink
Copy link
Collaborator

Me too, I have never seen the SCHED_ACT used. But I can find some example on GitHub link.

Thanks for the link!

@dylandreimerink dylandreimerink merged commit 123eaae into isovalent:master Dec 3, 2024
1 check passed
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.

2 participants