* [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY
@ 2025-05-19 16:36 James Prestwood
2025-05-19 16:36 ` [PATCH 2/4] docs: replace/deprecate InitialRoamRequestedTimeout James Prestwood
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: James Prestwood @ 2025-05-19 16:36 UTC (permalink / raw)
To: iwd; +Cc: James Prestwood
The initial pass of this feature only envisioned BSS transition
management frames as the trigger to "roam blacklist" a BSS, hence
the original name. But some APs actually utilize status codes that
also indicate to the stations that they are busy, or not able to
handle more connections. This directly aligns with the original
motivation of the "roam blacklist" series and these events should
also trigger this type of blacklist.
First, since we will be applying this blacklist to cases other
than being told to roam, rename this reason code internally to
BLACKLIST_REASON_AP_BUSY. The config option is also being renamed
to [Blacklist].InitialAccessPointBusyTimeout while also supporting
the old config option, but warning that it is deprecated.
---
src/blacklist.c | 20 ++++++++++++++------
src/blacklist.h | 12 +++++++-----
src/station.c | 5 ++---
3 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/src/blacklist.c b/src/blacklist.c
index 4250618b..a1299261 100644
--- a/src/blacklist.c
+++ b/src/blacklist.c
@@ -45,7 +45,7 @@
static uint64_t blacklist_multiplier;
static uint64_t blacklist_initial_timeout;
-static uint64_t blacklist_roam_initial_timeout;
+static uint64_t blacklist_ap_busy_initial_timeout;
static uint64_t blacklist_max_timeout;
struct blacklist_entry {
@@ -67,8 +67,8 @@ static uint64_t get_reason_timeout(enum blacklist_reason reason)
switch (reason) {
case BLACKLIST_REASON_CONNECT_FAILED:
return blacklist_initial_timeout;
- case BLACKLIST_REASON_ROAM_REQUESTED:
- return blacklist_roam_initial_timeout;
+ case BLACKLIST_REASON_AP_BUSY:
+ return blacklist_ap_busy_initial_timeout;
default:
l_warn("Unhandled blacklist reason: %u", reason);
return 0;
@@ -218,11 +218,19 @@ static int blacklist_init(void)
if (!l_settings_get_uint64(config, "Blacklist",
"InitialRoamRequestedTimeout",
- &blacklist_roam_initial_timeout))
- blacklist_roam_initial_timeout = BLACKLIST_DEFAULT_TIMEOUT;
+ &blacklist_ap_busy_initial_timeout))
+ blacklist_ap_busy_initial_timeout = BLACKLIST_DEFAULT_TIMEOUT;
+ else
+ l_warn("[Blacklist].InitialRoamRequestedTimeout is deprecated, "
+ "use [Blacklist].InitialAccessPointBusyTimeout");
+
+ if (!l_settings_get_uint64(config, "Blacklist",
+ "InitialAccessPointBusyTimeout",
+ &blacklist_ap_busy_initial_timeout))
+ blacklist_ap_busy_initial_timeout = BLACKLIST_DEFAULT_TIMEOUT;
/* For easier user configuration the timeout values are in seconds */
- blacklist_roam_initial_timeout *= L_USEC_PER_SEC;
+ blacklist_ap_busy_initial_timeout *= L_USEC_PER_SEC;
if (!l_settings_get_uint64(config, "Blacklist",
"Multiplier",
diff --git a/src/blacklist.h b/src/blacklist.h
index f5c899e0..f606157c 100644
--- a/src/blacklist.h
+++ b/src/blacklist.h
@@ -27,12 +27,14 @@ enum blacklist_reason {
*/
BLACKLIST_REASON_CONNECT_FAILED,
/*
- * This type of blacklist is added when a BSS requests IWD roams
- * elsewhere. This is to aid in preventing IWD from roaming/connecting
- * back to that BSS in the future unless there are no other "good"
- * candidates to connect to.
+ * This type of blacklist is added when an AP indicates that its unable
+ * to handle more connections. This is done via BSS-TM requests or
+ * denied authentications/associations with certain status codes.
+ *
+ * Once this type of blacklist is applied to a BSS IWD will attempt to
+ * avoid roaming to it for a configured period of time.
*/
- BLACKLIST_REASON_ROAM_REQUESTED,
+ BLACKLIST_REASON_AP_BUSY,
};
void blacklist_add_bss(const uint8_t *addr, enum blacklist_reason reason);
diff --git a/src/station.c b/src/station.c
index d8016c2a..71f4db99 100644
--- a/src/station.c
+++ b/src/station.c
@@ -191,8 +191,7 @@ static uint32_t evaluate_bss_group_rank(const uint8_t *addr, uint32_t freq,
if (blacklist_contains_bss(addr, BLACKLIST_REASON_CONNECT_FAILED))
return 0;
- roam_blacklist = blacklist_contains_bss(addr,
- BLACKLIST_REASON_ROAM_REQUESTED);
+ roam_blacklist = blacklist_contains_bss(addr, BLACKLIST_REASON_AP_BUSY);
good_signal = signal >= netdev_get_low_signal_threshold(freq);
if (good_signal)
@@ -3326,7 +3325,7 @@ static void station_ap_directed_roam(struct station *station,
}
blacklist_add_bss(station->connected_bss->addr,
- BLACKLIST_REASON_ROAM_REQUESTED);
+ BLACKLIST_REASON_AP_BUSY);
station_debug_event(station, "ap-roam-blacklist-added");
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/4] docs: replace/deprecate InitialRoamRequestedTimeout
2025-05-19 16:36 [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY James Prestwood
@ 2025-05-19 16:36 ` James Prestwood
2025-05-19 16:36 ` [PATCH 3/4] station: utilize the AP_BUSY blacklist for denied auth/assoc James Prestwood
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: James Prestwood @ 2025-05-19 16:36 UTC (permalink / raw)
To: iwd; +Cc: James Prestwood
This is being replaced by InitialAccessPointBusyTimeout but will
still be supported until full removal.
---
src/iwd.config.rst | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/iwd.config.rst b/src/iwd.config.rst
index 9761e8fd..b54670de 100644
--- a/src/iwd.config.rst
+++ b/src/iwd.config.rst
@@ -292,12 +292,22 @@ control how long a misbehaved BSS spends on the blacklist.
The initial time that a BSS spends on the blacklist. Setting this to zero
will disable blacklisting functionality in IWD.
- * - InitialRoamRequestedTimeout
+ * - InitialRoamRequestedTimeout (**deprecated**)
- Values: uint64 value in seconds (default: **30**)
- The initial time that a BSS will be marked after a BSS requests a roam.
- This is to aid in avoiding roaming back to BSS's which are likely
- overloaded. Setting this to zero will disabled this form of blacklisting.
+ This setting is deprecated, please use
+ [Blacklist].InitialAccessPointBusyTimeout instead.
+ * - InitialAccessPointBusyTimeout
+ - Values: uint64 value in seconds (default: **30**)
+
+ The initial time that a BSS will be blacklisted after indicating it
+ cannot handle more connections. This is triggered by either a BSS
+ transition management request (telling IWD to roam elsewhere) or by a
+ denied authentication or association with the NO_MORE_STAS status code.
+
+ Once a BSS is blacklisted in this manor IWD will attempt to avoid it for
+ the configured amount of time.
+
* - Multiplier
- Values: unsigned int value greater than zero, in seconds
(default: **30**)
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/4] station: utilize the AP_BUSY blacklist for denied auth/assoc
2025-05-19 16:36 [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY James Prestwood
2025-05-19 16:36 ` [PATCH 2/4] docs: replace/deprecate InitialRoamRequestedTimeout James Prestwood
@ 2025-05-19 16:36 ` James Prestwood
2025-05-19 16:36 ` [PATCH 4/4] auto-t: use renamed InitialAccessPointBusyTimeout James Prestwood
2025-05-19 21:39 ` [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY Denis Kenzior
3 siblings, 0 replies; 5+ messages in thread
From: James Prestwood @ 2025-05-19 16:36 UTC (permalink / raw)
To: iwd; +Cc: James Prestwood
Specifically for the NO_MORE_STAS reason code, add the BSS to the
(now renamed) AP_BUSY blacklist to avoid roaming to this BSS for
the near future.
Since we are now handling individual reason codes differently the
whole IS_TEMPORARY_STATUS macro was removed and replaced with a
case statement.
---
src/station.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/src/station.c b/src/station.c
index 71f4db99..2b6a18f8 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3522,13 +3522,6 @@ static bool station_pmksa_fallback(struct station *station, uint16_t status)
return true;
}
-/* A bit more concise for trying to fit these into 80 characters */
-#define IS_TEMPORARY_STATUS(code) \
- ((code) == MMPDU_STATUS_CODE_DENIED_UNSUFFICIENT_BANDWIDTH || \
- (code) == MMPDU_STATUS_CODE_DENIED_POOR_CHAN_CONDITIONS || \
- (code) == MMPDU_STATUS_CODE_REJECTED_WITH_SUGG_BSS_TRANS || \
- (code) == MMPDU_STATUS_CODE_DENIED_NO_MORE_STAS)
-
static bool station_retry_with_status(struct station *station,
uint16_t status_code)
{
@@ -3536,19 +3529,37 @@ static bool station_retry_with_status(struct station *station,
if (station_pmksa_fallback(station, status_code))
goto try_next;
+ switch (status_code) {
/*
* Certain Auth/Assoc failures should not cause a timeout blacklist.
* In these cases we want to only temporarily blacklist the BSS until
* the connection is complete.
- *
+ */
+ case MMPDU_STATUS_CODE_DENIED_UNSUFFICIENT_BANDWIDTH:
+ case MMPDU_STATUS_CODE_DENIED_POOR_CHAN_CONDITIONS:
+ /*
* TODO: The WITH_SUGG_BSS_TRANS case should also include a neighbor
* report IE in the frame. This would allow us to target a
* specific BSS on our next attempt. There is currently no way to
* obtain that IE, but this should be done in the future.
+ */
+ case MMPDU_STATUS_CODE_REJECTED_WITH_SUGG_BSS_TRANS:
+ break;
+ /*
+ * If a BSS is indicating its unable to handle more connections we will
+ * blacklist this the same way we do for BSS's issuing BSS-TM requests
+ * thereby avoiding roams to this BSS for the configured timeout.
*/
- if (!IS_TEMPORARY_STATUS(status_code))
+ case MMPDU_STATUS_CODE_DENIED_NO_MORE_STAS:
+ blacklist_add_bss(station->connected_bss->addr,
+ BLACKLIST_REASON_AP_BUSY);
+ break;
+ /* For any other status codes, blacklist the BSS */
+ default:
blacklist_add_bss(station->connected_bss->addr,
BLACKLIST_REASON_CONNECT_FAILED);
+ break;
+ }
/*
* Unconditionally network blacklist the BSS if we are retrying. This
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 4/4] auto-t: use renamed InitialAccessPointBusyTimeout
2025-05-19 16:36 [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY James Prestwood
2025-05-19 16:36 ` [PATCH 2/4] docs: replace/deprecate InitialRoamRequestedTimeout James Prestwood
2025-05-19 16:36 ` [PATCH 3/4] station: utilize the AP_BUSY blacklist for denied auth/assoc James Prestwood
@ 2025-05-19 16:36 ` James Prestwood
2025-05-19 21:39 ` [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY Denis Kenzior
3 siblings, 0 replies; 5+ messages in thread
From: James Prestwood @ 2025-05-19 16:36 UTC (permalink / raw)
To: iwd; +Cc: James Prestwood
---
autotests/testAPRoam/main.conf.roaming | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/autotests/testAPRoam/main.conf.roaming b/autotests/testAPRoam/main.conf.roaming
index 1ff23571..49a74685 100644
--- a/autotests/testAPRoam/main.conf.roaming
+++ b/autotests/testAPRoam/main.conf.roaming
@@ -3,4 +3,4 @@ RoamThreshold=-72
CriticalRoamThreshold=-72
[Blacklist]
-InitialRoamRequestedTimeout=20
+InitialAccessPointBusyTimeout=20
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY
2025-05-19 16:36 [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY James Prestwood
` (2 preceding siblings ...)
2025-05-19 16:36 ` [PATCH 4/4] auto-t: use renamed InitialAccessPointBusyTimeout James Prestwood
@ 2025-05-19 21:39 ` Denis Kenzior
3 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2025-05-19 21:39 UTC (permalink / raw)
To: James Prestwood, iwd
Hi James,
On 5/19/25 11:36 AM, James Prestwood wrote:
> The initial pass of this feature only envisioned BSS transition
> management frames as the trigger to "roam blacklist" a BSS, hence
> the original name. But some APs actually utilize status codes that
> also indicate to the stations that they are busy, or not able to
> handle more connections. This directly aligns with the original
> motivation of the "roam blacklist" series and these events should
> also trigger this type of blacklist.
>
> First, since we will be applying this blacklist to cases other
> than being told to roam, rename this reason code internally to
> BLACKLIST_REASON_AP_BUSY. The config option is also being renamed
> to [Blacklist].InitialAccessPointBusyTimeout while also supporting
> the old config option, but warning that it is deprecated.
> ---
> src/blacklist.c | 20 ++++++++++++++------
> src/blacklist.h | 12 +++++++-----
> src/station.c | 5 ++---
> 3 files changed, 23 insertions(+), 14 deletions(-)
>
All applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-05-19 21:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 16:36 [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY James Prestwood
2025-05-19 16:36 ` [PATCH 2/4] docs: replace/deprecate InitialRoamRequestedTimeout James Prestwood
2025-05-19 16:36 ` [PATCH 3/4] station: utilize the AP_BUSY blacklist for denied auth/assoc James Prestwood
2025-05-19 16:36 ` [PATCH 4/4] auto-t: use renamed InitialAccessPointBusyTimeout James Prestwood
2025-05-19 21:39 ` [PATCH 1/4] blacklist: rename ROAM_REQUESTED to AP_BUSY Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox