main processing loop */
| 29 | |
| 30 | /* main processing loop */ |
| 31 | static int |
| 32 | app_main_loop(__rte_unused void *dummy) |
| 33 | { |
| 34 | uint32_t lcore_id; |
| 35 | uint32_t i, mode; |
| 36 | uint32_t rx_idx = 0; |
| 37 | uint32_t wt_idx = 0; |
| 38 | uint32_t tx_idx = 0; |
| 39 | struct thread_conf *rx_confs[MAX_DATA_STREAMS]; |
| 40 | struct thread_conf *wt_confs[MAX_DATA_STREAMS]; |
| 41 | struct thread_conf *tx_confs[MAX_DATA_STREAMS]; |
| 42 | |
| 43 | memset(rx_confs, 0, sizeof(rx_confs)); |
| 44 | memset(wt_confs, 0, sizeof(wt_confs)); |
| 45 | memset(tx_confs, 0, sizeof(tx_confs)); |
| 46 | |
| 47 | |
| 48 | mode = APP_MODE_NONE; |
| 49 | lcore_id = rte_lcore_id(); |
| 50 | |
| 51 | for (i = 0; i < nb_pfc; i++) { |
| 52 | struct flow_conf *flow = &qos_conf[i]; |
| 53 | |
| 54 | if (flow->rx_core == lcore_id) { |
| 55 | flow->rx_thread.rx_port = flow->rx_port; |
| 56 | flow->rx_thread.rx_ring = flow->rx_ring; |
| 57 | flow->rx_thread.rx_queue = flow->rx_queue; |
| 58 | flow->rx_thread.sched_port = flow->sched_port; |
| 59 | |
| 60 | rx_confs[rx_idx++] = &flow->rx_thread; |
| 61 | |
| 62 | mode |= APP_RX_MODE; |
| 63 | } |
| 64 | if (flow->tx_core == lcore_id) { |
| 65 | flow->tx_thread.tx_port = flow->tx_port; |
| 66 | flow->tx_thread.tx_ring = flow->tx_ring; |
| 67 | flow->tx_thread.tx_queue = flow->tx_queue; |
| 68 | |
| 69 | tx_confs[tx_idx++] = &flow->tx_thread; |
| 70 | |
| 71 | mode |= APP_TX_MODE; |
| 72 | } |
| 73 | if (flow->wt_core == lcore_id) { |
| 74 | flow->wt_thread.rx_ring = flow->rx_ring; |
| 75 | flow->wt_thread.tx_ring = flow->tx_ring; |
| 76 | flow->wt_thread.tx_port = flow->tx_port; |
| 77 | flow->wt_thread.sched_port = flow->sched_port; |
| 78 | |
| 79 | wt_confs[wt_idx++] = &flow->wt_thread; |
| 80 | |
| 81 | mode |= APP_WT_MODE; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | if (mode == APP_MODE_NONE) { |
| 86 | RTE_LOG(INFO, APP, "lcore %u has nothing to do\n", lcore_id); |
| 87 | return -1; |
| 88 | } |
nothing calls this directly
no test coverage detected