* Data plane threads: main */
| 3079 | * Data plane threads: main |
| 3080 | */ |
| 3081 | int |
| 3082 | thread_main(void *arg __rte_unused) |
| 3083 | { |
| 3084 | struct thread_data *t; |
| 3085 | uint32_t thread_id, i; |
| 3086 | |
| 3087 | thread_id = rte_lcore_id(); |
| 3088 | t = &thread_data[thread_id]; |
| 3089 | |
| 3090 | /* Dispatch loop */ |
| 3091 | for (i = 0; ; i++) { |
| 3092 | uint32_t j; |
| 3093 | |
| 3094 | /* Data Plane */ |
| 3095 | for (j = 0; j < t->n_pipelines; j++) |
| 3096 | rte_pipeline_run(t->p[j]); |
| 3097 | |
| 3098 | /* Control Plane */ |
| 3099 | if ((i & 0xF) == 0) { |
| 3100 | uint64_t time = rte_get_tsc_cycles(); |
| 3101 | uint64_t time_next_min = UINT64_MAX; |
| 3102 | |
| 3103 | if (time < t->time_next_min) |
| 3104 | continue; |
| 3105 | |
| 3106 | /* Pipeline message queues */ |
| 3107 | for (j = 0; j < t->n_pipelines; j++) { |
| 3108 | struct pipeline_data *p = |
| 3109 | &t->pipeline_data[j]; |
| 3110 | uint64_t time_next = p->time_next; |
| 3111 | |
| 3112 | if (time_next <= time) { |
| 3113 | pipeline_msg_handle(p); |
| 3114 | rte_pipeline_flush(p->p); |
| 3115 | time_next = time + p->timer_period; |
| 3116 | p->time_next = time_next; |
| 3117 | } |
| 3118 | |
| 3119 | if (time_next < time_next_min) |
| 3120 | time_next_min = time_next; |
| 3121 | } |
| 3122 | |
| 3123 | /* Thread message queues */ |
| 3124 | { |
| 3125 | uint64_t time_next = t->time_next; |
| 3126 | |
| 3127 | if (time_next <= time) { |
| 3128 | thread_msg_handle(t); |
| 3129 | time_next = time + t->timer_period; |
| 3130 | t->time_next = time_next; |
| 3131 | } |
| 3132 | |
| 3133 | if (time_next < time_next_min) |
| 3134 | time_next_min = time_next; |
| 3135 | } |
| 3136 | |
| 3137 | t->time_next_min = time_next_min; |
| 3138 | } |
nothing calls this directly
no test coverage detected