summaryrefslogtreecommitdiffstats
path: root/VNFs
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2017-06-02 12:25:53 +0530
committerDeepak S <deepak.s@linux.intel.com>2017-06-06 08:40:59 +0000
commit44e700fcfe8655565076b9c3036c61b2e53a8bcd (patch)
treed32a890a6e603abb21fa32bdadc41633d2165dbc /VNFs
parenta2e88f8fd9fe164bdbac4e817c164bc84a68f8c9 (diff)
Adding timer dyn timeout config in timer profile.
This patch enabled dynamic tune of timer timeout [PIPELINE2] type = TIMER core = 2 timer_dyn_timeout = 20 #-- new config to change dyn timer timeout n_flows = 1048576 Change-Id: I614cf73a7fc1afd9050580286c9a968aacb619fa Signed-off-by: Deepak S <deepak.s@linux.intel.com>
Diffstat (limited to 'VNFs')
-rw-r--r--VNFs/vCGNAPT/pipeline/pipeline_timer_be.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/VNFs/vCGNAPT/pipeline/pipeline_timer_be.c b/VNFs/vCGNAPT/pipeline/pipeline_timer_be.c
index ed1c5875..bfe8f5c4 100644
--- a/VNFs/vCGNAPT/pipeline/pipeline_timer_be.c
+++ b/VNFs/vCGNAPT/pipeline/pipeline_timer_be.c
@@ -59,6 +59,7 @@ struct rte_mempool *timer_mempool;
struct rte_mempool *timer_key_mempool;
static int timer_objs_mempool_count;
static int timer_ring_alloc_cnt;
+static uint32_t timer_dyn_timeout = 30;
uint64_t cgnapt_timeout;
uint32_t timer_lcore;
@@ -312,6 +313,7 @@ pipeline_cgnapt_parse_args(struct pipeline_timer *p,
{
uint32_t dequeue_loop_cnt_present = 0;
uint32_t n_flows_present = 0;
+ uint32_t timer_dyn_timeout_present = 0;
struct pipeline_timer *p_timer = (struct pipeline_timer *)p;
uint32_t i;
@@ -340,6 +342,16 @@ pipeline_cgnapt_parse_args(struct pipeline_timer *p,
continue;
}
+ if (strcmp(arg_name, "timer_dyn_timeout") == 0) {
+ if (timer_dyn_timeout_present)
+ return -1;
+ timer_dyn_timeout_present = 1;
+
+ timer_dyn_timeout = atoi(arg_value);
+ printf("cgnapt dyn timeout: %d\n", timer_dyn_timeout);
+ continue;
+ }
+
if (strcmp(arg_name, "n_flows") == 0) {
if(n_flows_present)
return -1;
@@ -403,14 +415,15 @@ static void *pipeline_timer_init(struct pipeline_params *params, void *arg)
return NULL;
p_timer->dequeue_loop_cnt = 100;
- cgnapt_timeout = rte_get_tsc_hz() * CGNAPT_DYN_TIMEOUT;
- printf("cgnapt_timerout%" PRIu64 "", cgnapt_timeout);
timer_lcore = rte_lcore_id();
if (pipeline_cgnapt_parse_args(p_timer, params))
return NULL;
+ cgnapt_timeout = rte_get_tsc_hz() * timer_dyn_timeout;
+ printf("cgnapt_timerout%" PRIu64 "\n", cgnapt_timeout);
+
/* Create port alloc buffer */
timer_mempool = rte_mempool_create("timer_mempool",