From cbf7e0883a6f0376f5fee83c458e91ed3d900225 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 20 Mar 2019 09:08:32 +0100 Subject: [PATCH] Fix timer logic --- src/algo_rr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/algo_rr.c b/src/algo_rr.c index 058661a..1994790 100644 --- a/src/algo_rr.c +++ b/src/algo_rr.c @@ -377,9 +377,10 @@ int rr_on_timer(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { printf("Timer reached for packet %d\n", pkt->id); //rr->remote_links &= 0xffff ^ 1 << pkt->link_num; - rr->recv_id = pkt->id; - - rr_pkt_unroll (ctx, app_ctx); + while (ring_lt(rr->recv_id, pkt->id)) { + rr->recv_id++; + rr_pkt_unroll (ctx, app_ctx); + } return 1; }