int fd;
int i;
- if (id == CL_MAP_TCP_PORTS)
- key = QOSIFY_MAX_CLASS_ENTRIES;
- else if (id == CL_MAP_UDP_PORTS)
- key = QOSIFY_MAX_CLASS_ENTRIES + 1;
- else
- return;
+ if (!(val & QOSIFY_DSCP_CLASS_FLAG)) {
+ if (id == CL_MAP_TCP_PORTS)
+ key = QOSIFY_MAX_CLASS_ENTRIES;
+ else if (id == CL_MAP_UDP_PORTS)
+ key = QOSIFY_MAX_CLASS_ENTRIES + 1;
+ else
+ return;
- fd = qosify_map_fds[CL_MAP_CLASS];
- if (val & QOSIFY_DSCP_CLASS_FLAG) {
- uint8_t fallback = val & QOSIFY_DSCP_FALLBACK_FLAG;
+ fd = qosify_map_fds[CL_MAP_CLASS];
- val &= QOSIFY_DSCP_VALUE_MASK;
- if (val > ARRAY_SIZE(map_class) || !map_class[val])
- return;
+ memcpy(&class.config, &flow_config, sizeof(class.config));
+ bpf_map_update_elem(fd, &key, &class, BPF_ANY);
- class.val.ingress = map_class[val]->data.val.ingress | fallback;
- class.val.egress = map_class[val]->data.val.egress | fallback;
+ val = key | QOSIFY_DSCP_CLASS_FLAG;
}
- memcpy(&class.config, &flow_config, sizeof(class.config));
- bpf_map_update_elem(fd, &key, &class, BPF_ANY);
-
- val = key | QOSIFY_DSCP_CLASS_FLAG;
fd = qosify_map_fds[id];
for (i = 0; i < (1 << 16); i++) {
data.addr.port = htons(i);