[dpdk-dev,1/8] doc: add doc to explain compiling and testing of PMD

Message ID 1491465117-11252-2-git-send-email-shijith.thotton@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Shijith Thotton April 6, 2017, 7:51 a.m. UTC
  Add a section in NIC drivers documentation to explain compiling and
testing of a PMD. It also mentions about host setup, which is required
before running testpmd.

Add label "testpmd_ug" to refer user guide.

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
---
 doc/guides/nics/build_and_test.rst  | 134 ++++++++++++++++++++++++++++++++++++
 doc/guides/nics/index.rst           |   1 +
 doc/guides/testpmd_app_ug/index.rst |   2 +
 3 files changed, 137 insertions(+)
 create mode 100644 doc/guides/nics/build_and_test.rst
  

Comments

John McNamara April 6, 2017, 4:43 p.m. UTC | #1
> -----Original Message-----
> From: Shijith Thotton [mailto:shijith.thotton@caviumnetworks.com]
> Sent: Thursday, April 6, 2017 8:52 AM
> To: Mcnamara, John <john.mcnamara@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH 1/8] doc: add doc to explain compiling and testing of PMD
> 
> Add a section in NIC drivers documentation to explain compiling and
> testing of a PMD. It also mentions about host setup, which is required
> before running testpmd.
> 
> Add label "testpmd_ug" to refer user guide.
> 
> Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>


Acked-by: John McNamara <john.mcnamara@intel.com>
  
Thomas Monjalon April 6, 2017, 6:30 p.m. UTC | #2
2017-04-06 13:21, Shijith Thotton:
> Add a section in NIC drivers documentation to explain compiling and
> testing of a PMD. It also mentions about host setup, which is required
> before running testpmd.
> 
> Add label "testpmd_ug" to refer user guide.
> 
> Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>

It is really good to factorize documentation.

This doc is about testpmd in Linux
and does not refer to FreeBSD.
Do we assume to take Linux as the reference?
Should we refer to the Linux Getting Started Guide instead?
  
Shijith Thotton April 7, 2017, 7:07 a.m. UTC | #3
On Thu, Apr 06, 2017 at 08:30:21PM +0200, Thomas Monjalon wrote:
> 2017-04-06 13:21, Shijith Thotton:
> > Add a section in NIC drivers documentation to explain compiling and
> > testing of a PMD. It also mentions about host setup, which is required
> > before running testpmd.
> > 
> > Add label "testpmd_ug" to refer user guide.
> > 
> > Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
> 
> It is really good to factorize documentation.
> 
> This doc is about testpmd in Linux
> and does not refer to FreeBSD.
> Do we assume to take Linux as the reference?

I can submit v2 with a subsection for running testpmd in FreeBSD.

> Should we refer to the Linux Getting Started Guide instead?

Agree that the new section just has steps from getting started guide. It may
seem redundant from a developer point of view, but hope it will be useful to
users.

Please share thoughts.

Thanks,
Shijith
  
John McNamara April 7, 2017, 9:23 a.m. UTC | #4
> -----Original Message-----
> From: Shijith Thotton [mailto:shijith.thotton@caviumnetworks.com]
> Sent: Friday, April 7, 2017 8:07 AM
> To: Thomas Monjalon <thomas.monjalon@6wind.com>
> Cc: Mcnamara, John <john.mcnamara@intel.com>; dev@dpdk.org; Yigit, Ferruh
> <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 1/8] doc: add doc to explain compiling and
> testing of PMD
> 
> On Thu, Apr 06, 2017 at 08:30:21PM +0200, Thomas Monjalon wrote:
> > 2017-04-06 13:21, Shijith Thotton:
> > > Add a section in NIC drivers documentation to explain compiling and
> > > testing of a PMD. It also mentions about host setup, which is
> > > required before running testpmd.
> > >
> > > Add label "testpmd_ug" to refer user guide.
> > >
> > > Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
> >
> > It is really good to factorize documentation.
> >
> > This doc is about testpmd in Linux
> > and does not refer to FreeBSD.
> > Do we assume to take Linux as the reference?
> 
> I can submit v2 with a subsection for running testpmd in FreeBSD.

Hi,

> I can submit v2 with a subsection for running testpmd in FreeBSD.

I don't think that is necessary. You patch already calls out the
Linux and FreeBSD Getting Started Guides. I think that is enough.


@tmonjalo
For me this new "Compiling and testing a PMD for a NIC" section
is a way of avoiding duplicate sections in the NIC guides. I don't
think it has to be a definitive guide to TestPMD.

As and aside, I would like to do something similar with the sample
app guides, i.e., have one section on compilation that the other
app guides can refer to. I'll try to add that in the next release.

So for me this patchset is okay as it is.

John
  
Thomas Monjalon April 7, 2017, 9:34 a.m. UTC | #5
2017-04-07 09:23, Mcnamara, John:
> 
> > -----Original Message-----
> > From: Shijith Thotton [mailto:shijith.thotton@caviumnetworks.com]
> > Sent: Friday, April 7, 2017 8:07 AM
> > To: Thomas Monjalon <thomas.monjalon@6wind.com>
> > Cc: Mcnamara, John <john.mcnamara@intel.com>; dev@dpdk.org; Yigit, Ferruh
> > <ferruh.yigit@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH 1/8] doc: add doc to explain compiling and
> > testing of PMD
> > 
> > On Thu, Apr 06, 2017 at 08:30:21PM +0200, Thomas Monjalon wrote:
> > > 2017-04-06 13:21, Shijith Thotton:
> > > > Add a section in NIC drivers documentation to explain compiling and
> > > > testing of a PMD. It also mentions about host setup, which is
> > > > required before running testpmd.
> > > >
> > > > Add label "testpmd_ug" to refer user guide.
> > > >
> > > > Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
> > >
> > > It is really good to factorize documentation.
> > >
> > > This doc is about testpmd in Linux
> > > and does not refer to FreeBSD.
> > > Do we assume to take Linux as the reference?
> > 
> > I can submit v2 with a subsection for running testpmd in FreeBSD.
> 
> Hi,
> 
> > I can submit v2 with a subsection for running testpmd in FreeBSD.
> 
> I don't think that is necessary. You patch already calls out the
> Linux and FreeBSD Getting Started Guides. I think that is enough.
> 
> 
> @tmonjalo
> For me this new "Compiling and testing a PMD for a NIC" section
> is a way of avoiding duplicate sections in the NIC guides. I don't
> think it has to be a definitive guide to TestPMD.
> 
> As and aside, I would like to do something similar with the sample
> app guides, i.e., have one section on compilation that the other
> app guides can refer to. I'll try to add that in the next release.
> 
> So for me this patchset is okay as it is.

OK
I just wanted to start discussing about more factorization.
Thanks for leading this work, John.
  
Jerin Jacob April 7, 2017, 9:42 a.m. UTC | #6
-----Original Message-----
> Date: Fri, 7 Apr 2017 12:37:26 +0530
> From: Shijith Thotton <shijith.thotton@caviumnetworks.com>
> To: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: John Mcnamara <john.mcnamara@intel.com>, dev@dpdk.org, Ferruh Yigit
>  <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 1/8] doc: add doc to explain compiling and
>  testing of PMD
> User-Agent: Mutt/1.5.21 (2010-09-15)
> 
> On Thu, Apr 06, 2017 at 08:30:21PM +0200, Thomas Monjalon wrote:
> > 2017-04-06 13:21, Shijith Thotton:
> > > Add a section in NIC drivers documentation to explain compiling and
> > > testing of a PMD. It also mentions about host setup, which is required
> > > before running testpmd.
> > > 
> > > Add label "testpmd_ug" to refer user guide.
> > > 
> > > Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
> > 
> > It is really good to factorize documentation.
> > 
> > This doc is about testpmd in Linux
> > and does not refer to FreeBSD.
> > Do we assume to take Linux as the reference?
> 
> I can submit v2 with a subsection for running testpmd in FreeBSD.
> 
> > Should we refer to the Linux Getting Started Guide instead?
> 
> Agree that the new section just has steps from getting started guide. It may
> seem redundant from a developer point of view, but hope it will be useful to
> users.
> 
> Please share thoughts.

1) Some reason thunderx PMD is not added in refactoring. I guess its due
to x86 and arm64 name space collision in the common document, if so we need
to find a way to fix it and thunderx PMD.

2)I guess, It is better to keep all the startup logs in respective PMD.I
think, it will help in debugging in case there are any issues.


> 
> Thanks,
> Shijith
  
Shijith Thotton April 7, 2017, 10:10 a.m. UTC | #7
On Fri, Apr 07, 2017 at 03:12:25PM +0530, Jerin Jacob wrote:
> -----Original Message-----
> > Date: Fri, 7 Apr 2017 12:37:26 +0530
> > From: Shijith Thotton <shijith.thotton@caviumnetworks.com>
> > To: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: John Mcnamara <john.mcnamara@intel.com>, dev@dpdk.org, Ferruh Yigit
> >  <ferruh.yigit@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH 1/8] doc: add doc to explain compiling and
> >  testing of PMD
> > User-Agent: Mutt/1.5.21 (2010-09-15)
> > 
> > On Thu, Apr 06, 2017 at 08:30:21PM +0200, Thomas Monjalon wrote:
> > > 2017-04-06 13:21, Shijith Thotton:
> > > > Add a section in NIC drivers documentation to explain compiling and
> > > > testing of a PMD. It also mentions about host setup, which is required
> > > > before running testpmd.
> > > > 
> > > > Add label "testpmd_ug" to refer user guide.
> > > > 
> > > > Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
> > > 
> > > It is really good to factorize documentation.
> > > 
> > > This doc is about testpmd in Linux
> > > and does not refer to FreeBSD.
> > > Do we assume to take Linux as the reference?
> > 
> > I can submit v2 with a subsection for running testpmd in FreeBSD.
> > 
> > > Should we refer to the Linux Getting Started Guide instead?
> > 
> > Agree that the new section just has steps from getting started guide. It may
> > seem redundant from a developer point of view, but hope it will be useful to
> > users.
> > 
> > Please share thoughts.
> 
> 1) Some reason thunderx PMD is not added in refactoring. I guess its due
> to x86 and arm64 name space collision in the common document, if so we need
> to find a way to fix it and thunderx PMD.
> 

Made text more generic for all platforms and gave two examples.

	To compile a PMD for a platform, run make with proper target from config
	folder. Use “make” command in Linux and “gmake” in FreeBSD OS. It will
	also build testpmd.

	To compile a PMD for Linux x86_64 gcc target, run the following “make”
	command:

	cd <DPDK-source-directory>
	make install T=x86_64-native-linuxapp-gcc

	To compile the ThunderX NICVF PMD for Linux arm64 gcc target, run the
	following “make” command:

	cd <DPDK-source-directory>
	make config T=arm64-thunderx-linuxapp-gcc install


> 2)I guess, It is better to keep all the startup logs in respective PMD.I
> think, it will help in debugging in case there are any issues.
> 

+1
  

Patch

diff --git a/doc/guides/nics/build_and_test.rst b/doc/guides/nics/build_and_test.rst
new file mode 100644
index 0000000..4b87af6
--- /dev/null
+++ b/doc/guides/nics/build_and_test.rst
@@ -0,0 +1,134 @@ 
+..  BSD LICENSE
+    Copyright(c) 2017 Cavium, Inc.. All rights reserved.
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+
+    * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+    * Neither the name of Cavium, Inc. nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+    OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+.. _pmd_build_and_test:
+
+Compiling and testing a PMD for a NIC
+=====================================
+
+This section demonstrates how to compile and run a Poll Mode Driver (PMD) for
+the available Network Interface Cards in DPDK using TestPMD.
+
+TestPMD is one of the reference applications distributed with the DPDK. Its main
+purpose is to forward packets between Ethernet ports on a network interface and
+as such is the best way to test a PMD.
+
+Refer to the :ref:`testpmd application user guide <testpmd_ug>` for detailed
+information on how to build and run testpmd.
+
+Driver Compilation
+------------------
+
+To compile a PMD for Linux x86_64 gcc target, run the following "make" command.
+It will also build testpmd.
+
+.. code-block:: console
+
+   cd <DPDK-source-directory>
+   make install T=x86_64-native-linuxapp-gcc
+
+
+FreeBSD targets should use "gmake" command instead of "make".
+
+For more information, refer to the :ref:`Getting Started Guide for Linux <linux_gsg>`
+or :ref:`Getting Started Guide for FreeBSD <freebsd_gsg>` depending on your platform.
+
+Running testpmd in Linux
+------------------------
+
+This section demonstrates how to setup and run ``testpmd`` in Linux.
+
+#. Mount huge pages:
+
+   .. code-block:: console
+
+      mkdir /mnt/huge
+      mount -t hugetlbfs nodev /mnt/huge
+
+#. Request huge pages:
+
+   .. code-block:: console
+
+      echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages/nr_hugepages
+
+#. Load ``igb_uio`` or ``vfio-pci`` driver:
+
+   .. code-block:: console
+
+      modprobe uio
+      insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
+
+   or
+
+   .. code-block:: console
+
+      modprobe vfio-pci
+
+#. Setup VFIO permissions for regular users before binding to ``vfio-pci``:
+
+   .. code-block:: console
+
+      sudo chmod a+x /dev/vfio
+
+      sudo chmod 0666 /dev/vfio/*
+
+#. Bind the adapters to ``igb_uio`` or ``vfio-pci`` loaded in the previous step:
+
+   .. code-block:: console
+
+      ./usertools/dpdk-devbind.py --bind igb_uio DEVICE1 DEVICE2 ...
+
+   Or setup VFIO permissions for regular users and then bind to ``vfio-pci``:
+
+   .. code-block:: console
+
+      ./usertools/dpdk-devbind.py --bind vfio-pci DEVICE1 DEVICE2 ...
+
+   .. note::
+
+      DEVICE1, DEVICE2 are specified via PCI "domain:bus:slot.func" syntax or
+      "bus:slot.func" syntax.
+
+#. Start ``testpmd`` with basic parameters:
+
+   .. code-block:: console
+
+      ./x86_64-native-linuxapp-gcc/app/testpmd -l 0-3 -n 4 -- -i
+
+   Successful execution will show initialization messages from EAL, PMD and
+   testpmd application. A prompt will be displayed at the end for user commands
+   as interactive mode (``-i``) is on.
+
+   .. code-block:: console
+
+      testpmd>
+
+   Refer to the :ref:`testpmd runtime functions <testpmd_runtime>` for a list
+   of available commands.
diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst
index 4537113..245b53d 100644
--- a/doc/guides/nics/index.rst
+++ b/doc/guides/nics/index.rst
@@ -36,6 +36,7 @@  Network Interface Controller Drivers
     :numbered:
 
     overview
+    build_and_test
     avp
     bnx2x
     bnxt
diff --git a/doc/guides/testpmd_app_ug/index.rst b/doc/guides/testpmd_app_ug/index.rst
index 1c39a17..61a9121 100644
--- a/doc/guides/testpmd_app_ug/index.rst
+++ b/doc/guides/testpmd_app_ug/index.rst
@@ -28,6 +28,8 @@ 
     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+.. _testpmd_ug:
+
 Testpmd Application User Guide
 ==============================