policy: make steering ability evaluation uniform
authorDavid Bauer <mail@david-bauer.net>
Wed, 17 Aug 2022 20:18:55 +0000 (22:18 +0200)
committerDavid Bauer <mail@david-bauer.net>
Wed, 17 Aug 2022 21:00:42 +0000 (23:00 +0200)
Usteer imposes minimum intervals for steering actions in order to avoid
creating endless roam-kick loops due to the decentral aspect of usteer.

Make these basic limits to roamsteering usable across band-steering and
signal-based roam-steering.

Signed-off-by: David Bauer <mail@david-bauer.net>
band_steering.c
policy.c
usteer.h

index fb4a3f1220bc32fa25735fc4d3fe042c70d16d70..7fce1dfb031270fc7ab30673057c774fd39f9f0f 100644 (file)
@@ -81,7 +81,8 @@ void usteer_band_steering_perform_steer(struct usteer_local_node *ln)
        ln->band_steering_interval = 0;
 
        list_for_each_entry(si, &ln->node.sta_info, node_list) {
-               if (si->connected != STA_CONNECTED)
+               /* Check if client is eligable to be steerd */
+               if (!usteer_policy_can_perform_roam(si))
                        continue;
 
                /* Skip clients with insufficient SNR-state */
index 90a12a0ac539e00cada8c864e0d9f929c6989b49..bb10be58963be2e16eb321f2e815f9a2a022ba3c 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -378,17 +378,12 @@ usteer_roam_trigger_sm(struct usteer_local_node *ln, struct sta_info *si)
        return false;
 }
 
-static bool
-usteer_local_node_roam_sm_active(struct sta_info *si, int min_signal)
+bool usteer_policy_can_perform_roam(struct sta_info *si)
 {
        /* Only trigger for connected STAs */
        if (si->connected != STA_CONNECTED)
                return false;
 
-       /* Signal has to be below scan / roam threshold */
-       if (si->signal >= min_signal)
-               return false;
-
        /* Skip on pending kick */
        if (si->kick_time)
                return false;
@@ -408,6 +403,19 @@ usteer_local_node_roam_sm_active(struct sta_info *si, int min_signal)
        return true;
 }
 
+static bool
+usteer_local_node_roam_sm_active(struct sta_info *si, int min_signal)
+{
+       if (!usteer_policy_can_perform_roam(si))
+               return false;
+
+       /* Signal has to be below scan / roam threshold */
+       if (si->signal >= min_signal)
+               return false;
+
+       return true;
+}
+
 static void
 usteer_local_node_roam_check(struct usteer_local_node *ln, struct uevent *ev)
 {
index 4f5aa1b294439fb0357b21400cf8e6d973911a18..f692fb8665cd160f3d4315dd862db5ee8caec018 100644 (file)
--- a/usteer.h
+++ b/usteer.h
@@ -327,6 +327,7 @@ void usteer_local_node_kick(struct usteer_local_node *ln);
 int usteer_local_node_get_beacon_interval(struct usteer_local_node *ln);
 
 bool usteer_policy_node_below_max_assoc(struct usteer_node *node);
+bool usteer_policy_can_perform_roam(struct sta_info *si);
 
 void usteer_band_steering_perform_steer(struct usteer_local_node *ln);
 void usteer_band_steering_sta_update(struct sta_info *si);