| 164 | |
| 165 | |
| 166 | void |
| 167 | app_mixed_thread(struct thread_conf **confs) |
| 168 | { |
| 169 | struct rte_mbuf *mbufs[burst_conf.ring_burst]; |
| 170 | struct thread_conf *conf; |
| 171 | int conf_idx = 0; |
| 172 | |
| 173 | while ((conf = confs[conf_idx])) { |
| 174 | uint32_t nb_pkt; |
| 175 | |
| 176 | /* Read packet from the ring */ |
| 177 | nb_pkt = rte_ring_sc_dequeue_burst(conf->rx_ring, (void **)mbufs, |
| 178 | burst_conf.ring_burst, NULL); |
| 179 | if (likely(nb_pkt)) { |
| 180 | int nb_sent = rte_sched_port_enqueue(conf->sched_port, mbufs, |
| 181 | nb_pkt); |
| 182 | |
| 183 | APP_STATS_ADD(conf->stat.nb_drop, nb_pkt - nb_sent); |
| 184 | APP_STATS_ADD(conf->stat.nb_rx, nb_pkt); |
| 185 | } |
| 186 | |
| 187 | |
| 188 | nb_pkt = rte_sched_port_dequeue(conf->sched_port, mbufs, |
| 189 | burst_conf.qos_dequeue); |
| 190 | if (likely(nb_pkt > 0)) { |
| 191 | uint16_t nb_tx = rte_eth_tx_burst(conf->tx_port, 0, mbufs, nb_pkt); |
| 192 | if (nb_tx != nb_pkt) |
| 193 | rte_pktmbuf_free_bulk(&mbufs[nb_tx], nb_pkt - nb_tx); |
| 194 | } |
| 195 | |
| 196 | conf_idx++; |
| 197 | if (confs[conf_idx] == NULL) |
| 198 | conf_idx = 0; |
| 199 | } |
| 200 | } |
no test coverage detected