#ifndef __BPF_QOSIFY_H
#define __BPF_QOSIFY_H
+#define QOSIFY_MAX_CLASS_ENTRIES 16
+#define QOSIFY_DEFAULT_CLASS_ENTRIES 2
+
#ifndef QOSIFY_FLOW_BUCKET_SHIFT
#define QOSIFY_FLOW_BUCKET_SHIFT 13
#endif
#define QOSIFY_INGRESS (1 << 0)
#define QOSIFY_IP_ONLY (1 << 1)
+#define QOSIFY_DSCP_VALUE_MASK ((1 << 6) - 1)
#define QOSIFY_DSCP_FALLBACK_FLAG (1 << 6)
+#define QOSIFY_DSCP_CLASS_FLAG (1 << 7)
-#define QOSIFY_VAL_FLAG_PRIO_CHECK (1 << 0)
-#define QOSIFY_VAL_FLAG_BULK_CHECK (1 << 1)
+#define QOSIFY_CLASS_FLAG_PRESENT (1 << 0)
struct qosify_dscp_val {
uint8_t ingress;
uint8_t egress;
- uint8_t flags;
-} __attribute__((packed));
+};
/* global config data */
struct qosify_flow_config {
- struct qosify_dscp_val dscp_prio;
- struct qosify_dscp_val dscp_bulk;
+ uint8_t dscp_prio;
+ uint8_t dscp_bulk;
uint8_t bulk_trigger_timeout;
uint16_t bulk_trigger_pps;
};
struct qosify_config {
- struct qosify_dscp_val dscp_icmp;
-
- struct qosify_flow_config flow;
+ uint8_t dscp_icmp;
};
struct qosify_ip_map_val {
- struct qosify_dscp_val dscp; /* must be first */
+ uint8_t dscp; /* must be first */
uint8_t seen;
};
+struct qosify_class {
+ struct qosify_flow_config config;
+
+ struct qosify_dscp_val val;
+
+ uint8_t flags;
+};
+
#endif