Skip to content

bpf: runtime config for KERNEL_HZ and ENABLE_JIFFIES#43112

Merged
ti-mo merged 2 commits intomainfrom
pr/vk/bpf/kernel_hz/cfg
Dec 18, 2025
Merged

bpf: runtime config for KERNEL_HZ and ENABLE_JIFFIES#43112
ti-mo merged 2 commits intomainfrom
pr/vk/bpf/kernel_hz/cfg

Conversation

@viktor-kurchenko
Copy link
Copy Markdown
Contributor

@viktor-kurchenko viktor-kurchenko commented Dec 3, 2025

Please see description per commit.

Related to: #38370

@viktor-kurchenko viktor-kurchenko added area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. release-note/misc This PR makes changes that have no direct user impact. labels Dec 3, 2025
@viktor-kurchenko viktor-kurchenko force-pushed the pr/vk/bpf/kernel_hz/cfg branch 3 times, most recently from 328db49 to 7931b7f Compare December 3, 2025 19:42
@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

1 similar comment
@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@viktor-kurchenko viktor-kurchenko added the area/loader Impacts the loading of BPF programs into the kernel. label Dec 4, 2025
@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@viktor-kurchenko viktor-kurchenko marked this pull request as ready for review December 4, 2025 11:06
@viktor-kurchenko viktor-kurchenko requested review from a team as code owners December 4, 2025 11:06
Copy link
Copy Markdown
Contributor

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on! I've left some comments for small potential improvements to our time API.

@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

1 similar comment
@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@harsimran-pabla
Copy link
Copy Markdown
Contributor

Hi @viktor-kurchenko, should probably go directly to NODE_CONFIG in this commit bpf, time: migrate to runtime config ?

@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

Hi @viktor-kurchenko, should probably go directly to NODE_CONFIG in this commit bpf, time: migrate to runtime config ?

Hi @harsimran-pabla, do you mean to squash the following commits:

@harsimran-pabla
Copy link
Copy Markdown
Contributor

Hi @harsimran-pabla, do you mean to squash the following commits:

aa8d596
ce822d1

Yes that's right.

@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

Yes that's right.

Done!

Copy link
Copy Markdown
Contributor

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

Thanks, this cleans up the API nicely! Left a few comments.

@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@viktor-kurchenko viktor-kurchenko force-pushed the pr/vk/bpf/kernel_hz/cfg branch 2 times, most recently from 2f8dc9b to 0232d9e Compare December 17, 2025 13:18
@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@ti-mo
Copy link
Copy Markdown
Contributor

ti-mo commented Dec 18, 2025

@viktor-kurchenko Looks like I introduced a merge conflict, would you be able to rebase? Please squash this down to 2 commits, one being the config migration and the other the header cleanups.

We have just a few time-helper macros that are spread across time and
mono headers. The commit moves all macros from the mono header into the
time header and removes the mono header. The motivation here is to keep
all time helper code in a single header file.

The `ENABLE_JIFFIES` and `KERNEL_HZ` have been migrated to runtime
configuration. The helper time macros were converted into regular C
functions to be able to use read `enable_jiffies` and `kernel_hz`
runtime properties using `CONFIG` macro.

The `ktime_get_ns` and `jiffies` (translates to `jiffies64`) macros are
overwritten into conntrack_test. To make it work properly, they must be
defined before the time header getd included, otherwise preprocessor
statements can be out of order.

Also, dead code removed.

Signed-off-by: viktor-kurchenko <viktor.kurchenko@isovalent.com>
The `jiffies` macro is used only in a single place in the time header.
Let's remove it and use the `jiffies64` function as is.

Also, `kernel_hz` sentinel value: 1 removed. This should be fine now
because `kernel_hz` property has been migrated to runtime configuration
and `division by zero` error can be caught at compile time.

Signed-off-by: viktor-kurchenko <viktor.kurchenko@isovalent.com>
@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

@viktor-kurchenko Looks like I introduced a merge conflict, would you be able to rebase? Please squash this down to 2 commits, one being the config migration and the other the header cleanups.

Done!

@ti-mo ti-mo enabled auto-merge December 18, 2025 09:35
@ti-mo ti-mo added this pull request to the merge queue Dec 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2025
@ti-mo ti-mo added this pull request to the merge queue Dec 18, 2025
Merged via the queue into main with commit b7aea55 Dec 18, 2025
445 of 455 checks passed
@ti-mo ti-mo deleted the pr/vk/bpf/kernel_hz/cfg branch December 18, 2025 11:28
@cilium-release-bot cilium-release-bot bot moved this to Released in cilium v1.19.0 Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. area/loader Impacts the loading of BPF programs into the kernel. release-note/misc This PR makes changes that have no direct user impact.

Projects

No open projects
Status: Released

Development

Successfully merging this pull request may close these issues.

5 participants