Skip to content

Commit

Permalink
pipelimit: remove mutiplying the limit with timer interval for TAILDR…
Browse files Browse the repository at this point in the history
…OP alg

- the limit is documented as per interval, not per second (closes GH #1390)
- renamed macro for default limit to use module specific prefix
  • Loading branch information
miconda committed Jan 13, 2018
1 parent 5e7330c commit 1880f1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/pipelimit/pipelimit.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
/* === */

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 1880f1f

Please sign in to comment.