Transmit packets from dmadev/rte_ring for one port. 8< */
| 476 | |
| 477 | /* Transmit packets from dmadev/rte_ring for one port. 8< */ |
| 478 | static void |
| 479 | dma_tx_port(struct rxtx_port_config *tx_config) |
| 480 | { |
| 481 | uint32_t i, j, nb_dq, nb_tx; |
| 482 | struct rte_mbuf *mbufs[MAX_PKT_BURST]; |
| 483 | |
| 484 | for (i = 0; i < tx_config->nb_queues; i++) { |
| 485 | |
| 486 | /* Dequeue the mbufs from rx_to_tx_ring. */ |
| 487 | nb_dq = rte_ring_dequeue_burst(tx_config->rx_to_tx_ring, |
| 488 | (void *)mbufs, MAX_PKT_BURST, NULL); |
| 489 | if (nb_dq == 0) |
| 490 | continue; |
| 491 | |
| 492 | /* Update macs if enabled */ |
| 493 | if (mac_updating) { |
| 494 | for (j = 0; j < nb_dq; j++) |
| 495 | update_mac_addrs(mbufs[j], |
| 496 | tx_config->rxtx_port); |
| 497 | } |
| 498 | |
| 499 | nb_tx = rte_eth_tx_burst(tx_config->rxtx_port, 0, |
| 500 | (void *)mbufs, nb_dq); |
| 501 | |
| 502 | port_statistics.tx[tx_config->rxtx_port] += nb_tx; |
| 503 | |
| 504 | if (unlikely(nb_tx < nb_dq)) { |
| 505 | port_statistics.tx_dropped[tx_config->rxtx_port] += |
| 506 | (nb_dq - nb_tx); |
| 507 | /* Free any unsent packets. */ |
| 508 | rte_mempool_put_bulk(dma_pktmbuf_pool, |
| 509 | (void *)&mbufs[nb_tx], nb_dq - nb_tx); |
| 510 | } |
| 511 | } |
| 512 | } |
| 513 | /* >8 End of transmitting packets from dmadev. */ |
| 514 | |
| 515 | /* Main rx processing loop for dmadev. */ |
no test coverage detected