summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVipin Varghese <vipin.varghese@intel.com>2018-05-12 11:51:33 +0530
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 22:32:23 +0100
commitf5fd98c802e8911513fff217a01d0a61eba86ff1 (patch)
treeaa2e225ebc4619c9ad83978e7a32316e7799e212
parent2b9919feab751aabf7a8a8d33eb211c7126b9c1b (diff)
downloaddpdk-f5fd98c802e8911513fff217a01d0a61eba86ff1.zip
dpdk-f5fd98c802e8911513fff217a01d0a61eba86ff1.tar.gz
dpdk-f5fd98c802e8911513fff217a01d0a61eba86ff1.tar.xz
net/tap: add default name to tun
The change adds default name to reflect TUN PMD instance. if option name is not passed, the default dtun is taken. Signed-off-by: Vipin Varghese <vipin.varghese@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
-rw-r--r--drivers/net/tap/rte_eth_tap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index d3d1111..1d46078 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -66,7 +66,7 @@ static const char *valid_arguments[] = {
};
static int tap_unit;
-static int tun_unit;
+static unsigned int tun_unit;
static int tap_type;
static char tuntap_name[8];
@@ -1602,6 +1602,9 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
params = rte_vdev_device_args(dev);
memset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);
+ snprintf(tun_name, sizeof(tun_name), "%s%u",
+ DEFAULT_TUN_NAME, tun_unit++);
+
if (params && (params[0] != '\0')) {
TAP_LOG(DEBUG, "parameters (%s)", params);