From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 3F5D42170 for ; Thu, 13 Oct 2016 18:33:16 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 13 Oct 2016 09:33:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,340,1473145200"; d="scan'208";a="19279958" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga005.fm.intel.com with ESMTP; 13 Oct 2016 09:33:03 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.91]) by IRSMSX151.ger.corp.intel.com ([169.254.4.226]) with mapi id 14.03.0248.002; Thu, 13 Oct 2016 17:33:03 +0100 From: "Mcnamara, John" To: "Wiles, Keith" , "dev@dpdk.org" CC: "pmatilai@redhat.com" , "yuanhan.liu@linux.intel.com" , "Yigit, Ferruh" Thread-Topic: [dpdk-dev] [PATCH v8] drivers/net:new PMD using tun/tap host interface Thread-Index: AQHSJWyJ5TrkUxwv5keoglNLIqCUcqCmj4zw Date: Thu, 13 Oct 2016 16:33:02 +0000 Message-ID: References: <1474423220-10207-1-git-send-email-keith.wiles@intel.com> <1476375088-40892-1-git-send-email-keith.wiles@intel.com> In-Reply-To: <1476375088-40892-1-git-send-email-keith.wiles@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjZkZjIzNGQtODkwMC00OTFkLTk4NjgtNjA2MTkxMDcyNjY5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImFTbWNPRCtuM21IVWg3N1BtZmVVMStZRlV1XC94b080RnlJaWlhSmt5SjdBPSJ9 x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v8] drivers/net:new PMD using tun/tap host interface X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 16:33:16 -0000 Hi, Some doc comments below. Apologies, for the late review, I didn't see the docs inline. =20 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Keith Wiles > Sent: Thursday, October 13, 2016 5:11 PM > To: dev@dpdk.org > Cc: pmatilai@redhat.com; yuanhan.liu@linux.intel.com; Yigit, Ferruh > > Subject: [dpdk-dev] [PATCH v8] drivers/net:new PMD using tun/tap host > interface >=20 > The rte_eth_tap.c PMD creates a device using TUN/TAP interfaces on the > local host. The PMD allows for DPDK and the host to communicate using a > raw device interface on the host and in the DPDK application. The device > created is a Tap device with a L2 packet header. >=20 > v8 - Fix issue with tap_tx_queue_setup() not return zero on success. > v7 - Reword the comment in common_base and fix the data->name issue > v6 - fixed the checkpatch issues > v5 - merge in changes from list review see related emails > fixed many minor edits > v4 - merge with latest driver changes > v3 - fix includes by removing ifdef for other type besides Linux > Fix the copyright notice in the Makefile > v2 - merge all of the patches into one patch > Fix a typo on naming the tap device > Update the maintainers list >=20 > Signed-off-by: Keith Wiles > --- > MAINTAINERS | 5 + > config/common_base | 9 + > config/common_linuxapp | 1 + > doc/guides/nics/tap.rst | 138 ++++++ > drivers/net/Makefile | 1 + > drivers/net/tap/Makefile | 57 +++ > drivers/net/tap/rte_eth_tap.c | 756 You need to add "tap" to the doc/guides/nics/index.rst file to include the tap.rst in the docs. > + > +Tun/Tap Poll Mode Driver > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +The rte_eth_tap.c PMD creates a device using TUN/TAP interfaces on the > +local host. The PMD allows for DPDK and the host to communicate using a > +raw device interface on the host and in the DPDK application. > + > +The device created is a TAP device, which sends/receives packet in a > +raw format with a L2 header. The usage for a TAP PMD is for > +connectivity to the local host using a TAP interface. When the TAP PMD > +is initialized it will create a number of tap devices in the host > +accessed via 'ifconfig -a' or 'ip' command. The commands can be used to > assign and query the virtual like device. The apostrophes around the commands should be replaced with `` to render them as fixed width. > + > +These TAP interfaces can be used with wireshark or tcpdump or > +Pktgen-DPDK along with being able to be used as a network connection to > +the DPDK application. The method enable one or more interfaces is to > +use the --vdev=3Dnet_tap option on the DPDK application command line. > +Each --vdev=3Dnet_tap option give will create an interface named dtap0, > dtap1, ... and so forth. Same here, include any commands or variable names in backticks to render them as fixed width in the text: ``--vdev=3Dnet_tap`` > + > +.. code-block:: console > + > + The interfaced name can be changed by adding the iface=3Dfoo0 > + e.g. --vdev=3Dnet_tap,iface=3Dfoo0 --vdev=3Dnet_tap,iface=3Dfoo1, ... This would be better formatted as follows: The interfaced name can be changed by adding the ``iface=3Dfoo0``, for exam= ple:: --vdev=3Deth_tap,iface=3Dfoo0 --vdev=3Deth_tap,iface=3Dfoo1, ... > +If you have a Network Stack in your DPDK application or something like > +it you 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. > + > +A very crude test you can do the following: > + > +Apply the patch below and make sure you have socat installed on your > system. There is no patch below in the docs. ;-) Also, this would probably be bette= r as a new section. Something like: =20 Example ------- The following is a simple example of using the TUN/TAP PMD with the Pktgen packet generator. It requires that the ``socat`` utility is installed on th= e test system. Build DPDK, then pull down Pktgen and build pktgen using the DPDK SDK/Targe= t used to build the dpdk you pulled down. ... > + > +Build DPDK, then pull down Pktgen and build pktgen using the DPDK > +SDK/Target used to build the dpdk you pulled down. > + > +Run pktgen from the pktgen repo directory in an xterm: > + Note: change the -b options to blacklist all of your physical ports. > The > + following command line is all one line. The RST syntax for Note and the indentation are wrong here. Also the note would be better after the example. Something like: .. Note: Change the ``-b`` options to blacklist all of your physical ports. The following command line is all one line. Also, ``-f themes/black-yellow.theme`` is optional if the default colors work on your system configuration. See the Pktgen docs for more information. Finally, if you want to include the TAP PMD in the NIC overview table: http://dpdk.org/doc/guides/nics/overview.html You need to include a feature .ini file in the following dir: http://dpdk.org/browse/dpdk/tree/doc/guides/nics/features Use the default as an example: http://dpdk.org/browse/dpdk/tree/doc/guides/nics/features/default.ini Apart from those small changes it is a nice introduction and example code. John