adapt 6.6
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes: Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign nlgwcy for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Summary of Changes
Hello @lec-bit, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly refactors the Kmesh eBPF and kernel module components to enhance compatibility with newer Linux kernels, particularly version 6.x. The core change involves integrating BPF kfuncs for key operations like header parsing and socket option handling, which allows eBPF programs to directly call kernel functions. This adaptation simplifies the codebase by removing older, kernel-specific conditional logic, such as that for openEuler-23.03, and introduces a more robust mechanism for kernel feature detection. The changes also include updates to generated eBPF Go bindings and the Kmesh kernel module's build and initialization processes to support this new kfunc-based architecture.
Highlights
- BPF kfunc Integration: Introduced BPF kfuncs for header parsing and socket option manipulation, enabling direct kernel function calls from eBPF programs on compatible kernels (Linux 6.x and above with BTF support). This includes new kfunc declarations and wrapper functions like
bpf_km_setsockoptandbpf_km_getsockopt. - Kernel Version Adaptation: Removed specific compatibility layers related to
openEuler-23.03(OE_23_03macro and associated conditional code), streamlining the codebase for broader and more generalized kernel compatibility. - eBPF Program Generation Updates: Updated
bpf2gogenerated Go files to reflect changes in eBPF map and program definitions. This includes the addition of newkmeshcgroupsockrelated files for enhanced kernel support and the removal of rate-limiting maps in favor of aKmRouterconfigmap in normal kernel builds. - Kernel Module Refactoring: Refactored the Kmesh kernel module to initialize and utilize the new kfunc infrastructure. This involved making previously static helper functions globally accessible or exposed as kfuncs, and integrating
kmesh_func_init/exitcalls into the module's lifecycle.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
In kernel's heart, new kfuncs bloom, Old paths now fade, dispelling gloom. With BTF's light, a clearer way, Code adapts, for a brighter day.
[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.
Codecov Report
:x: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 37.84%. Comparing base (fe941b3) to head (146b50e).
:warning: Report is 2 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| pkg/controller/controller.go | 0.00% | 2 Missing :warning: |
:x: Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| pkg/controller/controller.go | 0.00% <0.00%> (ø) |
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 9d6febf...146b50e. Read the comment docs.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.