From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 60040AAD0 for ; Tue, 3 Apr 2018 10:27:32 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id f125so33062773wme.4 for ; Tue, 03 Apr 2018 01:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=qiu25cSURXO8XXpKOQmg3Lb5R2462KyK+ZDPnTiFy+E=; b=T8XH29MAbNQYLoaovVHsmOlWheCgTgb5AnGvBtCSdCacw7T1cRlxtt+lLOnzQDCwfr Pl7+m7J5D+pzrmyS2pU6aQAG2RAUCE/QUy0N6/sFWDQIRQ5drxHryHD1V73ASWxhC7aA QuNoP9prtVT5+qcLcu+7hlPKy2KKkiQd7V/1tix0/Y5KEBp/YYaUSl9ZBAHGykFvSZeY 0/vXT6LZ2xw4S1WEZF0Ai3EdTJMJODf252wLmANQDTXFfyr65l2q5LASQD+QQmNO7QKA 47BELd5czXMm++bWDKaLC5XBYeM06TQ5VSOG9h3ARAwH1ohd3sOKgBLIigywcdH0jgNV ttkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=qiu25cSURXO8XXpKOQmg3Lb5R2462KyK+ZDPnTiFy+E=; b=FTi/zafTON8oLkl5KwuOYH7Iv1lrplSa4xnVfI+U5evM4iCL+WbYR27NhS+EqxpmKn PRbvR6lDgpAWFoZvMgx//caVVBA7S7ypo+IgXaNp1NkbAsWu3PLZgUUV+SVTjA8a3F8K QPM/PjuGWg0TKZBVIFDYKWWtUZymqEO0klT2klC/awVH6PUJZImBA3LDJl8n4SJKVR7X uZBf+Gnr2oMrrtTsoZ8c816zCTYUvOaVlw5z99+QRqQEVsVB0CnFBppjV0YZ+cAtqtg3 7AZYsae8Cd9t3f+NiWDwpw7IHa2jNTfDx2YokxUucvPrTTqwptGpOrakDBrdgcVhzGOy 90cg== X-Gm-Message-State: ALQs6tDiigO5oDFsGTzc6q6+bSoyVDP4zpSHSPu8nOwFWJ0WeRJ8CHc5 dnwMXvur/jvF8URhC+11tVWO5g== X-Google-Smtp-Source: AIpwx4+OjP5Bwo9Z+tk8ISdv91mdRQjCwguKvc/nEvibaHLNd7jfbalffPScC760ozIZWgi7HjZ09w== X-Received: by 10.28.230.156 with SMTP id e28mr3294759wmi.28.1522744052001; Tue, 03 Apr 2018 01:27:32 -0700 (PDT) Received: from [192.168.1.58] (82.107.69.91.rev.sfr.net. [91.69.107.82]) by smtp.gmail.com with ESMTPSA id w40sm4064495wrc.33.2018.04.03.01.27.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 01:27:31 -0700 (PDT) To: Vipin Varghese , dev@dpdk.org, ferruh.yigit@intel.com References: <1519625719-10443-1-git-send-email-vipin.varghese@intel.com> <1522705068-18198-1-git-send-email-vipin.varghese@intel.com> <1522705068-18198-2-git-send-email-vipin.varghese@intel.com> From: Pascal Mazon Message-ID: Date: Tue, 3 Apr 2018 10:27:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1522705068-18198-2-git-send-email-vipin.varghese@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH 2/2] net/tap: add tun log and documnetation 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: Tue, 03 Apr 2018 08:27:32 -0000 Hi, I'm not sure why you split this patch in two. It seemed to me that it was fine to change the doc+logs in the same patch as the code. Especially since documentation change is very small. Anyway, there's just the "documnetation" typo in the commit title, otherwise it's fine by me. Best regards, Pascal On 02/04/2018 23:37, Vipin Varghese wrote: > The changes add TUN|TAP specific logs and documentation support. > > Signed-off-by: Vipin Varghese > --- > doc/guides/nics/tap.rst | 15 +++++++++++++-- > drivers/net/tap/rte_eth_tap.c | 28 ++++++++++++++++------------ > 2 files changed, 29 insertions(+), 14 deletions(-) > > diff --git a/doc/guides/nics/tap.rst b/doc/guides/nics/tap.rst > index 76eb0bd..c97786a 100644 > --- a/doc/guides/nics/tap.rst > +++ b/doc/guides/nics/tap.rst > @@ -1,8 +1,8 @@ > .. SPDX-License-Identifier: BSD-3-Clause > Copyright(c) 2016 Intel Corporation. > > -Tap Poll Mode Driver > -==================== > +Tun|Tap Poll Mode Driver > +======================== > > The ``rte_eth_tap.c`` PMD creates a device using TAP interfaces on the > local host. The PMD allows for DPDK and the host to communicate using a raw > @@ -83,6 +83,17 @@ can utilize that stack to handle the network protocols. Plus you would be able > to address the interface using an IP address assigned to the internal > interface. > > +The TUN PMD allows user to create a TUN device on host. The PMD allows user > +to transmit and receive packets via DPDK API calls with L3 header and payload. > +The devices in host can be accessed via ``ifconfig`` or ``ip`` command. TUN > +interfaces are passed to DPDK ``rte_eal_init`` arguments as ``--vdev=net_tunX``, > +where X stands for unique id, example:: > + > + --vdev=net_tun0 --vdev=net_tun1,iface=foo1, ... > + > +Unlike TAP PMD, TUN PMD does not support user arguments as ``MAC`` or ``remote`` user > +options. Default interface name is ``dtunX``, where X stands for unique id. > + > Flow API support > ---------------- > > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c > index 295db3c..7c6704b 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -121,17 +121,19 @@ enum ioctl_mode { > > fd = open(TUN_TAP_DEV_PATH, O_RDWR); > if (fd < 0) { > - RTE_LOG(ERR, PMD, "Unable to create TAP interface\n"); > + RTE_LOG(ERR, PMD, "Unable to create %s interface\n", > + tuntap_name); > goto error; > } > > #ifdef IFF_MULTI_QUEUE > /* Grab the TUN features to verify we can work multi-queue */ > if (ioctl(fd, TUNGETFEATURES, &features) < 0) { > - RTE_LOG(ERR, PMD, "TAP unable to get TUN/TAP features\n"); > + RTE_LOG(ERR, PMD, "%s unable to get TUN/TAP features\n", > + tuntap_name); > goto error; > } > - RTE_LOG(DEBUG, PMD, " TAP Features %08x\n", features); > + RTE_LOG(DEBUG, PMD, "%s Features %08x\n", tuntap_name, features); > > if (features & IFF_MULTI_QUEUE) { > RTE_LOG(DEBUG, PMD, " Multi-queue support for %d queues\n", > @@ -1133,7 +1135,7 @@ enum ioctl_mode { > tmp = &(*tmp)->next; > } > > - RTE_LOG(DEBUG, PMD, " RX TAP device name %s, qid %d on fd %d\n", > + RTE_LOG(DEBUG, PMD, " RX TUNTAP device name %s, qid %d on fd %d\n", > internals->name, rx_queue_id, internals->rxq[rx_queue_id].fd); > > return 0; > @@ -1188,7 +1190,7 @@ enum ioctl_mode { > if (ret == -1) > return -1; > RTE_LOG(DEBUG, PMD, > - " TX TAP device name %s, qid %d on fd %d csum %s\n", > + " TX TUNTAP device name %s, qid %d on fd %d csum %s\n", > internals->name, tx_queue_id, internals->txq[tx_queue_id].fd, > txq->csum ? "on" : "off"); > > @@ -1371,17 +1373,19 @@ enum ioctl_mode { > struct ifreq ifr; > int i; > > - RTE_LOG(DEBUG, PMD, " TAP device on numa %u\n", rte_socket_id()); > + RTE_LOG(DEBUG, PMD, "%s device on numa %u\n", > + tuntap_name, rte_socket_id()); > > data = rte_zmalloc_socket(tap_name, sizeof(*data), 0, numa_node); > if (!data) { > - RTE_LOG(ERR, PMD, "TAP Failed to allocate data\n"); > + RTE_LOG(ERR, PMD, "%s Failed to allocate data\n", tuntap_name); > goto error_exit_nodev; > } > > dev = rte_eth_vdev_allocate(vdev, sizeof(*pmd)); > if (!dev) { > - RTE_LOG(ERR, PMD, "TAP Unable to allocate device struct\n"); > + RTE_LOG(ERR, PMD, "%s Unable to allocate device struct\n", > + tuntap_name); > goto error_exit_nodev; > } > > @@ -1392,8 +1396,8 @@ enum ioctl_mode { > pmd->ioctl_sock = socket(AF_INET, SOCK_DGRAM, 0); > if (pmd->ioctl_sock == -1) { > RTE_LOG(ERR, PMD, > - "TAP Unable to get a socket for management: %s\n", > - strerror(errno)); > + "%s Unable to get a socket for management: %s\n", > + tuntap_name, strerror(errno)); > goto error_exit; > } > > @@ -1557,8 +1561,8 @@ enum ioctl_mode { > rte_eth_dev_release_port(dev); > > error_exit_nodev: > - RTE_LOG(ERR, PMD, "TAP Unable to initialize %s\n", > - rte_vdev_device_name(vdev)); > + RTE_LOG(ERR, PMD, "%s Unable to initialize %s\n", > + tuntap_name, rte_vdev_device_name(vdev)); > > rte_free(data); > return -EINVAL;