DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/6] net/tap: use correct tap name
@ 2017-01-31  9:42 Pascal Mazon
  2017-01-31  9:42 ` [dpdk-dev] [PATCH 2/6] net/tap: use correct channel for error logs Pascal Mazon
                   ` (8 more replies)
  0 siblings, 9 replies; 45+ messages in thread
From: Pascal Mazon @ 2017-01-31  9:42 UTC (permalink / raw)
  To: keith.wiles; +Cc: dev, Pascal Mazon

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

In tun_alloc() especially, we want to use the latter. Otherwise the
netdevice would be wrongly named "net_tap". Furthermore, creating
several tap vdev would point to the same netdevice.

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

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
---
 drivers/net/tap/rte_eth_tap.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 91f63f5468b2..8faf08551b9e 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -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,10 @@ 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);
+				RTE_LOG(ERR, PMD, "tun_alloc(%s) failed\n", pmd->name);
 				return -1;
 			}
 		}
@@ -493,7 +493,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 +516,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;
 }
-- 
2.8.0.rc0

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2017-02-02 21:55 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-31  9:42 [dpdk-dev] [PATCH 1/6] net/tap: use correct tap name Pascal Mazon
2017-01-31  9:42 ` [dpdk-dev] [PATCH 2/6] net/tap: use correct channel for error logs Pascal Mazon
2017-01-31 13:07   ` Ferruh Yigit
2017-01-31 16:58     ` Stephen Hemminger
2017-01-31 17:04       ` Wiles, Keith
2017-01-31  9:42 ` [dpdk-dev] [PATCH 3/6] net/tap: don't set fd value overwritten just below Pascal Mazon
2017-01-31  9:42 ` [dpdk-dev] [PATCH 4/6] net/tap: keep kernel-assigned MAC address Pascal Mazon
2017-01-31 13:13   ` Ferruh Yigit
2017-01-31  9:42 ` [dpdk-dev] [PATCH 5/6] net/tap: display tap name after parsing Pascal Mazon
2017-01-31 13:16   ` Ferruh Yigit
2017-01-31  9:42 ` [dpdk-dev] [PATCH 6/6] net/tap: implement link up and down callbacks Pascal Mazon
2017-01-31 13:21   ` Ferruh Yigit
2017-01-31 14:31     ` Pascal Mazon
2017-01-31 13:06 ` [dpdk-dev] [PATCH 1/6] net/tap: use correct tap name Ferruh Yigit
2017-01-31 14:23   ` Pascal Mazon
2017-01-31 15:28     ` Ferruh Yigit
2017-01-31 15:30       ` Pascal Mazon
2017-01-31 15:38         ` Ferruh Yigit
2017-01-31 15:44           ` Wiles, Keith
2017-01-31 15:44             ` Pascal Mazon
2017-01-31 16:06               ` Wiles, Keith
2017-01-31 16:39                 ` Pascal Mazon
2017-01-31 23:29                   ` Wiles, Keith
2017-02-01  8:11                     ` Pascal Mazon
2017-02-01 15:25                       ` Wiles, Keith
2017-02-01 15:40                         ` Pascal Mazon
2017-02-01 15:55                           ` Wiles, Keith
2017-02-01 17:50                             ` Ferruh Yigit
2017-02-02  8:05                               ` Pascal Mazon
2017-02-02  8:25                                 ` Pascal Mazon
2017-02-02 10:23                                   ` Ferruh Yigit
2017-01-31 14:52 ` Wiles, Keith
2017-01-31 15:14   ` Ferruh Yigit
2017-01-31 15:19     ` Wiles, Keith
2017-02-02 13:46 ` Wiles, Keith
2017-02-02 16:17 ` [dpdk-dev] [PATCH v2 1/7] " Pascal Mazon
2017-02-02 16:17   ` [dpdk-dev] [PATCH v2 2/7] net/tap: use correct channel for error logs Pascal Mazon
2017-02-02 16:18   ` [dpdk-dev] [PATCH v2 3/7] net/tap: don't set fd value overwritten just below Pascal Mazon
2017-02-02 16:18   ` [dpdk-dev] [PATCH v2 4/7] net/tap: keep kernel-assigned MAC address Pascal Mazon
2017-02-02 16:18   ` [dpdk-dev] [PATCH v2 5/7] net/tap: display tap name after parsing Pascal Mazon
2017-02-02 16:18   ` [dpdk-dev] [PATCH v2 6/7] net/tap: implement link up and down callbacks Pascal Mazon
2017-02-02 16:18   ` [dpdk-dev] [PATCH v2 7/7] net/tap: support promiscuous and allmulti setting Pascal Mazon
2017-02-02 16:23   ` [dpdk-dev] [PATCH v2 1/7] net/tap: use correct tap name Wiles, Keith
2017-02-02 16:24     ` Wiles, Keith
2017-02-02 21:55       ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).