| 59 | } |
| 60 | |
| 61 | void |
| 62 | app_rx_thread(struct thread_conf **confs) |
| 63 | { |
| 64 | uint32_t i, nb_rx; |
| 65 | struct rte_mbuf *rx_mbufs[burst_conf.rx_burst] __rte_cache_aligned; |
| 66 | struct thread_conf *conf; |
| 67 | int conf_idx = 0; |
| 68 | |
| 69 | uint32_t subport; |
| 70 | uint32_t pipe; |
| 71 | uint32_t traffic_class; |
| 72 | uint32_t queue; |
| 73 | uint32_t color; |
| 74 | |
| 75 | while ((conf = confs[conf_idx])) { |
| 76 | nb_rx = rte_eth_rx_burst(conf->rx_port, conf->rx_queue, rx_mbufs, |
| 77 | burst_conf.rx_burst); |
| 78 | |
| 79 | if (likely(nb_rx != 0)) { |
| 80 | APP_STATS_ADD(conf->stat.nb_rx, nb_rx); |
| 81 | |
| 82 | for(i = 0; i < nb_rx; i++) { |
| 83 | get_pkt_sched(rx_mbufs[i], |
| 84 | &subport, &pipe, &traffic_class, &queue, &color); |
| 85 | rte_sched_port_pkt_write(conf->sched_port, |
| 86 | rx_mbufs[i], |
| 87 | subport, pipe, |
| 88 | traffic_class, queue, |
| 89 | (enum rte_color) color); |
| 90 | } |
| 91 | |
| 92 | if (unlikely(rte_ring_sp_enqueue_bulk(conf->rx_ring, |
| 93 | (void **)rx_mbufs, nb_rx, NULL) == 0)) { |
| 94 | for(i = 0; i < nb_rx; i++) { |
| 95 | rte_pktmbuf_free(rx_mbufs[i]); |
| 96 | |
| 97 | APP_STATS_ADD(conf->stat.nb_drop, 1); |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | conf_idx++; |
| 102 | if (confs[conf_idx] == NULL) |
| 103 | conf_idx = 0; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void |
| 108 | app_tx_thread(struct thread_conf **confs) |
no test coverage detected