[dpdk-dev] [PATCH] net/tap: add default name to tun

Stephen Hemminger stephen at networkplumber.org
Fri May 11 17:24:45 CEST 2018


On Fri, 11 May 2018 14:11:59 +0530
Vipin Varghese <vipin.varghese at 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 at 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?


More information about the dev mailing list