From b74980761cdcd9a706760ae9a4efb3806ca9bee2 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 7 Jun 2018 23:35:14 +0200 Subject: lib: Add a data qos cube This adds a data qos cube that is reliable. Reliable qos can be selected by setting the loss parameter of the qosspec to 0. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/frct.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/lib/frct.c') diff --git a/src/lib/frct.c b/src/lib/frct.c index bcb031c3..00261272 100644 --- a/src/lib/frct.c +++ b/src/lib/frct.c @@ -105,7 +105,8 @@ static void frct_fini(void) timerwheel_destroy(frct.tw); } -static struct frcti * frcti_create(int fd) +static struct frcti * frcti_create(int fd, + qoscube_t qc) { struct frcti * frcti; time_t delta_t; @@ -133,6 +134,9 @@ static struct frcti * frcti_create(int fd) delta_t = (frcti->mpl + frcti->a + frcti->r) / 1000; + if (qc == QOS_CUBE_DATA) + frcti->snd_cr.cflags |= FRCTFRTX; + frcti->snd_cr.conf = true; frcti->snd_cr.inact = 3 * delta_t + 1; frcti->snd_cr.act = now.tv_sec - (frcti->snd_cr.inact + 1); @@ -317,6 +321,9 @@ static int __frcti_snd(struct frcti * frcti, pci->seqno = hton32(snd_cr->seqno++); if (!(snd_cr->cflags & FRCTFRTX)) snd_cr->lwe++; + else + /* TODO: update on ACK */ + snd_cr->lwe++; snd_cr->act = now.tv_sec; snd_cr->conf = false; -- cgit v1.2.3