DPDK patches and discussions
 help / color / mirror / Atom feed
From: Vipin Varghese <vipin.varghese@intel.com>
To: ferruh.yigit@intel.com, stephen@networkplumber.org, dev@dpdk.org
Cc: Vipin Varghese <vipin.varghese@intel.com>
Subject: [dpdk-dev] [PATCH v2] net/tap: add default name to tun
Date: Sat, 12 May 2018 11:51:33 +0530	[thread overview]
Message-ID: <1526106093-78092-1-git-send-email-vipin.varghese@intel.com> (raw)
In-Reply-To: <1526028119-142177-1-git-send-email-vipin.varghese@intel.com>

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>
---

Changes in V2:
unsigned instead of signed for dev_index - Stephen Hemminger
---
 drivers/net/tap/rte_eth_tap.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 172a7ba..48c61b3 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -65,7 +65,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];
@@ -1665,6 +1665,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);
 
-- 
2.7.4

  parent reply	other threads:[~2018-05-12  6:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11  8:41 [dpdk-dev] [PATCH] " Vipin Varghese
2018-05-11 15:24 ` Stephen Hemminger
2018-05-12  6:22   ` Varghese, Vipin
2018-05-12  6:21 ` Vipin Varghese [this message]
2018-05-14 16:01   ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
2018-05-14 16:12     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1526106093-78092-1-git-send-email-vipin.varghese@intel.com \
    --to=vipin.varghese@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).