struct pmd_internals *internals,
uint16_t qid)
{
+ struct pmd_internals *pmd = dev->data->dev_private;
struct rx_queue *rx = &internals->rxq[qid];
struct tx_queue *tx = &internals->txq[qid];
int fd;
fd = tx->fd;
if (fd < 0) {
RTE_LOG(INFO, PMD, "Add queue to TAP %s for qid %d\n",
- dev->data->name, qid);
- fd = tun_alloc(dev->data->name);
+ pmd->name, qid);
+ fd = tun_alloc(pmd->name);
if (fd < 0) {
RTE_LOG(ERR, PMD, "tun_alloc(%s) failed\n",
- dev->data->name);
+ pmd->name);
return -1;
}
}
internals->fds[rx_queue_id] = fd;
RTE_LOG(INFO, PMD, "RX TAP device name %s, qid %d on fd %d\n",
- dev->data->name, rx_queue_id, internals->rxq[rx_queue_id].fd);
+ internals->name, rx_queue_id, internals->rxq[rx_queue_id].fd);
return 0;
}
return -1;
RTE_LOG(INFO, PMD, "TX TAP device name %s, qid %d on fd %d\n",
- dev->data->name, tx_queue_id, internals->txq[tx_queue_id].fd);
+ internals->name, tx_queue_id, internals->txq[tx_queue_id].fd);
return 0;
}
data = rte_zmalloc_socket(tap_name, sizeof(*data), 0, numa_node);
if (!data) {
- RTE_LOG(INFO, PMD, "Failed to allocate data\n");
+ RTE_LOG(ERR, PMD, "Failed to allocate data\n");
goto error_exit;
}
pmd = rte_zmalloc_socket(tap_name, sizeof(*pmd), 0, numa_node);
if (!pmd) {
- RTE_LOG(INFO, PMD, "Unable to allocate internal struct\n");
+ RTE_LOG(ERR, PMD, "Unable to allocate internal struct\n");
goto error_exit;
}
/* Use the name and not the tap_name */
dev = rte_eth_dev_allocate(tap_name);
if (!dev) {
- RTE_LOG(INFO, PMD, "Unable to allocate device struct\n");
+ RTE_LOG(ERR, PMD, "Unable to allocate device struct\n");
goto error_exit;
}
/* Create the first Tap device */
fd = tun_alloc(tap_name);
if (fd < 0) {
- RTE_LOG(INFO, PMD, "tun_alloc() failed\n");
+ RTE_LOG(ERR, PMD, "tun_alloc() failed\n");
goto error_exit;
}
/* Presetup the fds to -1 as being not working */
- for (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) {
+ for (i = 1; i < RTE_PMD_TAP_MAX_QUEUES; i++) {
pmd->fds[i] = -1;
pmd->rxq[i].fd = -1;
pmd->txq[i].fd = -1;
pmd->fds[0] = fd;
if (pmd_mac_address(fd, dev, &pmd->eth_addr) < 0) {
- RTE_LOG(INFO, PMD, "Unable to get MAC address\n");
+ RTE_LOG(ERR, PMD, "Unable to get MAC address\n");
goto error_exit;
}