X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_pipeline%2Fpipeline%2Fpipeline_master_be.c;h=9a7c8c135c208b14f742cce5e9edaa582423d544;hb=253624f46c9d34e6970ffa0dd709bb30399547fd;hp=ac0cbbc5ca0fac01281c33e5b1d1bae9a2a5e1db;hpb=ea0908c4ab89fad458deb3fae8d85725cbecafc9;p=dpdk.git diff --git a/examples/ip_pipeline/pipeline/pipeline_master_be.c b/examples/ip_pipeline/pipeline/pipeline_master_be.c index ac0cbbc5ca..9a7c8c135c 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, };