From 1880f1f8be4b51cec2a0567580828e9ac449947d Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Sat, 13 Jan 2018 18:49:15 +0100 Subject: [PATCH] pipelimit: remove mutiplying the limit with timer interval for TAILDROP alg - the limit is documented as per interval, not per second (closes GH #1390) - renamed macro for default limit to use module specific prefix --- src/modules/pipelimit/pipelimit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/pipelimit/pipelimit.c b/src/modules/pipelimit/pipelimit.c index 90256234351..a15e2ca6968 100644 --- a/src/modules/pipelimit/pipelimit.c +++ b/src/modules/pipelimit/pipelimit.c @@ -64,7 +64,7 @@ MODULE_VERSION /* * timer interval length in seconds, tunable via modparam */ -#define RL_TIMER_INTERVAL 10 +#define PL_TIMER_INTERVAL 10 /** SL API structure */ sl_api_t slb; @@ -107,7 +107,7 @@ static int load_source_mp = LOAD_SOURCE_CPU; static int * load_source; /* these only change in the mod_init() process -- no locking needed */ -static int timer_interval = RL_TIMER_INTERVAL; +static int timer_interval = PL_TIMER_INTERVAL; int _pl_cfg_setpoint; /* desired load, used when reading modparams */ /* === */ @@ -565,7 +565,7 @@ static int pipe_push_direct(pl_pipe_t *pipe) ret = 2; break; case PIPE_ALGO_TAILDROP: - ret = (pipe->counter <= pipe->limit * timer_interval) ? 1 : -1; + ret = (pipe->counter <= pipe->limit) ? 1 : -1; break; case PIPE_ALGO_RED: if (pipe->load == 0) @@ -869,4 +869,4 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2) { sr_kemi_modules_add(sr_kemi_pipelimit_exports); return 0; -} \ No newline at end of file +}