| 452 | } |
| 453 | |
| 454 | static struct thread_msg_rsp * |
| 455 | thread_msg_handle_pipeline_enable(struct thread_data *t, |
| 456 | struct thread_msg_req *req) |
| 457 | { |
| 458 | struct thread_msg_rsp *rsp = (struct thread_msg_rsp *) req; |
| 459 | struct pipeline_data *p = &t->pipeline_data[t->n_pipelines]; |
| 460 | uint32_t i; |
| 461 | |
| 462 | /* Request */ |
| 463 | if (t->n_pipelines >= THREAD_PIPELINES_MAX) { |
| 464 | rsp->status = -1; |
| 465 | return rsp; |
| 466 | } |
| 467 | |
| 468 | t->p[t->n_pipelines] = req->pipeline_enable.p; |
| 469 | |
| 470 | p->p = req->pipeline_enable.p; |
| 471 | for (i = 0; i < req->pipeline_enable.n_tables; i++) |
| 472 | p->table_data[i].a = |
| 473 | req->pipeline_enable.table[i].a; |
| 474 | |
| 475 | p->n_tables = req->pipeline_enable.n_tables; |
| 476 | |
| 477 | p->msgq_req = req->pipeline_enable.msgq_req; |
| 478 | p->msgq_rsp = req->pipeline_enable.msgq_rsp; |
| 479 | p->timer_period = |
| 480 | (rte_get_tsc_hz() * req->pipeline_enable.timer_period_ms) / 1000; |
| 481 | p->time_next = rte_get_tsc_cycles() + p->timer_period; |
| 482 | |
| 483 | t->n_pipelines++; |
| 484 | |
| 485 | /* Response */ |
| 486 | rsp->status = 0; |
| 487 | return rsp; |
| 488 | } |
| 489 | |
| 490 | static struct thread_msg_rsp * |
| 491 | thread_msg_handle_pipeline_disable(struct thread_data *t, |
no test coverage detected