MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tx_thread

Function tx_thread

dpdk/examples/packet_ordering/main.c:632–674  ·  view source on GitHub ↗

* Dequeue mbufs from the workers_to_tx ring and transmit them */

Source from the content-addressed store, hash-verified

630 * Dequeue mbufs from the workers_to_tx ring and transmit them
631 */
632static int
633tx_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
676int
677main(int argc, char **argv)

Callers

nothing calls this directly

Calls 5

rte_lcore_idFunction · 0.85
configure_tx_buffersFunction · 0.85
rte_ring_dequeue_burstFunction · 0.85
rte_pktmbuf_freeFunction · 0.85
rte_eth_tx_bufferFunction · 0.85

Tested by

no test coverage detected