From 22526848c5a7b48f8b45988bdfbc6e0ce7a9f712 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 6 Mar 2022 15:15:50 +0100 Subject: lib: Pass Delta-t params to frcti_create() The parameters were set directly from the build configs. A first step to making FRCP configurable at runtime, is to pass the parameters to the frcti_create() function. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/dev.c | 4 ++-- src/lib/frct.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/dev.c b/src/lib/dev.c index c5667f06..2e61df52 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -642,7 +642,7 @@ int flow_accept(qosspec_t * qs, assert(ai.flows[fd].frcti == NULL); if (ai.flows[fd].qs.in_order != 0) { - ai.flows[fd].frcti = frcti_create(fd); + ai.flows[fd].frcti = frcti_create(fd, DELT_A, DELT_R, DELT_MPL); if (ai.flows[fd].frcti == NULL) { pthread_rwlock_unlock(&ai.lock); flow_dealloc(fd); @@ -757,7 +757,7 @@ static int __flow_alloc(const char * dst, assert(ai.flows[fd].frcti == NULL); if (ai.flows[fd].qs.in_order != 0) { - ai.flows[fd].frcti = frcti_create(fd); + ai.flows[fd].frcti = frcti_create(fd, DELT_A, DELT_R, DELT_MPL); if (ai.flows[fd].frcti == NULL) { pthread_rwlock_unlock(&ai.lock); flow_dealloc(fd); diff --git a/src/lib/frct.c b/src/lib/frct.c index 15eb3b96..e9ee7718 100644 --- a/src/lib/frct.c +++ b/src/lib/frct.c @@ -298,14 +298,14 @@ static void __send_rdv(int fd) __send_frct_pkt(fd, FRCT_RDVS, 0, 0); } -static struct frcti * frcti_create(int fd) +static struct frcti * frcti_create(int fd, + time_t a, + time_t r, + time_t mpl) { struct frcti * frcti; ssize_t idx; struct timespec now; - time_t mpl; - time_t a; - time_t r; pthread_condattr_t cattr; #ifdef PROC_FLOW_STATS char frctstr[FRCT_NAME_STRLEN + 1]; @@ -342,9 +342,9 @@ static struct frcti * frcti_create(int fd) clock_gettime(PTHREAD_COND_CLOCK, &now); - frcti->mpl = mpl = DELT_MPL; - frcti->a = a = DELT_A; - frcti->r = r = DELT_R; + frcti->mpl = mpl; + frcti->a = a; + frcti->r = r; frcti->rdv = DELT_RDV; frcti->fd = fd; -- cgit v1.2.3