Skip to content

added periodic report knob for long connection #1360

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

Merged
merged 2 commits into from
May 6, 2025

Conversation

yp969803
Copy link
Contributor

@yp969803 yp969803 commented May 1, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:
added periodic report knob for long connection

Which issue(s) this PR fixes:
Fixes #1356

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

added periodic report knob for long connection

@Copilot Copilot AI review requested due to automatic review settings May 1, 2025 13:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a feature to control periodic reporting for long connections by adding a new knob that propagates the setting from the status server, through the BPF loader, into the kernel-space BPF programs.

  • Adds a new handler in pkg/status/status_server.go to update the periodic report setting.
  • Implements the UpdateEnablePeriodicReport method in pkg/bpf/bpf.go to change the knob value.
  • Updates BPF C code and related Go mapping structs to include the new periodic report variable.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

File Description
pkg/status/status_server.go Adds code to update the periodic report knob based on the enabled flag.
pkg/bpf/bpf.go Introduces UpdateEnablePeriodicReport function to propagate the knob value.
bpf/kmesh/workload/cgroup_skb.c Adds a global variable and inline function to check the periodic report setting.
bpf/kmesh/bpf2go/* Updates BPF mapping specifications to include the new periodic report variable.
Comments suppressed due to low confidence (2)

pkg/bpf/bpf.go:515

  • [nitpick] Consider renaming the parameter 'EnablePeriodicReport' to 'enablePeriodicReport' to follow Go naming conventions.
func (l *BpfLoader) UpdateEnablePeriodicReport(EnablePeriodicReport uint32) error {

bpf/kmesh/workload/cgroup_skb.c:16

  • [nitpick] The function name 'is__periodic_report_enable' contains a double underscore; renaming it to 'is_periodic_report_enabled' could improve clarity and consistency.
static inline bool is__periodic_report_enable()

@yp969803
Copy link
Contributor Author

yp969803 commented May 1, 2025

@hzxuzhonghu @nlgwcy @LiZhenCheng9527 review request !!

@yp969803 yp969803 changed the title Issue1356 added periodic report knob for long connection May 1, 2025
Copy link

codecov bot commented May 1, 2025

Codecov Report

Attention: Patch coverage is 7.14286% with 13 lines in your changes missing coverage. Please review.

Project coverage is 46.21%. Comparing base (44253ce) to head (ac7a958).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
pkg/status/status_server.go 12.50% 5 Missing and 2 partials ⚠️
pkg/bpf/bpf.go 0.00% 6 Missing ⚠️
Files with missing lines Coverage Δ
pkg/bpf/bpf.go 40.78% <0.00%> (-0.66%) ⬇️
pkg/status/status_server.go 33.33% <12.50%> (-0.42%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d2122a...ac7a958. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yp969803
Copy link
Contributor Author

yp969803 commented May 1, 2025

/retest

Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/lgtm

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot kmesh-bot merged commit 96ada9e into kmesh-net:main May 6, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should add a knob to not run cgroup_skb/ingress and cgroup_skb/egress
3 participants