* Dequeue mbufs from the workers_to_tx ring and transmit them */
| 630 | * Dequeue mbufs from the workers_to_tx ring and transmit them |
| 631 | */ |
| 632 | static int |
| 633 | tx_thread(struct rte_ring *ring_in) |
| 634 | { |
| 635 | uint32_t i, dqnum; |
| 636 | uint8_t outp; |
| 637 | unsigned sent; |
| 638 | struct rte_mbuf *mbufs[MAX_PKTS_BURST]; |
| 639 | struct rte_eth_dev_tx_buffer *outbuf; |
| 640 | static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; |
| 641 | |
| 642 | RTE_LOG(INFO, REORDERAPP, "%s() started on lcore %u\n", __func__, |
| 643 | rte_lcore_id()); |
| 644 | |
| 645 | configure_tx_buffers(tx_buffer); |
| 646 | |
| 647 | while (!quit_signal) { |
| 648 | |
| 649 | /* deque the mbufs from workers_to_tx ring */ |
| 650 | dqnum = rte_ring_dequeue_burst(ring_in, |
| 651 | (void *)mbufs, MAX_PKTS_BURST, NULL); |
| 652 | |
| 653 | if (unlikely(dqnum == 0)) |
| 654 | continue; |
| 655 | |
| 656 | app_stats.tx.dequeue_pkts += dqnum; |
| 657 | |
| 658 | for (i = 0; i < dqnum; i++) { |
| 659 | outp = mbufs[i]->port; |
| 660 | /* skip ports that are not enabled */ |
| 661 | if ((portmask & (1 << outp)) == 0) { |
| 662 | rte_pktmbuf_free(mbufs[i]); |
| 663 | continue; |
| 664 | } |
| 665 | |
| 666 | outbuf = tx_buffer[outp]; |
| 667 | sent = rte_eth_tx_buffer(outp, 0, outbuf, mbufs[i]); |
| 668 | if (sent) |
| 669 | app_stats.tx.ro_tx_pkts += sent; |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | return 0; |
| 674 | } |
| 675 | |
| 676 | int |
| 677 | main(int argc, char **argv) |
nothing calls this directly
no test coverage detected