Skip to content
Snippets Groups Projects
Commit 14cdc795 authored by Maxim Menshikov's avatar Maxim Menshikov Committed by Jakob Olsson
Browse files

qos: remove rules before adding them to ensure they are up to date

parent d3232220
No related branches found
No related tags found
1 merge request!323Merge QoS changes from devel to 7.3
Pipeline #147319 passed
......@@ -66,6 +66,7 @@
/* Send Service Prioritization Request to specific hardware address */
static int cntlr_qos_send_sp_req(struct controller *c,
bool add,
uint8_t *origin,
struct qos_rule *rule)
{
......@@ -94,7 +95,7 @@ static int cntlr_qos_send_sp_req(struct controller *c,
ret = cntlr_gen_spr_tlv(c,
buf,
rule->rule_num,
true,
add,
255 - rule->rule_num,
rule->output,
rule->always_match);
......@@ -104,107 +105,110 @@ static int cntlr_qos_send_sp_req(struct controller *c,
return -1;
}
switch (rule->type)
{
case QOS_RULE_TYPE_DSCP_PCP:
if (add) {
switch (rule->type)
{
case QOS_RULE_TYPE_DSCP_PCP:
{
/*
* If triggered, a Multi-AP Controller shall send a
* Service Prioritization Request message with a DSCP Mapping
* Table TLV (see section 17.2.71).
*/
ret = cntlr_gen_dscp_mapping_table_tlv(c, buf,
rule->dscp_pcp.dscp_pcp);
break;
}
/*
* If triggered, a Multi-AP Controller shall send a
* Service Prioritization Request message with a DSCP Mapping Table
* TLV (see section 17.2.71).
* If triggered, a Multi-AP Controller shall send a Service
* Prioritization Request message with a QoS Management Descriptor
* TLV (see section 17.2.93).
*/
ret = cntlr_gen_dscp_mapping_table_tlv(c, buf,
rule->dscp_pcp.dscp_pcp);
break;
}
/*
* If triggered, a Multi-AP Controller shall send a Service
* Prioritization Request message with a QoS Management Descriptor TLV
* (see section 17.2.93).
*/
/*
* If the Descriptor Element field within a QoS Management Descriptor
* TLV is an MSCS or SCS Descriptor element, the validity lifetime of
* the QMID is either until the Controller receives a Profile-2 Error
* Code TLV indicating the Multi-AP Agent is unable to configure the
* Descriptor or (if the Descriptor is accepted) until the Multi-AP
* Controller sends a QoS Mangagment Descriptor TLV removing the
* Descriptor.
*/
case QOS_RULE_TYPE_MSCS:
case QOS_RULE_TYPE_SCS:
case QOS_RULE_TYPE_MGMT:
{
uint8_t *desc = NULL;
uint32_t desc_len = 0;
switch (rule->type)
/*
* If the Descriptor Element field within a QoS Management
* Descriptor TLV is an MSCS or SCS Descriptor element, the validity
* lifetime of the QMID is either until the Controller receives a
* Profile-2 Error Code TLV indicating the Multi-AP Agent is unable
* to configure the Descriptor or (if the Descriptor is accepted)
* until the Multi-AP Controller sends a QoS Management Descriptor
* TLV removing the Descriptor.
*/
case QOS_RULE_TYPE_MSCS:
case QOS_RULE_TYPE_SCS:
case QOS_RULE_TYPE_MGMT:
{
case QOS_RULE_TYPE_SCS:
{
desc = cntlr_gen_qos_scs_desc(c,
SCS_DESC_REQ_TYPE_ADD,
&rule->mgmt.scs,
&desc_len);
break;
}
case QOS_RULE_TYPE_MSCS:
{
desc = cntlr_gen_qos_mscs_desc(c,
SCS_DESC_REQ_TYPE_ADD,
&rule->mgmt.mscs,
&desc_len);
break;
}
case QOS_RULE_TYPE_MGMT:
uint8_t *desc = NULL;
uint32_t desc_len = 0;
switch (rule->type)
{
desc = cntlr_gen_qos_mgmt_elem_desc(c,
0 /* not defined yet */,
&rule->mgmt.qm,
&desc_len);
break;
case QOS_RULE_TYPE_SCS:
{
desc = cntlr_gen_qos_scs_desc(c,
SCS_DESC_REQ_TYPE_ADD,
&rule->mgmt.scs,
&desc_len);
break;
}
case QOS_RULE_TYPE_MSCS:
{
desc = cntlr_gen_qos_mscs_desc(c,
SCS_DESC_REQ_TYPE_ADD,
&rule->mgmt.mscs,
&desc_len);
break;
}
case QOS_RULE_TYPE_MGMT:
{
desc = cntlr_gen_qos_mgmt_elem_desc(c,
0 /* not defined yet */,
&rule->mgmt.qm,
&desc_len);
break;
}
default:
{
break;
}
}
default:
{
if (desc == NULL) {
ret = -1;
break;
}
}
if (desc == NULL) {
/*
* If the Descriptor Element field within a QoS Management
* Descriptor TLV is a QoS Management element containing a DSCP
* Policy attibute, the QMID is used in a Profile-2 Error Code
* TLV to indicate the Multi-AP Agent is unable to configure the
* rule.
*
* If the Descriptor Element field within a QoS Management
* Descriptor TLV is a QoS Management element containing a DSCP
* Policy attribute, the Policy ID in the Descriptor Element
* field is chosen by the Multi-AP Controller, and (per [25])
* has scope across the ESS (i.e., policy survives a roam after,
* after STA roams to another BSSID).
*
* If triggered, a Multi-AP Controller may modify or remove a
* DSCP Policy by sending an updated QoS Mangement element
* containing a DSCP Policy attribute with the same Policy ID
* within a QoS Management Descriptor TLV in a Service
* Prioritization Request message to a Multi-AP Agent.
*/
ret = cntlr_gen_qos_management_desc_tlv(c, buf,
rule->mgmt.qmid, rule->mgmt.bssid, rule->mgmt.sta,
desc, desc_len);
free(desc);
break;
}
default:
{
ret = -1;
break;
}
/*
* If the Descriptor Element field within a QoS Management
* Descriptor TLV is a QoS Management element containing a DSCP
* Policy attibute, the QMID is used in a Profile-2 Error Code TLV
* to indicate the Multi-AP Agent is unable to configure the rule.
*
* If the Descriptor Element field within a QoS Management
* Descriptor TLV is a QoS Management element containing a DSCP
* Policy attribute, the Policy ID in the Descriptor Element field
* is chosen by the Multi-AP Controller, and (per [25]) has scope
* across the ESS (i.e., policy survives a roam after, after STA
* roams to another BSSID).
*
* If triggered, a Multi-AP Controller may modify or remove a DSCP
* Policy by sending an updated QoS Mangement element containing a
* DSCP Policy attribute with the same Policy ID within a QoS
* Management Descriptor TLV in a Service Prioritization Request
* message to a Multi-AP Agent.
*/
ret = cntlr_gen_qos_management_desc_tlv(c, buf,
rule->mgmt.qmid, rule->mgmt.bssid, rule->mgmt.sta,
desc, desc_len);
free(desc);
break;
}
default:
{
ret = -1;
break;
}
}
......@@ -233,7 +237,8 @@ void cntlr_qos_sync_node(struct controller *c,
*/
list_for_each_entry(rule, &cc->qos.rule, list) {
dbg("%s: syncing QoS in node, sending SPR\n", __func__);
cntlr_qos_send_sp_req(c, origin, rule);
cntlr_qos_send_sp_req(c, false, origin, rule);
cntlr_qos_send_sp_req(c, true, origin, rule);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment