net/tap: fix name

dev->data->name contains the device name, e.g. "net_tap0".
dev->data->dev_private->name contains the actual iface name,
e.g. "dtap0".

In any case, the name must to be consistent with the tun_alloc() call in
eth_dev_tap_create().

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
This commit is contained in:
Pascal Mazon 2017-02-02 17:17:58 +01:00 committed by Ferruh Yigit
parent 8fcd6c2cf1
commit 542594d3fb

View File

@ -410,6 +410,7 @@ tap_setup_queue(struct rte_eth_dev *dev,
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;
@ -419,11 +420,11 @@ tap_setup_queue(struct rte_eth_dev *dev,
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;
}
}
@ -493,7 +494,7 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
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;
}
@ -516,7 +517,7 @@ tap_tx_queue_setup(struct rte_eth_dev *dev,
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;
}