* [dpdk-dev] [PATCH] net/tap: add default name to tun
@ 2018-05-11 8:41 Vipin Varghese
2018-05-11 15:24 ` Stephen Hemminger
2018-05-12 6:21 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
0 siblings, 2 replies; 6+ messages in thread
From: Vipin Varghese @ 2018-05-11 8:41 UTC (permalink / raw)
To: ferruh.yigit, zhihong.wang, dev; +Cc: Vipin Varghese
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>
---
drivers/net/tap/rte_eth_tap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 172a7ba..fa59a76 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -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%d",
+ DEFAULT_TUN_NAME, tun_unit++);
+
if (params && (params[0] != '\0')) {
TAP_LOG(DEBUG, "parameters (%s)", params);
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/tap: add default name to tun
2018-05-11 8:41 [dpdk-dev] [PATCH] net/tap: add default name to tun Vipin Varghese
@ 2018-05-11 15:24 ` Stephen Hemminger
2018-05-12 6:22 ` Varghese, Vipin
2018-05-12 6:21 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2018-05-11 15:24 UTC (permalink / raw)
To: Vipin Varghese; +Cc: ferruh.yigit, zhihong.wang, dev
On Fri, 11 May 2018 14:11:59 +0530
Vipin Varghese <vipin.varghese@intel.com> wrote:
> 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>
> ---
> drivers/net/tap/rte_eth_tap.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index 172a7ba..fa59a76 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -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%d",
> + DEFAULT_TUN_NAME, tun_unit++);
Use unsigned to avoid integer wraparound?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] net/tap: add default name to tun
2018-05-11 15:24 ` Stephen Hemminger
@ 2018-05-12 6:22 ` Varghese, Vipin
0 siblings, 0 replies; 6+ messages in thread
From: Varghese, Vipin @ 2018-05-12 6:22 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Yigit, Ferruh, Wang, Zhihong, dev
Thanks Stephen, for pointing this out. I have shared a V2 for the same.
> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, May 11, 2018 8:55 PM
> To: Varghese, Vipin <vipin.varghese@intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Wang, Zhihong
> <zhihong.wang@intel.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/tap: add default name to tun
>
> On Fri, 11 May 2018 14:11:59 +0530
> Vipin Varghese <vipin.varghese@intel.com> wrote:
>
> > 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>
> > ---
> > drivers/net/tap/rte_eth_tap.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/tap/rte_eth_tap.c
> > b/drivers/net/tap/rte_eth_tap.c index 172a7ba..fa59a76 100644
> > --- a/drivers/net/tap/rte_eth_tap.c
> > +++ b/drivers/net/tap/rte_eth_tap.c
> > @@ -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%d",
> > + DEFAULT_TUN_NAME, tun_unit++);
>
> Use unsigned to avoid integer wraparound?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v2] net/tap: add default name to tun
2018-05-11 8:41 [dpdk-dev] [PATCH] net/tap: add default name to tun Vipin Varghese
2018-05-11 15:24 ` Stephen Hemminger
@ 2018-05-12 6:21 ` Vipin Varghese
2018-05-14 16:01 ` Ferruh Yigit
1 sibling, 1 reply; 6+ messages in thread
From: Vipin Varghese @ 2018-05-12 6:21 UTC (permalink / raw)
To: ferruh.yigit, stephen, dev; +Cc: Vipin Varghese
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/tap: add default name to tun
2018-05-12 6:21 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
@ 2018-05-14 16:01 ` Ferruh Yigit
2018-05-14 16:12 ` Ferruh Yigit
0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2018-05-14 16:01 UTC (permalink / raw)
To: Vipin Varghese, stephen, dev
On 5/12/2018 7:21 AM, Vipin Varghese wrote:
> 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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/tap: add default name to tun
2018-05-14 16:01 ` Ferruh Yigit
@ 2018-05-14 16:12 ` Ferruh Yigit
0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2018-05-14 16:12 UTC (permalink / raw)
To: Vipin Varghese, stephen, dev
On 5/14/2018 5:01 PM, Ferruh Yigit wrote:
> On 5/12/2018 7:21 AM, Vipin Varghese wrote:
>> 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>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-05-14 16:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11 8:41 [dpdk-dev] [PATCH] net/tap: add default name to tun Vipin Varghese
2018-05-11 15:24 ` Stephen Hemminger
2018-05-12 6:22 ` Varghese, Vipin
2018-05-12 6:21 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
2018-05-14 16:01 ` Ferruh Yigit
2018-05-14 16:12 ` 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).