-/* Send the burst of packets on an output interface */
-static void
-l2fwd_send_burst(struct lcore_queue_conf *qconf, uint8_t port)
-{
- struct mbuf_table *m_table;
- uint16_t ret;
- uint16_t queueid = 0;
- uint16_t n;
-
- m_table = &qconf->tx_mbufs[port];
- n = m_table->len;
-
- m_table->next_flush_time = rte_get_timer_cycles() + drain_tsc;
- m_table->len = 0;
-
- ret = rte_eth_tx_burst(port, queueid, m_table->mbufs, n);
-
- port_statistics[port].tx += ret;
- if (unlikely(ret < n)) {
- port_statistics[port].dropped += (n - ret);
- do {
- rte_pktmbuf_free(m_table->mbufs[ret]);
- } while (++ret < n);
- }
-}
-
-/* Enqueue packets for TX and prepare them to be sent */
-static int
-l2fwd_send_packet(struct rte_mbuf *m, uint8_t port)
-{
- const unsigned lcore_id = rte_lcore_id();
- struct lcore_queue_conf *qconf = &lcore_queue_conf[lcore_id];
- struct mbuf_table *m_table = &qconf->tx_mbufs[port];
- uint16_t len = qconf->tx_mbufs[port].len;
-
- m_table->mbufs[len] = m;
-
- len++;
- m_table->len = len;
-
- /* Enough pkts to be sent. */
- if (unlikely(len == MAX_PKT_BURST))
- l2fwd_send_burst(qconf, port);
-
- return 0;
-}
-