/* ethernet addresses of ports */
static struct rte_ether_addr dma_ports_eth_addr[RTE_MAX_ETHPORTS];
-static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
struct rte_mempool *dma_pktmbuf_pool;
/* Print out statistics for one port. */
port_statistics.tx[tx_config->rxtx_port] += nb_tx;
- /* Free any unsent packets. */
- if (unlikely(nb_tx < nb_dq))
+ if (unlikely(nb_tx < nb_dq)) {
+ port_statistics.tx_dropped[tx_config->rxtx_port] +=
+ (nb_dq - nb_tx);
+ /* Free any unsent packets. */
rte_mempool_put_bulk(dma_pktmbuf_pool,
(void *)&mbufs[nb_tx], nb_dq - nb_tx);
+ }
}
}
/* >8 End of transmitting packets from dmadev. */
"rte_eth_tx_queue_setup:err=%d,port=%u\n",
ret, portid);
- /* Initialize TX buffers */
- tx_buffer[portid] = rte_zmalloc_socket("tx_buffer",
- RTE_ETH_TX_BUFFER_SIZE(MAX_PKT_BURST), 0,
- rte_eth_dev_socket_id(portid));
- if (tx_buffer[portid] == NULL)
- rte_exit(EXIT_FAILURE,
- "Cannot allocate buffer for tx on port %u\n",
- portid);
-
- rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST);
-
- ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[portid],
- rte_eth_tx_buffer_count_callback,
- &port_statistics.tx_dropped[portid]);
- if (ret < 0)
- rte_exit(EXIT_FAILURE,
- "Cannot set error callback for tx buffer on port %u\n",
- portid);
-
/* Start device. 8< */
ret = rte_eth_dev_start(portid);
if (ret < 0)