From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id DE4DB1CD89 for ; Sat, 12 May 2018 08:21:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 May 2018 23:21:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,391,1520924400"; d="scan'208";a="53671767" Received: from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203]) by fmsmga004.fm.intel.com with ESMTP; 11 May 2018 23:21:30 -0700 From: Vipin Varghese To: ferruh.yigit@intel.com, stephen@networkplumber.org, dev@dpdk.org Cc: Vipin Varghese Date: Sat, 12 May 2018 11:51:33 +0530 Message-Id: <1526106093-78092-1-git-send-email-vipin.varghese@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526028119-142177-1-git-send-email-vipin.varghese@intel.com> References: <1526028119-142177-1-git-send-email-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v2] net/tap: add default name to tun X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2018 06:21:36 -0000 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 --- 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