X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=inline;f=examples%2Fip_pipeline%2Finit.c;h=bc6d6d945b9e7ff48902581f7c3c8eeeb50d3e51;hb=81bd65ff2d9b85e1ad0e33bdb317b7a0ec5cc85e;hp=28e959b42b8ae58bc991dc1a8690fb5861666128;hpb=8cefe7e694460172c9ae10dcd49a826beb0c8cf7;p=dpdk.git diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c index 28e959b42b..bc6d6d945b 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -49,7 +49,9 @@ #include "pipeline_passthrough.h" #include "pipeline_firewall.h" #include "pipeline_flow_classification.h" +#include "pipeline_flow_actions.h" #include "pipeline_routing.h" +#include "thread_fe.h" #define APP_NAME_SIZE 32 @@ -1339,6 +1341,8 @@ app_init_pipelines(struct app_params *app) "init error\n", params->name); } + data->ptype = ptype; + data->timer_period = (rte_get_tsc_hz() * params->timer_period) / 1000; } @@ -1372,6 +1376,25 @@ app_init_threads(struct app_params *app) t = &app->thread_data[lcore_id]; + t->timer_period = (rte_get_tsc_hz() * APP_THREAD_TIMER_PERIOD) / 1000; + t->thread_req_deadline = time + t->timer_period; + + t->msgq_in = app_thread_msgq_in_get(app, + params->socket_id, + params->core_id, + params->hyper_th_id); + if (t->msgq_in == NULL) + rte_panic("Init error: Cannot find MSGQ_IN for thread %" PRId32, + lcore_id); + + t->msgq_out = app_thread_msgq_out_get(app, + params->socket_id, + params->core_id, + params->hyper_th_id); + if (t->msgq_out == NULL) + rte_panic("Init error: Cannot find MSGQ_OUT for thread %" PRId32, + lcore_id); + ptype = app_pipeline_type_find(app, params->type); if (ptype == NULL) rte_panic("Init error: Unknown pipeline " @@ -1381,12 +1404,15 @@ app_init_threads(struct app_params *app) &t->regular[t->n_regular] : &t->custom[t->n_custom]; + p->pipeline_id = p_id; p->be = data->be; p->f_run = ptype->be_ops->f_run; p->f_timer = ptype->be_ops->f_timer; p->timer_period = data->timer_period; p->deadline = time + data->timer_period; + data->enabled = 1; + if (ptype->be_ops->f_run == NULL) t->n_regular++; else @@ -1407,9 +1433,11 @@ int app_init(struct app_params *app) app_init_msgq(app); app_pipeline_common_cmd_push(app); + app_pipeline_thread_cmd_push(app); app_pipeline_type_register(app, &pipeline_master); app_pipeline_type_register(app, &pipeline_passthrough); app_pipeline_type_register(app, &pipeline_flow_classification); + app_pipeline_type_register(app, &pipeline_flow_actions); app_pipeline_type_register(app, &pipeline_firewall); app_pipeline_type_register(app, &pipeline_routing); @@ -1444,7 +1472,7 @@ app_pipeline_type_cmd_push(struct app_params *app, /* Push pipeline commands into the application */ memcpy(&app->cmds[app->n_cmds], cmds, - n_cmds * sizeof(cmdline_parse_ctx_t *)); + n_cmds * sizeof(cmdline_parse_ctx_t)); for (i = 0; i < n_cmds; i++) app->cmds[app->n_cmds + i]->data = app;