[sr-dev] git:master:1880f1f8: pipelimit: remove mutiplying the limit with timer interval for TAILDROP alg

Daniel-Constantin Mierla miconda at gmail.com
Sat Jan 13 19:29:30 CET 2018


Module: kamailio
Branch: master
Commit: 1880f1f8be4b51cec2a0567580828e9ac449947d
URL: https://github.com/kamailio/kamailio/commit/1880f1f8be4b51cec2a0567580828e9ac449947d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-01-13T19:29:00+01:00

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

---

Modified: src/modules/pipelimit/pipelimit.c

---

Diff:  https://github.com/kamailio/kamailio/commit/1880f1f8be4b51cec2a0567580828e9ac449947d.diff
Patch: https://github.com/kamailio/kamailio/commit/1880f1f8be4b51cec2a0567580828e9ac449947d.patch

---

diff --git a/src/modules/pipelimit/pipelimit.c b/src/modules/pipelimit/pipelimit.c
index 9025623435..a15e2ca696 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
+}




More information about the sr-dev mailing list