diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 09:22:35 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 16:09:40 +0200 |
commit | 8b25d1ad5d2264bdfc2818c7bda74ee2697df6db (patch) | |
tree | 8c3c769777f7e66a2d1ba7dd7651b563cfde370b /examples/ip_pipeline/pipeline/pipeline_master_be.c | |
parent | 97f17497d162afdb82c8704bf097f0fee3724b2e (diff) |
Imported Upstream version 16.07-rc1
Change-Id: I40a523e52f12e8496fdd69e902824b0226c303de
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'examples/ip_pipeline/pipeline/pipeline_master_be.c')
-rw-r--r-- | examples/ip_pipeline/pipeline/pipeline_master_be.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/examples/ip_pipeline/pipeline/pipeline_master_be.c b/examples/ip_pipeline/pipeline/pipeline_master_be.c index ac0cbbc5..9a7c8c13 100644 --- a/examples/ip_pipeline/pipeline/pipeline_master_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_master_be.c @@ -48,6 +48,7 @@ struct pipeline_master { struct app_params *app; struct cmdline *cl; + int post_init_done; int script_file_done; } __rte_cache_aligned; @@ -77,6 +78,7 @@ pipeline_init(__rte_unused struct pipeline_params *params, void *arg) return NULL; } + p->post_init_done = 0; p->script_file_done = 0; if (app->script_file == NULL) p->script_file_done = 1; @@ -102,8 +104,20 @@ static int pipeline_run(void *pipeline) { struct pipeline_master *p = (struct pipeline_master *) pipeline; + struct app_params *app = p->app; int status; +#ifdef RTE_LIBRTE_KNI + uint32_t i; +#endif /* RTE_LIBRTE_KNI */ + /* Application post-init phase */ + if (p->post_init_done == 0) { + app_post_init(app); + + p->post_init_done = 1; + } + + /* Run startup script file */ if (p->script_file_done == 0) { struct app_params *app = p->app; int fd = open(app->script_file, O_RDONLY); @@ -124,6 +138,7 @@ pipeline_run(void *pipeline) p->script_file_done = 1; } + /* Command Line Interface (CLI) */ status = cmdline_poll(p->cl); if (status < 0) rte_panic("CLI poll error (%" PRId32 ")\n", status); @@ -132,6 +147,12 @@ pipeline_run(void *pipeline) rte_exit(0, "Bye!\n"); } +#ifdef RTE_LIBRTE_KNI + /* Handle KNI requests from Linux kernel */ + for (i = 0; i < app->n_pktq_kni; i++) + rte_kni_handle_request(app->kni[i]); +#endif /* RTE_LIBRTE_KNI */ + return 0; } @@ -146,5 +167,4 @@ struct pipeline_be_ops pipeline_master_be_ops = { .f_free = pipeline_free, .f_run = pipeline_run, .f_timer = pipeline_timer, - .f_track = NULL, }; |