Skip to content

Conversation

@invidian
Copy link

@invidian invidian commented Oct 14, 2025

Description

This PR updates vmlinux.h to include struct proto_accept_arg from Linux 6.10+ (torvalds/linux@92ef0fd) and then makes use of it in dropreason plugin to make plugin compatible with both kernels 6.10+ and older using bpf_core_type_exists.

Related Issue

#1906

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Additional Notes

vmlinux.h still needs to be regenerated for arm64 which I'll try to soon. Done.

Also, I need to test those changes back on kernel 6.6 to make sure it's still working

Also, I am not aware if this change is covered by unit tests which would detect the regressions.


Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

@invidian invidian requested a review from a team as a code owner October 14, 2025 19:40
@invidian invidian requested review from camrynl and snguyen64 October 14, 2025 19:40
@invidian invidian force-pushed the fix-dropreason-linux-6.10 branch 3 times, most recently from ea79e10 to 7c53820 Compare October 21, 2025 17:42
@invidian invidian force-pushed the fix-dropreason-linux-6.10 branch from 7c53820 to 2e42983 Compare October 22, 2025 14:01
@invidian invidian changed the title Fix dropreason for Linux 6.10+ feat: Fix dropreason for Linux 6.10+ Oct 24, 2025
@invidian invidian force-pushed the fix-dropreason-linux-6.10 branch 4 times, most recently from 7a0fd8b to a78463a Compare October 30, 2025 09:22
struct sock *retsk = NULL;

int offset;
if (bpf_core_type_exists(struct proto_accept_arg))
Copy link
Author

Choose a reason for hiding this comment

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

Getting this part right requires some extensive testing. It would be good to have this covered by some form of automated tests to make sure code from those probes work as expected.

Copy link
Member

@nddq nddq left a comment

Choose a reason for hiding this comment

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

@invidian please empty out all of the object binaries. The reason we have those in there is for the linter to not complain since those are being embedded in the generated ebpf go files. Also, in terms of updating the vmlinux.h, we will open a PR from our side. Just to confirm, the vmlinux.h changes were from libbpf upstream correct? Or did you include any custom changes from elsewhere as well

@invidian invidian force-pushed the fix-dropreason-linux-6.10 branch from a78463a to d87dd7e Compare October 30, 2025 16:14
@invidian
Copy link
Author

Thanks for reviewing. I removed binary files from the PR. At the moment vmlinux.h files are taken from https://github.com/inspektor-gadget/inspektor-gadget/tree/main/include/gadget, just to make images to build. Appropriate sourcing is definitely worth it. It shouldn't have any custom changes though.

@invidian invidian requested a review from nddq November 3, 2025 06:51
nddq and others added 2 commits November 6, 2025 09:21
This patch updates the bpf header files, as well as introduce Make
commands to help updating these files in the future. Also update the
Dockerfile for building the agent and generating Go codes.

Signed-off-by: Quang Nguyen <[email protected]>
@invidian invidian force-pushed the fix-dropreason-linux-6.10 branch from d87dd7e to 8f63bdc Compare November 6, 2025 09:42
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