| 129 | |
| 130 | |
| 131 | void |
| 132 | app_worker_thread(struct thread_conf **confs) |
| 133 | { |
| 134 | struct rte_mbuf *mbufs[burst_conf.ring_burst]; |
| 135 | struct thread_conf *conf; |
| 136 | int conf_idx = 0; |
| 137 | |
| 138 | while ((conf = confs[conf_idx])) { |
| 139 | uint32_t nb_pkt; |
| 140 | |
| 141 | /* Read packet from the ring */ |
| 142 | nb_pkt = rte_ring_sc_dequeue_burst(conf->rx_ring, (void **)mbufs, |
| 143 | burst_conf.ring_burst, NULL); |
| 144 | if (likely(nb_pkt)) { |
| 145 | int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs, |
| 146 | nb_pkt); |
| 147 | |
| 148 | APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent); |
| 149 | APP_STATS_ADD(conf->stat.nb_rx, nb_pkt); |
| 150 | } |
| 151 | |
| 152 | nb_pkt = rte_sched_port_dequeue(conf->sched_port, mbufs, |
| 153 | burst_conf.qos_dequeue); |
| 154 | if (likely(nb_pkt > 0)) |
| 155 | while (rte_ring_sp_enqueue_bulk(conf->tx_ring, |
| 156 | (void **)mbufs, nb_pkt, NULL) == 0) |
| 157 | ; /* empty body */ |
| 158 | |
| 159 | conf_idx++; |
| 160 | if (confs[conf_idx] == NULL) |
| 161 | conf_idx = 0; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | |
| 166 | void |
no test coverage detected