From f9bd3b31c8152b037bf1dbc3409a017d57d4a2e6 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 5 Jun 2018 14:42:49 +0200 Subject: lib: Add a QOS_RAW QoS cube This adds a QoS cube that allows sending packets directly over a raw flow, without an FRCT state machine. Flow allocation with a NULL qosspec will now default to such raw flows. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/qoscube.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/lib/qoscube.c') diff --git a/src/lib/qoscube.c b/src/lib/qoscube.c index 8e6a8df9..00210625 100644 --- a/src/lib/qoscube.c +++ b/src/lib/qoscube.c @@ -24,10 +24,19 @@ #include +static struct qos_spec qos_raw = { + .delay = UINT32_MAX, + .bandwidth = UINT64_MAX, + .availability = 0, + .in_order = 0, + .maximum_interruption = UINT32_MAX +}; + static struct qos_spec qos_best_effort = { .delay = UINT32_MAX, .bandwidth = UINT64_MAX, .availability = 0, + .in_order = 1, .maximum_interruption = UINT32_MAX }; @@ -35,6 +44,7 @@ static struct qos_spec qos_video = { .delay = 100, .bandwidth = UINT64_MAX, .availability = 3, + .in_order = 1, .maximum_interruption = 100 }; @@ -42,6 +52,7 @@ static struct qos_spec qos_voice = { .delay = 10, .bandwidth = 100000, .availability = 5, + .in_order = 1, .maximum_interruption = 50 }; @@ -57,8 +68,10 @@ qoscube_t qos_spec_to_cube(qosspec_t qs) qs.availability >= qos_video.availability && qs.maximum_interruption <= qos_video.maximum_interruption) return QOS_CUBE_VIDEO; - else + else if (qs.in_order == 1) return QOS_CUBE_BE; + else + return QOS_CUBE_RAW; } qosspec_t qos_cube_to_spec(qoscube_t qc) @@ -69,7 +82,8 @@ qosspec_t qos_cube_to_spec(qoscube_t qc) case QOS_CUBE_VIDEO: return qos_video; case QOS_CUBE_BE: - default: return qos_best_effort; + default: + return qos_raw; } } -- cgit v1.2.3