Skip to content

Conversation

@IWDTestBot
Copy link
Owner

Return the number of freqs in a scan_freq_set, useful for knowing how
big the set is.

src/util.c | 11 +++++++++++
src/util.h | 1 +
2 files changed, 12 insertions(+)

jprestwo and others added 11 commits April 2, 2025 13:19
This is taken care of by the individual cache items and
if none exist, tar fails.
Return the number of freqs in a scan_freq_set, useful for knowing how
big the set is.
This is a hashmap where the keys are freqs and the values are
timestamps. When a freq has been scanned, the timestamp for that freq is
updated to "now". The function scan_get_freq_age can be used for getting
the age of a freq, which is how long time ago it was last scanned.

This is useful for deciding if a certain freq should be scanned, or if
it's better to spend that time on scanning another freq.
When IWD decides to roam, it scans either neighbor freqs or known freqs
(if neighbors are not available). If it fails to roam after getting the
scan results, it scans ALL freqs. In my testing there's a high chance
that both neighbor and/or known scans fail to roam and we end up
scanning all freqs. This is very slow and if you're already moving away
from the current BSS, there's a high chance you will lose connection
completely before the scan is finished.

Instead of scanning all freqs at once, split them up into prioritized
subsets. Each subset contains a handful of freqs each, a lower index for
the subset means that its freqs are more common. So subset 0 has the
most common freqs and subset 3 has the least common freqs. The first two
subsets also contain no DFS channels, speeding up scanning even more. In
order to make this efficient, use the "scan_freq_map" to avoid scanning
freqs that were recently scanned.

When a roam scan is triggered, add the most prioritized freqs to the
list of freqs that should be scanned. The order of priority is:

1. Neighbor freqs
2. Known freqs
3. Subsets, starting with index 0 and incrementing if the subset is
   exhausted

For each freq candidate, check the scan_freq_map to see how long time
ago this freq was last scanned, this is denoted as its "age". If its age
is above a threshold, add the freq to the list, otherwise discard it.
Once the list has a certain size, start the scan. If no roaming occurs
after the scan is completed, run the same function again. It will now
pick new freqs since the previous freqs have been updated in
scan_freq_map.

This approach results in more scans, but fewer freqs per scan, leading
to shorter delays between scan results. It also avoids scanning the same
freqs back-to-back, which is generally not very useful. In combination
with the freq priority, this increases the chance of finding a good BSS
early.
@IWDTestBot
Copy link
Owner Author

Fetch PR
Test ID: fetch
Desc: Fetch the PR commits for this CI run
Duration: 3.42 seconds
Result: PASS

Prep - Setup ELL
Test ID: setupell
Desc: Clone, build, and install ELL
Duration: 26.63 seconds
Result: PASS

Make Distcheck
Test ID: makedistcheck
Desc: Run distcheck to check the distribution
Duration: 58.09 seconds
Result: PASS

Build - Configure
Test ID: build
Desc: Configure the BlueZ source tree
Duration: 12.18 seconds
Result: PASS

Make Check
Test ID: makecheck
Desc: Run 'make check'
Duration: 0.00 seconds
Result: SKIP

Output:

makecheck was skipped

Make Check w/Valgrind
Test ID: makecheckvalgrind
Desc: Run 'make check' with Valgrind
Duration: 24.29 seconds
Result: FAIL

Output:

src/station.c: In function 'station_get_roam_scan_freqs':
src/station.c:3142:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 3142 |         const struct network_info *info = network_get_info(
      |         ^~~~~
At top level:
src/station.c:5075:13: error: 'station_add_2_4ghz_freq' defined but not used [-Werror=unused-function]
 5075 | static void station_add_2_4ghz_freq(uint32_t freq, void *user_data)
      |             ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:2633: src/station.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1780: all] Error 2

Incremental Build with patches
Test ID: incremental_build
Desc: Incremental build per patch in the series
Duration: 121.37 seconds
Result: FAIL

Output:

src/station.c: In function 'station_get_roam_scan_freqs':
src/station.c:3142:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 3142 |         const struct network_info *info = network_get_info(
      |         ^~~~~
At top level:
src/station.c:5075:13: error: 'station_add_2_4ghz_freq' defined but not used [-Werror=unused-function]
 5075 | static void station_add_2_4ghz_freq(uint32_t freq, void *user_data)
      |             ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:2633: src/station.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1780: all] Error 2

@IWDTestBot
Copy link
Owner Author

Fetch PR
Test ID: fetch
Desc: Fetch the PR commits for this CI run
Duration: 4.57 seconds
Result: PASS

GitLint
Test ID: gitlint
Desc: Run gitlint with rule in .gitlint
Duration: 10.23 seconds
Result: PASS

Prep - Setup ELL
Test ID: setupell
Desc: Clone, build, and install ELL
Duration: 26.93 seconds
Result: PASS

Make Distcheck
Test ID: makedistcheck
Desc: Run distcheck to check the distribution
Duration: 39.26 seconds
Result: PASS

Build - Configure
Test ID: build
Desc: Configure the BlueZ source tree
Duration: 23.31 seconds
Result: PASS

Make Check
Test ID: makecheck
Desc: Run 'make check'
Duration: 0.00 seconds
Result: SKIP

Output:

makecheck was skipped

Make Check w/Valgrind
Test ID: makecheckvalgrind
Desc: Run 'make check' with Valgrind
Duration: 36.20 seconds
Result: FAIL

Output:

src/station.c: In function ‘station_get_roam_scan_freqs’:
src/station.c:3142:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 3142 |         const struct network_info *info = network_get_info(
      |         ^~~~~
At top level:
src/station.c:5075:13: error: ‘station_add_2_4ghz_freq’ defined but not used [-Werror=unused-function]
 5075 | static void station_add_2_4ghz_freq(uint32_t freq, void *user_data)
      |             ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:2632: src/station.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1779: all] Error 2

Incremental Build with patches
Test ID: incremental_build
Desc: Incremental build per patch in the series
Duration: 152.93 seconds
Result: FAIL

Output:

src/station.c: In function ‘station_get_roam_scan_freqs’:
src/station.c:3142:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 3142 |         const struct network_info *info = network_get_info(
      |         ^~~~~
At top level:
src/station.c:5075:13: error: ‘station_add_2_4ghz_freq’ defined but not used [-Werror=unused-function]
 5075 | static void station_add_2_4ghz_freq(uint32_t freq, void *user_data)
      |             ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:2632: src/station.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1779: all] Error 2

Autotest Runner
Test ID: testrunner
Desc: Runs IWD's autotest framework
Duration: 0.00 seconds
Result: SKIP

Output:

testrunner was skipped

Clang Build
Test ID: clang
Desc: Build IWD using clang compiler
Duration: 39.19 seconds
Result: FAIL

Output:

src/station.c:3142:29: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
        const struct network_info *info = network_get_info(
                                   ^
1 error generated.
make[1]: *** [Makefile:2632: src/station.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1779: all] Error 2

@github-actions github-actions bot force-pushed the workflow branch 3 times, most recently from a2c9985 to 624cea8 Compare April 23, 2025 14:49
@github-actions github-actions bot force-pushed the workflow branch 7 times, most recently from f77997d to bc55824 Compare May 7, 2025 12:14
@github-actions github-actions bot force-pushed the workflow branch 2 times, most recently from 0e6ebfd to 9ab928a Compare May 28, 2025 17:40
@github-actions github-actions bot force-pushed the workflow branch 2 times, most recently from 2123adf to d37ddb0 Compare June 5, 2025 15:31
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.

3 participants