unsigned long rx_total = 0, tx_total = 0, tx_err_total = 0;
const struct pmd_internals *internal = dev->data->dev_private;
- memset(igb_stats, 0, sizeof(*igb_stats));
-
imax = (internal->nb_queues < RTE_ETHDEV_QUEUE_STAT_CNTRS ?
internal->nb_queues : RTE_ETHDEV_QUEUE_STAT_CNTRS);
for (i = 0; i < imax; i++) {
if (*internals == NULL)
goto error;
+ for (q = 0; q < nb_queues; q++) {
+ (*internals)->rx_queue[q].map = MAP_FAILED;
+ (*internals)->tx_queue[q].map = MAP_FAILED;
+ }
+
req = &((*internals)->req);
req->tp_block_size = blocksize;
rdsize = req->tp_frame_nr * sizeof(*(rx_queue->rd));
rx_queue->rd = rte_zmalloc_socket(name, rdsize, 0, numa_node);
+ if (rx_queue->rd == NULL)
+ goto error;
for (i = 0; i < req->tp_frame_nr; ++i) {
rx_queue->rd[i].iov_base = rx_queue->map + (i * framesize);
rx_queue->rd[i].iov_len = req->tp_frame_size;
tx_queue->map = rx_queue->map + req->tp_block_size * req->tp_block_nr;
tx_queue->rd = rte_zmalloc_socket(name, rdsize, 0, numa_node);
+ if (tx_queue->rd == NULL)
+ goto error;
for (i = 0; i < req->tp_frame_nr; ++i) {
tx_queue->rd[i].iov_base = tx_queue->map + (i * framesize);
tx_queue->rd[i].iov_len = req->tp_frame_size;
}
/* reserve an ethdev entry */
- *eth_dev = rte_eth_dev_allocate(name);
+ *eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);
if (*eth_dev == NULL)
goto error;
rte_free(pci_dev);
if (*internals) {
for (q = 0; q < nb_queues; q++) {
+ munmap((*internals)->rx_queue[q].map,
+ 2 * req->tp_block_size * req->tp_block_nr);
if ((*internals)->rx_queue[q].rd)
rte_free((*internals)->rx_queue[q].rd);
if ((*internals)->tx_queue[q].rd)