Repository navigation
functions: use iw for Wi-Fi power saving - #868
Conversation
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesWi-Fi power-save configuration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant _wifi_set_power_level
participant iw
participant iwpriv
participant sysfs
_wifi_set_power_level->>iw: Set power_save for each interface
iw-->>_wifi_set_power_level: Unavailable or command failure
_wifi_set_power_level->>iwpriv: Apply legacy configuration
_wifi_set_power_level->>sysfs: Write quoted power_level value
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@functions`:
- Around line 312-317: Update the power_save assignment near the iw interface
loop so level 6 produces off, matching its definition in the surrounding
configuration instead of enabling power saving. Preserve existing mappings for
other levels and add coverage invoking _run(6) to verify the resulting
power-save setting is off.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 34c8c78c-7214-40f6-9b6b-e0bffe4a5be0
📒 Files selected for processing (3)
functionstests/unit/test_functions.pytuned.spec
44c05df to
57530ba
Compare
The powersave profiles still use the Wireless Extensions iwpriv tool, which Fedora no longer installs. As a result, enabling these profiles leaves Wi-Fi power saving unchanged. Prefer the nl80211-based iw command and translate the profile actions to explicit on and off states. Fall back to iwpriv per interface for legacy drivers, and retain the existing sysfs fallback. Require iw in the RPM spec and cover the modern and legacy paths with unit tests. Fixes redhat-performance#836 Resolves: rhbz#2372365 Signed-off-by: Junjie Cao
57530ba to
f5e0632
Compare
|
Thanks, LGTM. |
The powersave profiles currently use
iwpriv, which Fedora no longerinstalls. Consequently, applying those profiles does not enable Wi-Fi
power saving.
Use the nl80211-based
iw dev IFACE set power_save on|offcommand formodern drivers. If
iwis unavailable or rejects an interface, retainthe existing
iwprivpath for legacy Wireless Extensions drivers. Theexisting sysfs fallback is unchanged.
This also adds
iwto the RPM requirements and covers the followingcases with unit tests:
iw;iwfailure andiwprivfallback;Validation:
tuned.specexpands successfully with Fedora 45 RPM macros;same
iwcommand family.Fixes #836
Resolves: rhbz#2372365