Skip to content
Snippets Groups Projects
Commit d5fc75dd authored by Filip Matusiak's avatar Filip Matusiak
Browse files

Set new default steer thresholds

parent 6df0da85
No related branches found
No related tags found
1 merge request!180Set new default steer thresholds
Pipeline #80773 passed
......@@ -30,6 +30,19 @@ config sta_steering
# if 1 then steering from 5g/6g to 2.4g is alowed
option diffsnr '8'
# minimal RSSI diff (dest RSSI - src RSSI) for the BTM to kick in (default 8dB)
option rcpi_threshold_2g '70'
# global default rcpi threshold to trigger steering on 2GHZ band
option rcpi_threshold_5g '86'
# global default rcpi threshold to trigger steering on 5GHZ band
option rcpi_threshold_6g '86'
# global default rcpi threshold to trigger steering on 6GHZ band
option report_rcpi_threshold_2g '80'
# global default rcpi threshold to start reporing on 2GHZ band
option report_rcpi_threshold_5g '96'
# global default rcpi threshold to start reporing on 5GHZ band
option report_rcpi_threshold_6g '96'
# global default rcpi threshold to start reporing on 6GHZ band
...
```
......@@ -49,6 +62,7 @@ config radio 'radio_44d4376af4cf'            
```
This will be synchronized to mapagents in the mesh – radio sections in /etc/config/mapagent for each agent will be updated accordingly.
Please note, that the rcpi_threshold & report_rcpi_threshold - if set - will override the global values set earlier in sta_steering section.
**/etc/config/mapagent**
......
......
......@@ -585,7 +585,7 @@ static void cntlr_configure_steer(struct controller *c, struct sta *s,
/* RCPI threshold */
if (rp->rcpi_threshold > 0)
scfg.rcpi_threshold = rp->rcpi_threshold;
scfg.rcpi_threshold = rp->rcpi_threshold; /* band dependent */
else {
switch (rp->band) {
case BAND_5:
......@@ -711,6 +711,7 @@ static void cntlr_bcn_metrics_parse(atimer_t *t)
return;
if (scc->enable_sta_steer) {
/* configure individually for each STA */
cntlr_configure_steer(c, s, scc);
cntlr_try_steer_sta(c, s);
}
......
......
......@@ -785,6 +785,12 @@ static int cntlr_config_get_steer_params(struct controller_config *cc,
STEER_USTA_METRICS,
STEER_BANDSTEER,
STEER_DIFFSNR,
STEER_RCPI_TH_2G,
STEER_RCPI_TH_5G,
STEER_RCPI_TH_6G,
STEER_RPT_RCPI_TH_2G,
STEER_RPT_RCPI_TH_5G,
STEER_RPT_RCPI_TH_6G,
NUM_STEER_ATTRS
};
const struct uci_parse_option opts[] = {
......@@ -796,6 +802,12 @@ static int cntlr_config_get_steer_params(struct controller_config *cc,
[STEER_USTA_METRICS] = { .name = "use_usta_metrics", .type = UCI_TYPE_STRING },
[STEER_BANDSTEER] = { .name = "bandsteer", .type = UCI_TYPE_STRING },
[STEER_DIFFSNR] = { .name = "diffsnr", .type = UCI_TYPE_STRING },
[STEER_RCPI_TH_2G] = { .name = "rcpi_threshold_2g", .type = UCI_TYPE_STRING },
[STEER_RCPI_TH_5G] = { .name = "rcpi_threshold_5g", .type = UCI_TYPE_STRING },
[STEER_RCPI_TH_6G] = { .name = "rcpi_threshold_6g", .type = UCI_TYPE_STRING },
[STEER_RPT_RCPI_TH_2G] = { .name = "report_rcpi_threshold_2g", .type = UCI_TYPE_STRING },
[STEER_RPT_RCPI_TH_5G] = { .name = "report_rcpi_threshold_5g", .type = UCI_TYPE_STRING },
[STEER_RPT_RCPI_TH_6G] = { .name = "report_rcpi_threshold_6g", .type = UCI_TYPE_STRING },
};
struct uci_option *tb[NUM_STEER_ATTRS];
struct steer_control_config *sc;
......@@ -875,6 +887,67 @@ static int cntlr_config_get_steer_params(struct controller_config *cc,
sc->diffsnr = diffsnr;
}
sc->rcpi_threshold_2g = CONFIG_DEFAULT_RCPI_TH_2G;
sc->rcpi_threshold_5g = CONFIG_DEFAULT_RCPI_TH_5G;
sc->rcpi_threshold_6g = CONFIG_DEFAULT_RCPI_TH_6G;
sc->report_rcpi_threshold_2g = CONFIG_DEFAULT_RCPI_TH_2G + 10;
sc->report_rcpi_threshold_5g = CONFIG_DEFAULT_RCPI_TH_5G + 10;
sc->report_rcpi_threshold_6g = CONFIG_DEFAULT_RCPI_TH_6G + 10;
if (tb[STEER_RCPI_TH_2G]) {
const char *val = tb[STEER_RCPI_TH_2G]->v.string;
int rcpi;
rcpi = atoi(val);
if (rcpi > 0 && rcpi <= 220)
sc->rcpi_threshold_2g = rcpi;
}
if (tb[STEER_RCPI_TH_5G]) {
const char *val = tb[STEER_RCPI_TH_5G]->v.string;
int rcpi;
rcpi = atoi(val);
if (rcpi > 0 && rcpi <= 220)
sc->rcpi_threshold_5g = rcpi;
}
if (tb[STEER_RCPI_TH_6G]) {
const char *val = tb[STEER_RCPI_TH_6G]->v.string;
int rcpi;
rcpi = atoi(val);
if (rcpi > 0 && rcpi <= 220)
sc->rcpi_threshold_6g = rcpi;
}
if (tb[STEER_RPT_RCPI_TH_2G]) {
const char *val = tb[STEER_RPT_RCPI_TH_2G]->v.string;
int rcpi;
rcpi = atoi(val);
if (rcpi > 0 && rcpi <= 220)
sc->report_rcpi_threshold_2g = rcpi;
}
if (tb[STEER_RPT_RCPI_TH_5G]) {
const char *val = tb[STEER_RPT_RCPI_TH_5G]->v.string;
int rcpi;
rcpi = atoi(val);
if (rcpi > 0 && rcpi <= 220)
sc->report_rcpi_threshold_5g = rcpi;
}
if (tb[STEER_RPT_RCPI_TH_6G]) {
const char *val = tb[STEER_RPT_RCPI_TH_6G]->v.string;
int rcpi;
rcpi = atoi(val);
if (rcpi > 0 && rcpi <= 220)
sc->report_rcpi_threshold_6g = rcpi;
}
return 0;
}
......@@ -1255,7 +1328,7 @@ static int cntlr_config_get_agent_node(struct controller_config *c,
return 0;
}
static int cntlr_config_get_agent_radio(struct controller_config *c,
static int cntlr_config_get_agent_radio(struct controller_config *cc,
struct uci_section *s)
{
enum {
......@@ -1297,29 +1370,60 @@ static int cntlr_config_get_agent_radio(struct controller_config *c,
uci_parse_section(s, opts, NUM_POLICIES, tb);
if (tb[RADIO_AGENT] && tb[RADIO_MAC] && tb[RADIO_BAND]) {
struct controller *c = container_of(cc, struct controller, cfg);
struct steer_control_config *scc;
a = calloc(1, sizeof(*a));
if (!a)
return -1;
hwaddr_aton(tb[RADIO_AGENT]->v.string, a->agent_id);
hwaddr_aton(tb[RADIO_MAC]->v.string, a->macaddr);
if (atoi(tb[RADIO_BAND]->v.string) == 5) {
if (atoi(tb[RADIO_BAND]->v.string) == 5)
a->band = BAND_5;
a->rcpi_threshold = CONFIG_DEFAULT_RCPI_TH_5G;
} else if (atoi(tb[RADIO_BAND]->v.string) == 2) {
else if (atoi(tb[RADIO_BAND]->v.string) == 2)
a->band = BAND_2;
a->rcpi_threshold = CONFIG_DEFAULT_RCPI_TH_2G;
} else if (atoi(tb[RADIO_BAND]->v.string) == 6) {
else if (atoi(tb[RADIO_BAND]->v.string) == 6)
a->band = BAND_6;
else
a->band = BAND_UNKNOWN;
if (c)
scc = get_steer_control_config(c);
switch (a->band) {
case BAND_5:
if (scc) {
a->rcpi_threshold = scc->rcpi_threshold_5g;
a->report_rcpi_threshold = scc->report_rcpi_threshold_5g;
} else
a->rcpi_threshold = CONFIG_DEFAULT_RCPI_TH_5G;
break;
case BAND_6:
if (scc) {
a->rcpi_threshold = scc->rcpi_threshold_6g;
a->report_rcpi_threshold = scc->report_rcpi_threshold_6g;
} else
a->rcpi_threshold = CONFIG_DEFAULT_RCPI_TH_6G;
break;
case BAND_2:
case BAND_UNKNOWN:
default:
if (scc) {
a->rcpi_threshold = scc->rcpi_threshold_2g;
a->report_rcpi_threshold = scc->report_rcpi_threshold_2g;
} else
a->band = BAND_UNKNOWN;
a->rcpi_threshold = CONFIG_DEFAULT_RCPI_TH_2G;
break;
}
if (!scc)
a->report_rcpi_threshold = a->rcpi_threshold + 10;
a->include_sta_stats = true;
a->include_sta_metric = true;
list_add(&a->list, &c->radiolist);
list_add(&a->list, &cc->radiolist);
} else {
warn("|%s:%d| invalid radio config! Must hold agent_id, macaddr and band", __func__, __LINE__);
return -1;
......@@ -1332,11 +1436,13 @@ static int cntlr_config_get_agent_radio(struct controller_config *c,
a->util_threshold = atoi(tb[RADIO_UTIL_TH]->v.string);
if (tb[RADIO_RCPI_TH]) {
/* override default value from steer section in config */
a->rcpi_threshold = atoi(tb[RADIO_RCPI_TH]->v.string);
a->report_rcpi_threshold = a->rcpi_threshold + 10;
}
if (tb[RADIO_RPT_RCPI_TH]) {
/* override default value from steer section in config */
a->report_rcpi_threshold =
atoi(tb[RADIO_RPT_RCPI_TH]->v.string);
}
......
......
......@@ -130,6 +130,12 @@ struct steer_control_config {
bool use_usta_metrics;
bool bandsteer;
unsigned int diffsnr;
uint8_t rcpi_threshold_2g; /* 0 - 220 */
uint8_t rcpi_threshold_5g; /* 0 - 220 */
uint8_t rcpi_threshold_6g; /* 0 - 220 */
uint8_t report_rcpi_threshold_2g; /* 0, or 1 - 220 */
uint8_t report_rcpi_threshold_5g; /* 0, or 1 - 220 */
uint8_t report_rcpi_threshold_6g; /* 0, or 1 - 220 */
struct list_head list;
};
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment